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.
This commit is contained in:
Christoph M. Wintersteiger 2018-12-14 15:46:34 +00:00 committed by Janos Follath
parent 1083a25a29
commit 8a0f5bb3c1
5 changed files with 10 additions and 2 deletions

3
3rdparty/everest/include/everest/x25519.h vendored Normal file → Executable file
View file

@ -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;

View file

@ -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 )

View file

@ -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/ } <include/mbedtls/*.h>;
push @ARGV, "3rdparty/everest/include/everest/everest.h";
push @ARGV, "3rdparty/everest/include/everest/x25519.h";
my @consts;
my $state = 'out';

View file

@ -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

View file

@ -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.