Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Manuel Pégourié-Gonnard | d1ddd29 | 2015-04-09 10:15:10 +0200 | [diff] [blame] | 3 | set -eu |
| 4 | |
| 5 | if [ -d include/mbedtls ]; then :; else |
| 6 | echo "$0: must be run from root" >&2 |
| 7 | exit 1 |
| 8 | fi |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 9 | |
Nir Sonnenschein | 03091d1 | 2019-01-08 18:15:50 +0200 | [diff] [blame] | 10 | HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' ) |
Christoph M. Wintersteiger | 8a0f5bb | 2018-12-14 15:46:34 +0000 | [diff] [blame] | 11 | HEADERS="$HEADERS 3rdparty/everest/include/everest/everest.h 3rdparty/everest/include/everest/x25519.h" |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 12 | |
Jaeden Amero | 7fcc7bc | 2019-02-26 11:53:36 +0000 | [diff] [blame] | 13 | # White-list macros we want to be able to refer to that don't exist in the |
| 14 | # crypto library, useful when referring to macros in Mbed TLS from comments. |
| 15 | WHITELIST='MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS' |
| 16 | |
| 17 | # Generate a list of macros and combine it with the white-listed macros in |
| 18 | # sorted order. |
| 19 | { sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS | |
| 20 | egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_'; |
| 21 | printf '%s\n' $WHITELIST; |
| 22 | } | sort -u > macros |
Manuel Pégourié-Gonnard | 3385cf4 | 2015-04-02 17:59:30 +0100 | [diff] [blame] | 23 | |
| 24 | wc -l macros |