mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-29 13:20:21 +00:00
modify check-names.sh and list-macros.sh to work with PSA constants
fixed processing of PSA macros in check names script. This required changes in: *list-macros.sh to scan the PSA headers *check-names to scan PSA files and allow PSA_* macro names
This commit is contained in:
parent
d668baebc5
commit
03091d1114
@ -40,7 +40,7 @@ diff macros identifiers | sed -n -e 's/< //p' > actual-macros
|
|||||||
for THING in actual-macros enum-consts; do
|
for THING in actual-macros enum-consts; do
|
||||||
printf "Names of $THING: "
|
printf "Names of $THING: "
|
||||||
test -r $THING
|
test -r $THING
|
||||||
BAD=$( grep -v '^MBEDTLS_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
|
BAD=$( grep -E -v '^(MBEDTLS|PSA)_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
|
||||||
if [ "x$BAD" = "x" ]; then
|
if [ "x$BAD" = "x" ]; then
|
||||||
echo "PASS"
|
echo "PASS"
|
||||||
else
|
else
|
||||||
@ -65,12 +65,14 @@ done
|
|||||||
|
|
||||||
printf "Likely typos: "
|
printf "Likely typos: "
|
||||||
sort -u actual-macros enum-consts > _caps
|
sort -u actual-macros enum-consts > _caps
|
||||||
HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' )
|
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' )
|
||||||
NL='
|
NL='
|
||||||
'
|
'
|
||||||
sed -n 's/MBED..._[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \
|
sed -n 's/MBED..._[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \
|
||||||
$HEADERS library/*.c \
|
$HEADERS library/*.c \
|
||||||
| grep MBEDTLS | sort -u > _MBEDTLS_XXX
|
| grep MBEDTLS | sort -u > _MBEDTLS_XXX
|
||||||
|
|
||||||
|
|
||||||
TYPOS=$( diff _caps _MBEDTLS_XXX | sed -n 's/^> //p' \
|
TYPOS=$( diff _caps _MBEDTLS_XXX | sed -n 's/^> //p' \
|
||||||
| egrep -v 'XXX|__|_$|^MBEDTLS_.*CONFIG_FILE$' || true )
|
| egrep -v 'XXX|__|_$|^MBEDTLS_.*CONFIG_FILE$' || true )
|
||||||
rm _MBEDTLS_XXX _caps
|
rm _MBEDTLS_XXX _caps
|
||||||
|
@ -7,7 +7,7 @@ if [ -d include/mbedtls ]; then :; else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' )
|
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' )
|
||||||
|
|
||||||
sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS \
|
sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS \
|
||||||
| egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_' \
|
| egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user