]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
nettle: rename import-chacha-from-nettle.sh to import-from-nettle.sh
authorDaiki Ueno <ueno@gnu.org>
Sun, 26 Apr 2020 17:26:48 +0000 (19:26 +0200)
committerDaiki Ueno <ueno@gnu.org>
Mon, 4 May 2020 12:26:13 +0000 (14:26 +0200)
This script will handle other backports except ECC as well.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
bootstrap.conf
devel/import-from-nettle.sh [moved from devel/import-chacha-from-nettle.sh with 83% similarity]
lib/nettle/Makefile.am
lib/nettle/cipher.c

index 04e670ddeba49bef477b90bc117a0f586a275b84..3693846aaf67382be5d6f27a761752f3efb8f025 100644 (file)
@@ -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
 }
similarity index 83%
rename from devel/import-chacha-from-nettle.sh
rename to devel/import-from-nettle.sh
index 4b686df76559b846c8426aad265c0be0ac78081e..835248e63fd875bd6d549e93db2d2d5afd1c3519 100755 (executable)
@@ -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
       ;;
index 9595aef53249008a706f5c3fceab86dd094a9b86..188abab8450f8ebf309f438995d732309f12c1ea 100644 (file)
@@ -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
index 35719357f49d9b43f3b032b0509cba4e5e0a82b4..0a94c49a95aa30c566cd732761dcca2fd2639ce2 100644 (file)
@@ -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>