]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
mangle gnutls-built ecc_scalar_random
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 15 Jul 2020 07:34:19 +0000 (09:34 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Fri, 14 Aug 2020 06:27:00 +0000 (08:27 +0200)
GNUTLS builds ecc-random.c but ecc_scalar_random() is a public API. So we
mangle the internal version we build.

ecc_mod_random is unaffected as it's an internal API that is mangled by GNUTLS.

Fixes #1016

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
devel/import-ecc-from-nettle.sh

index da121786dd20444eb40937b73c31758fa0fd4ce3..2ce6285d39204cf994e8d623b2a9a011f7e78f7d 100755 (executable)
@@ -202,7 +202,13 @@ for f in $IMPORTS; do
        ;;
       */ecc-random.c )
        sed \
-         -e 's/"nettle-internal\.h"/"nettle-alloca.h"/' \
+         -e '/^#include "nettle-internal\.h"/ { i\
+#include "nettle-alloca.h"\
+\
+void gnutls_ecc_scalar_random(struct ecc_scalar *, void *, nettle_random_func *);
+; d
+}' \
+         -e 's/ecc_scalar_random/gnutls_ecc_scalar_random/' \
          -e 's/^    & (mpn_sub_n/    \& (int)(mpn_sub_n/' \
          $dst > $dst-t && mv $dst-t $dst
        ;;