diff options
-rw-r--r-- | bootstrap.conf | 2 | ||||
-rwxr-xr-x | devel/import-from-nettle.sh (renamed from devel/import-chacha-from-nettle.sh) | 14 | ||||
-rw-r--r-- | lib/nettle/Makefile.am | 12 | ||||
-rw-r--r-- | lib/nettle/cipher.c | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 04e670ddeb..3693846aaf 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -103,5 +103,5 @@ bootstrap_post_import_hook () touch ChangeLog || return 1 devel/import-ecc-from-nettle.sh - devel/import-chacha-from-nettle.sh + devel/import-from-nettle.sh } diff --git a/devel/import-chacha-from-nettle.sh b/devel/import-from-nettle.sh index 4b686df765..835248e63f 100755 --- a/devel/import-chacha-from-nettle.sh +++ b/devel/import-from-nettle.sh @@ -1,13 +1,13 @@ #!/bin/sh -# This script copies the ChaCha20 implementation from the -# nettle upstream, with necessary adjustments for bundling in GnuTLS. +# This script copies files from the nettle upstream, with necessary +# adjustments for bundling in GnuTLS. set +e : ${srcdir=.} SRC=$srcdir/devel/nettle -DST=$srcdir/lib/nettle/chacha +DST=$srcdir/lib/nettle/backport IMPORTS=" chacha-core-internal.c @@ -66,7 +66,7 @@ for f in $IMPORTS; do # Rename header guard so as not to conflict with the public ones. if grep '^#ifndef NETTLE_.*_H\(_INCLUDED\)*' $dst 2>&1 >/dev/null; then g=$(sed -n 's/^#ifndef NETTLE_\(.*_H\(_INCLUDED\)*\)/\1/p' $dst) - sed 's/\(NETTLE_'$g'\)/GNUTLS_LIB_NETTLE_CHACHA_\1/' $dst > $dst-t && \ + sed 's/\(NETTLE_'$g'\)/GNUTLS_LIB_NETTLE_BACKPORT_\1/' $dst > $dst-t && \ mv $dst-t $dst fi ;; @@ -74,9 +74,9 @@ for f in $IMPORTS; do case $dst in *.h) # Add prefix to function symbols avoid clashing with the public ones. - sed -e 's/^#define \(.*\) nettle_\1/#define \1 gnutls_nettle_chacha_\1/' \ - -e 's/^#define _\(.*\) _nettle_\1/#define _\1 _gnutls_nettle_chacha_\1/' \ - -e 's/^#define \(.*\) _nettle_\1/#define \1 _gnutls_nettle_chacha_\1/' \ + sed -e 's/^#define \(.*\) nettle_\1/#define \1 gnutls_nettle_backport_\1/' \ + -e 's/^#define _\(.*\) _nettle_\1/#define _\1 _gnutls_nettle_backport_\1/' \ + -e 's/^#define \(.*\) _nettle_\1/#define \1 _gnutls_nettle_backport_\1/' \ $dst > $dst-t && \ mv $dst-t $dst ;; diff --git a/lib/nettle/Makefile.am b/lib/nettle/Makefile.am index 9595aef532..188abab845 100644 --- a/lib/nettle/Makefile.am +++ b/lib/nettle/Makefile.am @@ -168,10 +168,10 @@ endif if NEED_CHACHA libcrypto_la_SOURCES += \ - chacha/chacha-core-internal.c chacha/chacha-crypt.c \ - chacha/chacha-internal.h chacha/chacha-poly1305.c \ - chacha/chacha-poly1305.h chacha/chacha-set-key.c \ - chacha/chacha-set-nonce.c chacha/chacha.h \ - chacha/poly1305.h chacha/poly1305-internal.c \ - chacha/poly1305-internal.h + backport/chacha-core-internal.c backport/chacha-crypt.c \ + backport/chacha-internal.h backport/chacha-poly1305.c \ + backport/chacha-poly1305.h backport/chacha-set-key.c \ + backport/chacha-set-nonce.c backport/chacha.h \ + backport/poly1305.h backport/poly1305-internal.c \ + backport/poly1305-internal.h endif diff --git a/lib/nettle/cipher.c b/lib/nettle/cipher.c index 35719357f4..0a94c49a95 100644 --- a/lib/nettle/cipher.c +++ b/lib/nettle/cipher.c @@ -49,8 +49,8 @@ #include <nettle/chacha.h> #include <nettle/chacha-poly1305.h> #else -#include "chacha/chacha.h" -#include "chacha/chacha-poly1305.h" +#include "chacha.h" +#include "chacha-poly1305.h" #endif #ifdef HAVE_NETTLE_CFB8_ENCRYPT #include <nettle/cfb.h> |