Commit Graph

11 Commits

Author SHA1 Message Date
Jan Beich f2cf236da8 os: unbreak xsha1 on FreeBSD
../os/xsha1.c:36:10: fatal error: 'sha1.h' file not found
 #include <sha1.h>
          ^~~~~~~~
../os/xsha1.c:45:5: error: implicit declaration of function 'SHA1Init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    SHA1Init(ctx);
    ^
../os/xsha1.c:54:5: error: implicit declaration of function 'SHA1Update' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    SHA1Update(sha1_ctx, data, size);
    ^
../os/xsha1.c:63:5: error: implicit declaration of function 'SHA1Final' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    SHA1Final(result, sha1_ctx);
    ^
2020-05-27 07:15:07 +00:00
Carl Worth 7b076fdfc0 os/xsha1.c: Add license and copyright attribution.
I'm interested in copying this code to the mesa project, but before
doing that it seems prudent to have the license and copyright
attributions in place before copying that. To get this list of names I
went through:

	git log -- os/xsha1.c
and:
	git log -- render/glyph.c

Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-02 13:39:52 -08:00
Yaakov Selkowitz 54ba26cb1f os: Add libnettle as a choice of SHA1 implementation
libnettle is smaller than libgcrypt, currently being released more
frequently, and has replaced the latter in gnutls-3.x (which is used
by TigerVNC, so they can avoid pulling in two crypto libraries
simultaneously).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2012-11-05 13:34:18 -06:00
Yaakov Selkowitz e6461db6dc os: Add CryptoAPI as a choice of SHA1 implementation
Both Cygwin and MinGW can use Windows' native CryptoAPI for SHA1,
saving a dependency on libgcrypt or OpenSSL.  The necessary functions
are in ADVAPI32.DLL, which is among the default lib flags and is
already used in hw/xwin for accessing the registry.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2012-05-04 13:13:50 -05:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Jeremy Huddleston 6b109919f6 SHA1: Add support for Common Crypto
libSystem on darwin can handle SHA1 computation without needing to pull in
OpenSSL. See CC_crypto(3)

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-11-05 18:34:50 -08:00
Matthieu Herrb 48b8c076a7 add libc as a choice for SHA1 implementation
On Sun, Nov 01, 2009 at 02:54:13PM -0800, Keith Packard wrote:
> Excerpts from Matthieu Herrb's message of Sun Nov 01 09:34:35 -0800 2009:
>
> > +AC_CHECK_FUNCS([SHA1Init], [HAVE_LIBC_SHA1=yes])
>
> I'd suggest AC_CHECK_FUNC instead; as far as I can tell, AC_CHECK_FUNCS
> will also define HAVE_SHA1INIT. Also, can you  use HAVE_LIBC_SHA1
> consistently rather than having two separate names (HAVE_LIBC_SHA1 and
> HAVE_SHA1_IN_LIBC)? Yes, I know one is a preprocessor symbol and the
> other is a cpp shell variable, but I think that will work anyway.
>
New version taking you comments into account.

From: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Sun, 1 Nov 2009 18:19:27 +0100
Subject: [PATCH] Add a probe for SHA1 functions in libc in *BSD.

The interface is the same as the one in libmd.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-02 07:37:30 -08:00
Mikhail Gusarov ccf4a69db7 os: Add libsha1 as a choice of SHA1 implementation
There are small systems which don't need OpenSSL or gcrypt.
Add libsha1 (http://github.com/dottedmag/libsha1) as an alternative
small SHA1 implementation.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 15:49:38 -07:00
Julien Cristau a60e676f1f Add libgcrypt as an option for SHA1
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-15 01:18:03 +02:00
Julien Cristau 5551609494 Move SHA1 computation from render/glyph.c to os/
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-15 01:17:44 +02:00