mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-26 12:35:20 +00:00
Merge pull request #230 from AndrzejKurek/remove-double-underscore
Remove double underscores from macro and add a check for it
This commit is contained in:
commit
ecfd050633
@ -1015,15 +1015,15 @@
|
||||
* \return The corresponding AEAD algorithm with the default
|
||||
* tag length for that algorithm.
|
||||
*/
|
||||
#define PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(aead_alg) \
|
||||
( \
|
||||
PSA__ALG_AEAD_WITH_DEFAULT_TAG_LENGTH__CASE(aead_alg, PSA_ALG_CCM) \
|
||||
PSA__ALG_AEAD_WITH_DEFAULT_TAG_LENGTH__CASE(aead_alg, PSA_ALG_GCM) \
|
||||
PSA__ALG_AEAD_WITH_DEFAULT_TAG_LENGTH__CASE(aead_alg, PSA_ALG_CHACHA20_POLY1305) \
|
||||
#define PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(aead_alg) \
|
||||
( \
|
||||
PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE(aead_alg, PSA_ALG_CCM) \
|
||||
PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE(aead_alg, PSA_ALG_GCM) \
|
||||
PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE(aead_alg, PSA_ALG_CHACHA20_POLY1305) \
|
||||
0)
|
||||
#define PSA__ALG_AEAD_WITH_DEFAULT_TAG_LENGTH__CASE(aead_alg, ref) \
|
||||
PSA_ALG_AEAD_WITH_TAG_LENGTH(aead_alg, 0) == \
|
||||
PSA_ALG_AEAD_WITH_TAG_LENGTH(ref, 0) ? \
|
||||
#define PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE(aead_alg, ref) \
|
||||
PSA_ALG_AEAD_WITH_TAG_LENGTH(aead_alg, 0) == \
|
||||
PSA_ALG_AEAD_WITH_TAG_LENGTH(ref, 0) ? \
|
||||
ref :
|
||||
|
||||
#define PSA_ALG_RSA_PKCS1V15_SIGN_BASE ((psa_algorithm_t)0x10020000)
|
||||
|
@ -57,11 +57,14 @@ for THING in actual-macros enum-consts; do
|
||||
printf "Names of $THING: "
|
||||
test -r $THING
|
||||
BAD=$( grep -E -v '^(MBEDTLS|PSA)_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
|
||||
if [ "x$BAD" = "x" ]; then
|
||||
UNDERSCORES=$( grep -E '.*__.*' $THING || true )
|
||||
|
||||
if [ "x$BAD" = "x" ] && [ "x$UNDERSCORES" = "x" ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
echo "$BAD"
|
||||
echo "$UNDERSCORES"
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
@ -162,6 +162,7 @@ class Inputs:
|
||||
# PSA_ALG_ECDH and PSA_ALG_FFDH are excluded for now as the script
|
||||
# currently doesn't support them. Deprecated errors are also excluded.
|
||||
_excluded_names = set(['PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH',
|
||||
'PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE',
|
||||
'PSA_ALG_FULL_LENGTH_MAC',
|
||||
'PSA_ALG_ECDH',
|
||||
'PSA_ALG_FFDH',
|
||||
|
Loading…
x
Reference in New Issue
Block a user