mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Adapt X.509 fuzzing code to support MBEDTLS_X509_REMOVE_INFO
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
committed by
Chris Jones
parent
fff2d5711c
commit
54ac185f33
@@ -9,9 +9,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
|
|
||||||
mbedtls_x509_crl_init( &crl );
|
mbedtls_x509_crl_init( &crl );
|
||||||
ret = mbedtls_x509_crl_parse( &crl, Data, Size );
|
ret = mbedtls_x509_crl_parse( &crl, Data, Size );
|
||||||
|
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = mbedtls_x509_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
|
ret = mbedtls_x509_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
((void) ret);
|
||||||
|
#endif /* !MBEDTLS_X509_REMOVE_INFO */
|
||||||
mbedtls_x509_crl_free( &crl );
|
mbedtls_x509_crl_free( &crl );
|
||||||
#else
|
#else
|
||||||
(void) Data;
|
(void) Data;
|
||||||
|
@@ -9,9 +9,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
|
|
||||||
mbedtls_x509_crt_init( &crt );
|
mbedtls_x509_crt_init( &crt );
|
||||||
ret = mbedtls_x509_crt_parse( &crt, Data, Size );
|
ret = mbedtls_x509_crt_parse( &crt, Data, Size );
|
||||||
|
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", &crt );
|
ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", &crt );
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
((void) ret);
|
||||||
|
#endif /* !MBEDTLS_X509_REMOVE_INFO */
|
||||||
mbedtls_x509_crt_free( &crt );
|
mbedtls_x509_crt_free( &crt );
|
||||||
#else
|
#else
|
||||||
(void) Data;
|
(void) Data;
|
||||||
|
@@ -9,9 +9,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
|
|
||||||
mbedtls_x509_csr_init( &csr );
|
mbedtls_x509_csr_init( &csr );
|
||||||
ret = mbedtls_x509_csr_parse( &csr, Data, Size );
|
ret = mbedtls_x509_csr_parse( &csr, Data, Size );
|
||||||
|
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = mbedtls_x509_csr_info( (char *) buf, sizeof( buf ) - 1, " ", &csr );
|
ret = mbedtls_x509_csr_info( (char *) buf, sizeof( buf ) - 1, " ", &csr );
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
((void) ret);
|
||||||
|
#endif /* !MBEDTLS_X509_REMOVE_INFO */
|
||||||
mbedtls_x509_csr_free( &csr );
|
mbedtls_x509_csr_free( &csr );
|
||||||
#else
|
#else
|
||||||
(void) Data;
|
(void) Data;
|
||||||
|
Reference in New Issue
Block a user