1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-17 12:41:05 +03:00
Commit Graph

40 Commits

Author SHA1 Message Date
Pádraig Brady
8e0f64e4cd md5, sha1, sha256, sha512: use openssl routines if available
--with-openssl the libcrypto md5, sha1, sha224, sha256, sha384, sha256
routines will be used if available, requiring apps to link @LIB_CRYPTO@

* lib/gl_openssl.h: Provide wrappers for specified openssl hash.
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): New function to lookup libcrypto
in the standard system location.
* m4/sha1.m4: Call gl_CRYPTO_CHECK() for SHA1.
* m4/sha256.m4: Likewise with SHA256.
* m4/sha512.m4: Likewise with SHA512.
* m4/md5.m4: Likewise with MD5.
* m4/gc.m4: Ensure @LIB_CRYPTO@ set for tests.
* lib/sha1.h: Include wrappers if HAVE_OPENSSL_SHA1.
* lib/sha256.h: Likewise with SHA256.
* lib/sha512.h: Likewise with SHA512.
* lib/md5.h: Likewise with MD5.
* lib/sha1.c: Exlude functionality if HAVE_OPENSSL_SHA1.
* lib/sha256.c: Likewise with SHA256.
* lib/sha512.c: Likewise with SHA512.
* lib/md5.c: Likewise with MD5.
* modules/crypto/sha1 (Link:): Add the new optional lib.
(Depends-on:): Add dependency on extern-inline.
* modules/crypto/sha256: Likewise.
* modules/crypto/sha512: Likewise.
* modules/crypto/md5: Likewise.
* modules/crypto/sha1-tests: Reference the lib here too.
* modules/crypto/md5-tests: Likewise.
* modules/crypto/gc-des-tests: Likewise.
* modules/crypto/gc-hmac-md5-tests: Likewise.
* modules/crypto/gc-hmac-sha1-tests: Likewise.
* modules/crypto/gc-hmac-sha256-tests: Likewise.
* modules/crypto/gc-hmac-sha512-tests: Likewise.
* modules/crypto/gc-md5-tests: Likewise.
* modules/crypto/gc-pbkdf2-sha1-tests: Likewise.
* modules/crypto/gc-sha1-tests: Likewise.
* modules/crypto/gc-tests: Likewise.
* modules/crypto/hmac-md5-tests: Likewise.
* modules/crypto/hmac-sha1-tests: Likewise.
* modules/crypto/hmac-sha256-tests: Likewise.
* modules/crypto/hmac-sha512-tests: Likewise.
2013-12-03 03:21:00 +00:00
Simon Josefsson
4e1dc0e3d7 gc: support HMAC-SHA256 and HMAC-SHA512.
* lib/gc.h: Add gc_hmac_sha256 and gc_hmac_sha512.
* lib/gc-libgcrypt.c (gc_hmac_sha256, gc_hmac_sha512): New
functions.
(gc_hmac_md5): Use symbolic constant.
* lib/gc-gnulib.c: Include hmac.h for HMAC-SHA256/512 too.
(gc_hmac_sha256, gc_hmac_sha512): New functions.
* lib/hmac.h: Add hmac_sha256 and hmac_sha512 prototypes.
* m4/sha256.m4: Protect against empty expansion.
* m4/sha512.m4: Likewise.
* lib/hmac-sha256.c: New file.
* lib/hmac-sha512.c: Likewise.
* m4/gc-hmac-sha256.m4: Likewise.
* m4/gc-hmac-sha512.m4: Likewise.
* m4/gc-sha256.m4: Likewise.
* m4/gc-sha512.m4: Likewise.
* modules/crypto/gc-hmac-sha256: Likewise.
* modules/crypto/gc-hmac-sha256-tests: Likewise.
* modules/crypto/gc-hmac-sha512: Likewise.
* modules/crypto/gc-hmac-sha512-tests: Likewise.
* modules/crypto/hmac-sha256: Likewise.
* modules/crypto/hmac-sha256-tests: Likewise.
* modules/crypto/hmac-sha512: Likewise.
* modules/crypto/hmac-sha512-tests: Likewise.
* tests/test-gc-hmac-sha256.c: Likewise.
* tests/test-gc-hmac-sha512.c: Likewise
* tests/test-hmac-sha256.c: Likewise.
* tests/test-hmac-sha512.c: Likewise
2013-08-26 21:31:15 +02:00
Paul Eggert
a9fb0ecaab modules/crypto/gc-*: simplify dependencies and fix stdalign.h bug
stdalign problem reported by Ian Beckwith in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00238.html>.
* modules/crypto/gc-arcfour (Depends-on):
Depend conditionally on crypto/arcfour.
* modules/crypto/gc-arctwo (Depends-on):
Depend conditionally on crypto/arctwo.
* modules/crypto/gc-des (Depends-on):
Depend conditionally on crypto/des.
* modules/crypto/gc-hmac-md5 (Depends-on):
Depend conditionally on crypto/hmac-md5.
* modules/crypto/gc-hmac-sha1 (Depends-on):
Depend conditionally on crypto/hmac-sha1.
* modules/crypto/gc-md2 (Depends-on): Remove stdint, minmax.
* modules/crypto/gc-md4 (Depends-on):
Depend conditionally on crypto/md4.
* modules/crypto/gc-md5 (Depends-on):
Depend conditionally on crypto/md5.
* modules/crypto/gc-rijndael (Depends-on):
Depend conditionally on crypto/rijndael.
* modules/crypto/gc-sha1 (Depends-on):
Depend conditionally on crypto/sha1.
* modules/crypto/gc-arcfour:
* modules/crypto/gc-arctwo:
* modules/crypto/gc-des:
* modules/crypto/gc-hmac-md5:
* modules/crypto/gc-hmac-sha1:
* modules/crypto/gc-md2:
* modules/crypto/gc-md4:
* modules/crypto/gc-md5:
* modules/crypto/gc-rijndael:
* modules/crypto/gc-sha1:
(Files, Depends-on, configure.ac): Remove now-unnecessary stuff,
now that the conditional dependencies do the work for us.
2011-11-17 22:09:26 -08:00
Paul Eggert
2d540c2cb2 crypto libraries: use stdalign
* lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
Include <stdalign.h> and <stdint.h>.  Do not include <stddef.h>.
Do not include <stdlib.h> twice, in md4.c.
(UNALIGNED_P): Simplify by using alignof.  Use uintptr_t, not size_t,
because we are accessing a pointer's bit-pattern, not a size.
* modules/crypto/gc-md4 (Depends-on): Add stdalign.
* modules/crypto/gc-md5, modules/crypto/gc-sha1, modules/crypto/md4:
* modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
* modules/crypto/sha512: Likewise.
2011-10-27 13:05:42 -07:00
Bruno Haible
6eedb6a104 crypto/gc-sha1: Fix recent regression.
* modules/crypto/gc-sha1 (configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-sha1.m4 (gl_GC_SHA1): Don't invoke gl_SHA1.
2011-06-17 01:11:47 +02:00
Bruno Haible
05da5d6d5e crypto/gc-md5: Fix recent regression.
* modules/crypto/gc-md5 (configure.ac): Invoke AC_LIBOBJ here.
2011-06-17 01:11:47 +02:00
Bruno Haible
d6e1452c5a crypto/gc-md4: Fix recent regression.
* modules/crypto/gc-md4 (configure.ac): Invoke AC_LIBOBJ here.
* m4/md4.m4 (gl_MD4): Ensure the expansion is non-empty.
2011-06-17 01:11:46 +02:00
Bruno Haible
0b3b74d564 crypto/gc-arctwo: Fix recent regression.
* modules/crypto/gc-arctwo (configure.ac): Invoke AC_LIBOBJ here.
* m4/arctwo.m4 (gl_ARCTWO): Ensure the expansion is non-empty.
2011-06-17 01:11:46 +02:00
Bruno Haible
20fd200278 crypto/gc-rijndael: Fix recent regression.
* modules/crypto/gc-rijndael (Files): Remove m4/rijndael.m4.
(configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-rijndael.m4 (gl_GC_RIJNDAEL): Don't invoke gl_RIJNDAEL.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
2011-06-17 01:11:46 +02:00
Bruno Haible
6b91542b2e crypto/gc-hmac-sha1: Fix recent regression.
* modules/crypto/gc-hmac-sha1 (Files): Remove m4/hmac-sha1.m4.
(configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-hmac-sha1.m4 (gl_GC_HMAC_SHA1): Don't invoke gl_HMAC_SHA1.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
2011-06-17 01:11:46 +02:00
Bruno Haible
56bf589760 crypto/gc-hmac-md5: Fix recent regression.
* modules/crypto/gc-hmac-md5 (Files): Remove m4/hmac-md5.m4.
(configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-hmac-md5.m4 (gl_GC_HMAC_MD5): Don't invoke gl_HMAC_MD5.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
2011-06-17 01:11:45 +02:00
Bruno Haible
96f8fde75f crypto/gc-des: Fix recent regression.
* modules/crypto/gc-des (Files): Remove m4/des.m4.
(configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-des.m4 (gl_GC_DES): Don't invoke gl_DES.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
2011-06-17 01:11:45 +02:00
Bruno Haible
395cc914b5 crypto/gc-arcfour: Fix recent regression.
* modules/crypto/gc-arcfour (Files): Remove m4/arcfour.m4.
(configure.ac): Invoke AC_LIBOBJ here.
* m4/gc-arcfour.m4 (gl_GC_ARCFOUR): Don't invoke gl_ARCFOUR.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
2011-06-17 01:11:45 +02:00
Bruno Haible
dfdc239ef4 crypto/sha512: Move AC_LIBOBJ invocations to module description.
* m4/sha512.m4 (gl_SHA512): Remove AC_LIBOBJ invocation.
* modules/crypto/sha512 (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:39 +02:00
Bruno Haible
47746a8d8c crypto/sha256: Move AC_LIBOBJ invocations to module description.
* m4/sha256.m4 (gl_SHA256): Remove AC_LIBOBJ invocation.
* modules/crypto/sha256 (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:38 +02:00
Bruno Haible
194ac9bf2d crypto/sha1: Move AC_LIBOBJ invocations to module description.
* m4/sha1.m4 (gl_SHA1): Remove AC_LIBOBJ invocation.
* modules/crypto/sha1 (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:38 +02:00
Bruno Haible
356644eb1a crypto/rijndael: Move AC_LIBOBJ invocations to module description.
* m4/rijndael.m4: Remove file.
* modules/crypto/rijndael (Files): Remove it.
(configure.ac): Remove gl_RIJNDAEL call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:35 +02:00
Bruno Haible
7da4d67b71 crypto/md5: Move AC_LIBOBJ invocations to module description.
* m4/md5.m4 (gl_MD5): Remove AC_LIBOBJ invocation.
* modules/crypto/md5 (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:30 +02:00
Bruno Haible
b5b37f450c crypto/md4: Move AC_LIBOBJ invocations to module description.
* m4/md4.m4 (gl_MD4): Remove AC_LIBOBJ invocation.
* modules/crypto/md4 (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:29 +02:00
Bruno Haible
595a46b55c crypto/md2: Move AC_LIBOBJ invocations to module description.
* m4/md2.m4: Remove file.
* modules/crypto/md2 (Files): Remove it.
(configure.ac): Remove gl_MD2 call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:29 +02:00
Bruno Haible
76565cde8c crypto/hmac-sha1: Move AC_LIBOBJ invocations to module description.
* m4/hmac-sha1.m4: Remove file.
* modules/crypto/hmac-sha1 (Files): Remove it.
(configure.ac): Remove gl_HMAC_SHA1 call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:27 +02:00
Bruno Haible
12df879cdc crypto/hmac-md5: Move AC_LIBOBJ invocations to module description.
* m4/hmac-md5.m4: Remove file.
* modules/crypto/hmac-md5 (Files): Remove it.
(configure.ac): Remove gl_HMAC_MD5 call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:27 +02:00
Bruno Haible
23120a4b85 crypto/gc-pbkdf2-sha1: Move AC_LIBOBJ invocations to module description.
* m4/gc-pbkdf2-sha1.m4: Remove file.
* modules/crypto/gc-pbkdf2-sha1 (Files): Remove it.
(configure.ac): Remove gl_GC_PBKDF2_SHA1 call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:25 +02:00
Bruno Haible
74a13df40c crypto/des: Move AC_LIBOBJ invocations to module description.
* m4/des.m4: Remove file.
* modules/crypto/des (Files): Remove it.
(configure.ac): Remove gl_DES call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:21 +02:00
Bruno Haible
3a8c97a08d crypto/arctwo: Move AC_LIBOBJ invocations to module description.
* m4/arctwo.m4 (gl_ARCTWO): Remove AC_LIBOBJ invocation.
* modules/crypto/arctwo (Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:16 +02:00
Bruno Haible
fa46928668 crypto/arcfour: Move AC_LIBOBJ invocations to module description.
* m4/arcfour.m4: Remove file.
* modules/crypto/arcfour (Files): Remove it.
(configure.ac): Remove gl_ARCFOUR call.
(Makefile.am): Augment lib_SOURCES.
2011-06-16 00:07:16 +02:00
Bruno Haible
9a5b92fa76 crypto/gc: Move AC_LIBOBJ invocations to module description.
* m4/gc.m4 (gl_GC): Move AC_LIBOBJ invocations from here...
* modules/crypto/gc (configure.ac): ... to here.
2011-06-16 00:06:03 +02:00
Bruno Haible
b771954f85 Remove unused GNULIB_XYZ macro definitions. 2010-03-28 19:39:32 +02:00
Eric Blake
edc6ae6158 tests: remove License section from module
Per modules/TEMPLATE-TESTS, test modules do not need a license
section.  This is because all tests are implicitly GPLv3+, with
no conflict even in an LGPL or GPLv2 client, because the tests
are not linked into the client executable.  Delete the existing
License sections with the following:

  find modules -name '*-tests' | xargs grep -l License \
    | xargs sed -i '/^$/N; /License:/,$ d'

* modules/arpa_inet-tests: Remove unneeded section.
* modules/byteswap-tests: Likewise.
* modules/ceilf-tests: Likewise.
* modules/ceill-tests: Likewise.
* modules/crypto/des-tests: Likewise.
* modules/crypto/gc-arcfour-tests: Likewise.
* modules/crypto/gc-arctwo-tests: Likewise.
* modules/crypto/gc-des-tests: Likewise.
* modules/crypto/gc-hmac-md5-tests: Likewise.
* modules/crypto/gc-hmac-sha1-tests: Likewise.
* modules/crypto/gc-md2-tests: Likewise.
* modules/crypto/gc-md4-tests: Likewise.
* modules/crypto/gc-md5-tests: Likewise.
* modules/crypto/gc-pbkdf2-sha1-tests: Likewise.
* modules/crypto/gc-rijndael-tests: Likewise.
* modules/crypto/gc-sha1-tests: Likewise.
* modules/crypto/gc-tests: Likewise.
* modules/crypto/md2-tests: Likewise.
* modules/crypto/md4-tests: Likewise.
* modules/fcntl-h-tests: Likewise.
* modules/floorf-tests: Likewise.
* modules/floorl-tests: Likewise.
* modules/frexp-nolibm-tests: Likewise.
* modules/frexp-tests: Likewise.
* modules/frexpl-nolibm-tests: Likewise.
* modules/frexpl-tests: Likewise.
* modules/getaddrinfo-tests: Likewise.
* modules/inttypes-tests: Likewise.
* modules/isfinite-tests: Likewise.
* modules/isinf-tests: Likewise.
* modules/ldexpl-tests: Likewise.
* modules/locale-tests: Likewise.
* modules/math-tests: Likewise.
* modules/netdb-tests: Likewise.
* modules/netinet_in-tests: Likewise.
* modules/printf-frexp-tests: Likewise.
* modules/printf-frexpl-tests: Likewise.
* modules/priv-set-tests: Likewise.
* modules/random_r-tests: Likewise.
* modules/round-tests: Likewise.
* modules/roundf-tests: Likewise.
* modules/roundl-tests: Likewise.
* modules/search-tests: Likewise.
* modules/select-tests: Likewise.
* modules/signal-tests: Likewise.
* modules/stdbool-tests: Likewise.
* modules/stddef-tests: Likewise.
* modules/stdint-tests: Likewise.
* modules/stdio-tests: Likewise.
* modules/stdlib-tests: Likewise.
* modules/string-tests: Likewise.
* modules/strings-tests: Likewise.
* modules/sys_select-tests: Likewise.
* modules/sys_socket-tests: Likewise.
* modules/sys_stat-tests: Likewise.
* modules/sys_time-tests: Likewise.
* modules/sys_utsname-tests: Likewise.
* modules/sysexits-tests: Likewise.
* modules/time-tests: Likewise.
* modules/trunc-tests: Likewise.
* modules/truncf-tests: Likewise.
* modules/truncl-tests: Likewise.
* modules/tsearch-tests: Likewise.
* modules/unistd-tests: Likewise.
* modules/wchar-tests: Likewise.
* modules/wctype-tests: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-12-29 20:55:37 -07:00
Simon Josefsson
8552e4ba0d New module u64. Make crypto/sha512 use it. 2009-03-31 16:27:55 +02:00
Bruno Haible
78008cd2e8 Mark 'memcmp' obsolete. 2008-11-02 16:57:03 +01:00
Simon Josefsson
ca19d955eb Add bitrotate module. 2008-08-29 14:51:37 +02:00
Jim Meyering
c0e92a8bc2 New modules: crypto/sha256, crypto/sha512 (from coreutils)
* modules/crypto/sha256: New file.
* modules/crypto/sha512: Likewise.
* lib/sha256.c: Likewise.
* lib/sha256.h: Likewise.
* lib/sha512.c: Likewise.
* lib/sha512.h: Likewise.
* lib/u64.h: Likewise.
* m4/sha256.m4: Likewise.
* m4/sha512.m4: Likewise.
* MODULES.html.sh (Cryptographic computations (low-level)): List them.
2008-05-11 09:11:36 +02:00
Simon Josefsson
e50ec111d3 Add sha1 self test. 2008-01-31 13:59:03 +01:00
Simon Josefsson
2d6501c921 Add module 'gc-camellia'. 2007-10-22 09:32:11 +02:00
Simon Josefsson
41529250d8 2007-08-07 Simon Josefsson <simon@josefsson.org>
* modules/crypto/arctwo (License): Use the synonymous term "LGPLv2+".
	* modules/crypto/arcfour (License): Likewise.
	* modules/crypto/des-tests (License): Likewise.
	* modules/crypto/gc-arctwo-tests (License): Likewise.
	* modules/crypto/gc-des-tests (License): Likewise.
	* modules/crypto/gc-hmac-md5-tests (License): Likewise.
	* modules/crypto/gc-hmac-sha1-tests (License): Likewise.
	* modules/crypto/gc-md2-tests (License): Likewise.
	* modules/crypto/gc-md4-tests (License): Likewise.
	* modules/crypto/gc-md5-tests (License): Likewise.
	* modules/crypto/gc-pbkdf2-sha1-tests (License): Likewise.
	* modules/crypto/gc-rijndael-tests (License): Likewise.
	* modules/crypto/gc-sha1-tests (License): Likewise.
	* modules/crypto/gc-tests (License): Likewise.
	* modules/crypto/hmac-md5 (License): Likewise.
	* modules/crypto/hmac-sha1 (License): Likewise.
	* modules/crypto/md2-tests (License): Likewise.
	* modules/crypto/md4-tests (License): Likewise.
	* modules/crypto/md5 (License): Likewise.
	* modules/crypto/rijndael (License): Likewise.
	* modules/crypto/sha1 (License): Likewise.
	* modules/memxor (License): Likewise.
2007-08-07 09:49:37 +00:00
Bruno Haible
b3027087e0 Use the synonymous term LGPLv2+. 2007-07-30 21:35:56 +00:00
Simon Josefsson
f9615db940 Move back memxor module. 2007-04-03 14:34:41 +00:00
Simon Josefsson
73d8c9222d Move modules/gc to crypto/. 2007-04-03 14:32:38 +00:00
Simon Josefsson
0527d3651d Move crypto modules to crypto/. 2007-04-01 08:38:41 +00:00