mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Add missing dependencies on certs.c in fuzz programs
Fix `make programs` when MBEDTLS_CERTS_C is disabled. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -46,7 +46,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
|||||||
uint16_t options;
|
uint16_t options;
|
||||||
|
|
||||||
if (initialized == 0) {
|
if (initialized == 0) {
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C) && \
|
||||||
|
defined(MBEDTLS_CERTS_C)
|
||||||
mbedtls_x509_crt_init(&cacert);
|
mbedtls_x509_crt_init(&cacert);
|
||||||
if (mbedtls_x509_crt_parse(&cacert, (const unsigned char *) mbedtls_test_cas_pem,
|
if (mbedtls_x509_crt_parse(&cacert, (const unsigned char *) mbedtls_test_cas_pem,
|
||||||
mbedtls_test_cas_pem_len) != 0) {
|
mbedtls_test_cas_pem_len) != 0) {
|
||||||
|
@ -43,7 +43,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
|||||||
fuzzBufferOffset_t biomemfuzz;
|
fuzzBufferOffset_t biomemfuzz;
|
||||||
|
|
||||||
if (initialized == 0) {
|
if (initialized == 0) {
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C) && \
|
||||||
|
defined(MBEDTLS_CERTS_C)
|
||||||
mbedtls_x509_crt_init(&cacert);
|
mbedtls_x509_crt_init(&cacert);
|
||||||
if (mbedtls_x509_crt_parse(&cacert, (const unsigned char *) mbedtls_test_cas_pem,
|
if (mbedtls_x509_crt_parse(&cacert, (const unsigned char *) mbedtls_test_cas_pem,
|
||||||
mbedtls_test_cas_pem_len) != 0) {
|
mbedtls_test_cas_pem_len) != 0) {
|
||||||
|
@ -47,7 +47,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
|||||||
fuzzBufferOffset_t biomemfuzz;
|
fuzzBufferOffset_t biomemfuzz;
|
||||||
|
|
||||||
if (initialized == 0) {
|
if (initialized == 0) {
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C) && \
|
||||||
|
defined(MBEDTLS_CERTS_C)
|
||||||
mbedtls_x509_crt_init(&srvcert);
|
mbedtls_x509_crt_init(&srvcert);
|
||||||
mbedtls_pk_init(&pkey);
|
mbedtls_pk_init(&pkey);
|
||||||
if (mbedtls_x509_crt_parse(&srvcert, (const unsigned char *) mbedtls_test_srv_crt,
|
if (mbedtls_x509_crt_parse(&srvcert, (const unsigned char *) mbedtls_test_srv_crt,
|
||||||
|
@ -55,7 +55,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
|||||||
options = Data[Size - 1];
|
options = Data[Size - 1];
|
||||||
|
|
||||||
if (initialized == 0) {
|
if (initialized == 0) {
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C) && \
|
||||||
|
defined(MBEDTLS_CERTS_C)
|
||||||
mbedtls_x509_crt_init(&srvcert);
|
mbedtls_x509_crt_init(&srvcert);
|
||||||
mbedtls_pk_init(&pkey);
|
mbedtls_pk_init(&pkey);
|
||||||
if (mbedtls_x509_crt_parse(&srvcert, (const unsigned char *) mbedtls_test_srv_crt,
|
if (mbedtls_x509_crt_parse(&srvcert, (const unsigned char *) mbedtls_test_srv_crt,
|
||||||
|
Reference in New Issue
Block a user