mbedtls/include/mbedtls
Hanno Becker 7ac83f91bf Print X.509 verify info strings even if MBEDTLS_X509_REMOVE_INFO
The new compile-time option MBEDTLS_X509_REMOVE_INFO removes various
X.509 debugging strings and functionality, including

```
  mbedtls_x509_crt_verify_info()
```

which ssl_client2.c and ssl_server2.c use to print human readable
descriptions of X.509 verification failure conditions. Those
conditions are also grepped for in numerous ssl-opt.sh tests.

Instead of disabling those tests if MBEDTLS_X509_REMOVE_INFO is set,
this commit essentially moves mbedtls_x509_crt_verify_info() to
ssl_client2.c and ssl_server2.c. However, instead of just copy-pasting
the code from x509_crt.c, the following approach is used:

A macro MBEDTLS_X509_CRT_ERROR_INFO_LIST is introduced which for each
verification failure condition invokes a user-defined macro X509_CRT_ERROR_INFO
with (a) the numerical error code, (b) the string presentation of the
corresponding error macro, (c) the info string for the error condition.
This macro can thus be used to generate code which somehow iterates over
the verifiation failure conditions, but the list of error conditions and
information strings is nowhere duplicated.

This is then used to re-implement mbedtls_x509_crt_verify_info() in
x509_crt.c and to provide a functionally equivalent (yet slightly different)
version in ssl_client2.c and ssl_server2.c in case MBEDTLS_X509_REMOVE_INFO
is set.

This way, little changes to ssl-opt.sh will be necessary in case
MBEDTLS_X509_REMOVE_INFO is set because the info strings for the
verification failure conditions will be printed regardless of whether
MBEDTLS_X509_REMOVE_INFO is set or not.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-04-27 17:20:56 +01:00
..
aes.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
arc4.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
aria.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
asn1.h Add missing const attribute to asn1 api 2021-01-26 13:57:46 +01:00
asn1write.h Add missing const attribute to asn1write api 2021-01-27 15:37:12 +01:00
base64.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
bignum.h adjusting comment on sliding window memory usage. 2020-09-07 13:07:14 +02:00
blowfish.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
camellia.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
ccm.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
chacha20.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
chachapoly.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
check_config.h Merge pull request #4254 from mstarzyk-mobica/remove_libpkcs11-helper 2021-04-22 12:39:54 +02:00
cipher.h Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-21 12:31:43 +02:00
cmac.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
config.h Print X.509 verify info strings even if MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:20:56 +01:00
config_psa.h psa: config: Add CBC-MAC 2021-03-25 16:02:26 +01:00
ctr_drbg.h Document thread safety for CTR_DRBG 2021-02-22 19:24:03 +01:00
debug.h Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:18:52 +01:00
des.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
dhm.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
ecdh.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
ecdsa.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
ecjpake.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
ecp.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
entropy.h Merge remote-tracking branch 'origin/development' into development_new 2021-04-07 16:31:09 +01:00
error.h Two platform error codes moved to error.h to fix _without_platform test 2021-04-21 12:06:23 +02:00
gcm.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
hkdf.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
hmac_drbg.h Document thread safety for HMAC_DRBG 2021-02-22 19:24:03 +01:00
md.h Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-22 12:53:15 +02:00
md2.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
md4.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
md5.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
memory_buffer_alloc.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
net.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
net_sockets.h Update error codes listed in the net_sockets documentation 2021-03-03 12:27:17 +01:00
nist_kw.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
oid.h Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:18:52 +01:00
pem.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
pk.h Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-21 12:31:43 +02:00
pkcs5.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
pkcs12.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
platform.h Two platform error codes moved to error.h to fix _without_platform test 2021-04-21 12:06:23 +02:00
platform_time.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
platform_util.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
poly1305.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
psa_util.h Update psa_util.h 2021-04-21 17:14:31 +02:00
ripemd160.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
rsa.h Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-21 12:31:43 +02:00
sha1.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
sha256.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
sha512.h Remove deprecated things from hashing modules 2021-04-15 12:34:09 +02:00
ssl.h Merge branch 'development_3.0' into drop_old_tls_options 2021-04-15 13:55:20 +02:00
ssl_cache.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
ssl_ciphersuites.h Drop single-DES ciphersuites. 2021-03-16 12:49:54 +01:00
ssl_cookie.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
ssl_ticket.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
threading.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00
timing.h Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
version.h Bump version to 2.26.0 2021-03-09 16:09:18 +00:00
x509.h Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:18:52 +01:00
x509_crl.h Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:18:52 +01:00
x509_crt.h Print X.509 verify info strings even if MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:20:56 +01:00
x509_csr.h Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO 2021-04-27 17:18:52 +01:00
xtea.h Remove deprecated error codes. Some still remain - question asked in issue comment 2021-04-12 23:28:23 +02:00