diff --git a/include/mbedtls/x509.h b/include/mbedtls/x509.h index 5a3bd8a2a1..17b3c5d3b4 100644 --- a/include/mbedtls/x509.h +++ b/include/mbedtls/x509.h @@ -489,6 +489,7 @@ size_t mbedtls_x509_crt_parse_cn_inet_pton(const char *cn, void *dst); p += (size_t) ret; \ } while (0) +#if defined(MBEDTLS_X509_USE_C) /** * \brief Translate an ASN.1 OID into its numeric representation * (e.g. "\x2A\x86\x48\x86\xF7\x0D" into "1.2.840.113549") @@ -501,7 +502,9 @@ size_t mbedtls_x509_crt_parse_cn_inet_pton(const char *cn, void *dst); * PSA_ERROR_BUFFER_TOO_SMALL in case of error */ int mbedtls_oid_get_numeric_string(char *buf, size_t size, const mbedtls_asn1_buf *oid); +#endif /* MBEDTLS_X509_USE_C */ +#if defined(MBEDTLS_X509_CREATE_C) /** * \brief Translate a string containing a dotted-decimal * representation of an ASN.1 OID into its encoded form @@ -520,6 +523,7 @@ int mbedtls_oid_get_numeric_string(char *buf, size_t size, const mbedtls_asn1_bu * allocate oid->buf */ int mbedtls_oid_from_numeric_string(mbedtls_asn1_buf *oid, const char *oid_str, size_t size); +#endif /* MBEDTLS_X509_CREATE_C */ #ifdef __cplusplus } diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index f43e01ea9e..51a5d37584 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -704,7 +704,7 @@ void x509_set_extension_length_check() } /* END_CASE */ -/* BEGIN_CASE depends_on:MBEDTLS_X509_USE_C */ +/* BEGIN_CASE depends_on:MBEDTLS_X509_CREATE_C */ void oid_from_numeric_string(char *oid_str, int error_ret, data_t *exp_oid_buf) {