Reduce code size when mbedtls_x509_*_info() unused
Introduce MBEDTLS_X509_INFO to indicate the availability of the
mbedtls_x509_*_info() function and closely related APIs. When this is
not defined, also omit name and description from
mbedtls_oid_descriptor_t, and omit OID arrays, macros, and types that
are entirely unused. This saves several KB of code space.
Change-Id: I056312613379890e0d70e1d08c34171287c0aa17
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 9d498ea..a1ecaa2 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1413,6 +1413,7 @@
}
#endif /* MBEDTLS_FS_IO */
+#if defined(MBEDTLS_X509_INFO)
static int x509_info_subject_alt_name( char **buf, size_t *size,
const mbedtls_x509_sequence *subject_alt_name )
{
@@ -1735,6 +1736,7 @@
return( (int) ( size - n ) );
}
+#endif /* MBEDTLS_X509_INFO */
#if defined(MBEDTLS_X509_CHECK_KEY_USAGE)
int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt *crt,