Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO

This commit is contained in:
Hanno Becker 2019-06-10 15:08:43 +01:00
parent dc470ae8af
commit 02a2193f60
28 changed files with 114 additions and 113 deletions

View file

@ -300,7 +300,7 @@ void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level,
}
#endif /* MBEDTLS_BIGNUM_C */
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_X509_INFO)
#if defined(MBEDTLS_X509_CRT_PARSE_C) && !defined(MBEDTLS_X509_REMOVE_INFO)
static void debug_print_pk( const mbedtls_ssl_context *ssl, int level,
const char *file, int line,
const char *text, const mbedtls_pk_context *pk )
@ -395,7 +395,7 @@ void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level,
crt = crt->next;
}
}
#endif /* MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_X509_INFO */
#endif /* MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_X509_REMOVE_INFO&& MBEDTLS_X509_REMOVE_INFO !MBEDTLS_X509_REMOVE_INFO */
#if defined(MBEDTLS_ECDH_C)
static void mbedtls_debug_printf_ecdh_internal( const mbedtls_ssl_context *ssl,

View file

@ -53,7 +53,7 @@
/*
* Macro to generate mbedtls_oid_descriptor_t
*/
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
#define OID_DESCRIPTOR(s, name, description) { ADD_LEN(s), name, description }
#define NULL_OID_DESCRIPTOR { NULL, 0, NULL, NULL }
#else
@ -84,7 +84,7 @@
return( NULL ); \
}
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
/*
* Macro to generate a function for retrieving a single attribute from the
* descriptor of an mbedtls_oid_descriptor_t wrapper.
@ -97,7 +97,7 @@ int FN_NAME( const mbedtls_asn1_buf *oid, ATTR1_TYPE * ATTR1 )
*ATTR1 = data->descriptor.ATTR1; \
return( 0 ); \
}
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
/*
* Macro to generate a function for retrieving a single attribute from an
@ -303,7 +303,7 @@ static const oid_x509_ext_t oid_x509_ext[] =
FN_OID_TYPED_FROM_ASN1(oid_x509_ext_t, x509_ext, oid_x509_ext)
FN_OID_GET_ATTR1(mbedtls_oid_get_x509_ext_type, oid_x509_ext_t, x509_ext, int, ext_type)
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
static const mbedtls_oid_descriptor_t oid_ext_key_usage[] =
{
OID_DESCRIPTOR( MBEDTLS_OID_SERVER_AUTH, "id-kp-serverAuth", "TLS Web Server Authentication" ),
@ -317,7 +317,7 @@ static const mbedtls_oid_descriptor_t oid_ext_key_usage[] =
FN_OID_TYPED_FROM_ASN1(mbedtls_oid_descriptor_t, ext_key_usage, oid_ext_key_usage)
FN_OID_GET_ATTR1(mbedtls_oid_get_extended_key_usage, mbedtls_oid_descriptor_t, ext_key_usage, const char *, description)
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
#endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */
@ -427,7 +427,7 @@ static const oid_sig_alg_t oid_sig_alg[] =
FN_OID_TYPED_FROM_ASN1(oid_sig_alg_t, sig_alg, oid_sig_alg)
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
FN_OID_GET_DESCRIPTOR_ATTR1(mbedtls_oid_get_sig_alg_desc, oid_sig_alg_t, sig_alg, const char *, description)
#endif

View file

@ -540,9 +540,9 @@ static const char *features[] = {
#if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE)
"MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE",
#endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */
#if defined(MBEDTLS_X509_INFO)
"MBEDTLS_X509_INFO",
#endif /* MBEDTLS_X509_INFO */
#if defined(MBEDTLS_X509_REMOVE_INFO)
"MBEDTLS_X509_REMOVE_INFO",
#endif /* MBEDTLS_X509_REMOVE_INFO */
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
"MBEDTLS_X509_RSASSA_PSS_SUPPORT",
#endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */

View file

@ -836,7 +836,7 @@ int mbedtls_x509_serial_gets( char *buf, size_t size, const mbedtls_x509_buf *se
return( (int) ( size - n ) );
}
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
/*
* Helper for writing signature algorithms
*/
@ -881,7 +881,7 @@ int mbedtls_x509_sig_alg_gets( char *buf, size_t size, const mbedtls_x509_buf *s
return( (int)( size - n ) );
}
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
/*
* Helper for writing "RSA key size", "EC key size", etc

View file

@ -619,7 +619,7 @@ int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path )
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
/*
* Return an informational string about the certificate.
*/
@ -699,7 +699,7 @@ int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix,
return( (int) ( size - n ) );
}
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
/*
* Initialize a CRL chain

View file

@ -1413,7 +1413,7 @@ cleanup:
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
static int x509_info_subject_alt_name( char **buf, size_t *size,
const mbedtls_x509_sequence *subject_alt_name )
{
@ -1736,7 +1736,7 @@ int mbedtls_x509_crt_verify_info( char *buf, size_t size, const char *prefix,
return( (int) ( size - n ) );
}
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
#if defined(MBEDTLS_X509_CHECK_KEY_USAGE)
int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt *crt,

View file

@ -328,7 +328,7 @@ int mbedtls_x509_csr_parse_file( mbedtls_x509_csr *csr, const char *path )
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_X509_INFO)
#if !defined(MBEDTLS_X509_REMOVE_INFO)
#define BEFORE_COLON 14
#define BC "14"
/*
@ -373,7 +373,7 @@ int mbedtls_x509_csr_info( char *buf, size_t size, const char *prefix,
return( (int) ( size - n ) );
}
#endif /* MBEDTLS_X509_INFO */
#endif /* !MBEDTLS_X509_REMOVE_INFO */
/*
* Initialize a CSR