From 8a0f5bb3c11196a5bc0df6393a47e56c40adb7ac Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Fri, 14 Dec 2018 15:46:34 +0000 Subject: [PATCH] Make check-names.sh find the right names in 3rdparty Essentially adds the Everest .h and .c files to the various variables. This should be generalized at some point, but there is no infrastructure for this yet. --- 3rdparty/everest/include/everest/x25519.h | 3 ++- tests/scripts/check-names.sh | 4 +++- tests/scripts/list-enum-consts.pl | 3 +++ tests/scripts/list-identifiers.sh | 1 + tests/scripts/list-macros.sh | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 3rdparty/everest/include/everest/x25519.h diff --git a/3rdparty/everest/include/everest/x25519.h b/3rdparty/everest/include/everest/x25519.h old mode 100644 new mode 100755 index cdfb16f53d..b8cc214f6d --- a/3rdparty/everest/include/everest/x25519.h +++ b/3rdparty/everest/include/everest/x25519.h @@ -40,7 +40,8 @@ typedef enum /** * \brief The x25519 context structure. */ -typedef struct mbedtls_x25519_context_ { +typedef struct +{ unsigned char our_secret[32]; unsigned char peer_point[32]; } mbedtls_x25519_context; diff --git a/tests/scripts/check-names.sh b/tests/scripts/check-names.sh index 7d2302cb2b..b07db23d28 100755 --- a/tests/scripts/check-names.sh +++ b/tests/scripts/check-names.sh @@ -82,10 +82,12 @@ done printf "Likely typos: " sort -u actual-macros enum-consts > _caps HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' ) +HEADERS="$HEADERS 3rdparty/everest/include/everest/everest.h 3rdparty/everest/include/everest/x25519.h" +LIBRARY="$( ls library/*.c ) 3rdparty/everest/library/everest.c 3rdparty/everest/library/x25519.c" NL=' ' sed -n 's/MBED..._[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \ - $HEADERS library/*.c \ + $HEADERS $LIBRARY \ | grep MBEDTLS | sort -u > _MBEDTLS_XXX TYPOS=$( diff _caps _MBEDTLS_XXX | sed -n 's/^> //p' \ | egrep -v 'XXX|__|_$|^MBEDTLS_.*CONFIG_FILE$' || true ) diff --git a/tests/scripts/list-enum-consts.pl b/tests/scripts/list-enum-consts.pl index a30421734c..e59517b886 100755 --- a/tests/scripts/list-enum-consts.pl +++ b/tests/scripts/list-enum-consts.pl @@ -9,6 +9,9 @@ use open qw(:std utf8); -d 'include/mbedtls' or die "$0: must be run from root\n"; @ARGV = grep { ! /compat-1\.3\.h/ } ; +push @ARGV, "3rdparty/everest/include/everest/everest.h"; +push @ARGV, "3rdparty/everest/include/everest/x25519.h"; + my @consts; my $state = 'out'; diff --git a/tests/scripts/list-identifiers.sh b/tests/scripts/list-identifiers.sh index 4828c80eb4..24e74043be 100755 --- a/tests/scripts/list-identifiers.sh +++ b/tests/scripts/list-identifiers.sh @@ -35,6 +35,7 @@ then HEADERS=$( ls include/mbedtls/*_internal.h library/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) else HEADERS=$( ls include/mbedtls/*.h include/psa/*.h library/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) + HEADERS="$HEADERS 3rdparty/everest/include/everest/everest.h 3rdparty/everest/include/everest/x25519.h" fi rm -f identifiers diff --git a/tests/scripts/list-macros.sh b/tests/scripts/list-macros.sh index 3fa66f1910..9a89737df3 100755 --- a/tests/scripts/list-macros.sh +++ b/tests/scripts/list-macros.sh @@ -8,6 +8,7 @@ if [ -d include/mbedtls ]; then :; else fi HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' ) +HEADERS="$HEADERS 3rdparty/everest/include/everest/everest.h 3rdparty/everest/include/everest/x25519.h" # White-list macros we want to be able to refer to that don't exist in the # crypto library, useful when referring to macros in Mbed TLS from comments.