Skip to content

Commit

Permalink
Remove MBEDTLS_X509_REMOVE_INFO Macro
Browse files Browse the repository at this point in the history
This commit remove an MbedTLS specific macro MBEDTLS_X509_REMOVE_INFO as
it is not defined by TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <[email protected]>
  • Loading branch information
Harry-Ramsey committed Jan 30, 2025
1 parent 2f0900f commit 30b6352
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions drivers/builtin/include/mbedtls/oid.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ extern "C" {
typedef struct mbedtls_oid_descriptor_t {
const char *MBEDTLS_PRIVATE(asn1); /*!< OID ASN.1 representation */
size_t MBEDTLS_PRIVATE(asn1_len); /*!< length of asn1 */
#if !defined(MBEDTLS_X509_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
const char *MBEDTLS_PRIVATE(name); /*!< official name (e.g. from RFC) */
const char *MBEDTLS_PRIVATE(description); /*!< human friendly description */
#endif
Expand Down Expand Up @@ -628,7 +628,7 @@ int mbedtls_oid_get_md_hmac(const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_h
*/
int mbedtls_oid_get_md_alg(const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg);

#if !defined(MBEDTLS_X509_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
/**
* \brief Translate Extended Key Usage OID into description
*
Expand All @@ -638,7 +638,7 @@ int mbedtls_oid_get_md_alg(const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_al
* \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
*/
int mbedtls_oid_get_extended_key_usage(const mbedtls_asn1_buf *oid, const char **desc);
#endif
#endif /* OID_INFO_STRINGS */

/**
* \brief Translate certificate policies OID into description
Expand Down
16 changes: 8 additions & 8 deletions drivers/builtin/src/oid.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
/*
* Macro to generate mbedtls_oid_descriptor_t
*/
#if !defined(MBEDTLS_X509_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
#define OID_DESCRIPTOR(s, name, description) { ADD_LEN(s), name, description }
#define NULL_OID_DESCRIPTOR { NULL, 0, NULL, NULL }
#else
#define OID_DESCRIPTOR(s, name, description) { ADD_LEN(s) }
#define NULL_OID_DESCRIPTOR { NULL, 0 }
#endif
#endif /* OID_INFO_STRINGS */

/*
* Macro to generate an internal function for oid_XXX_from_asn1() (used by
Expand All @@ -60,7 +60,7 @@
return NULL; \
}

#if !defined(MBEDTLS_X509_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
/*
* Macro to generate a function for retrieving a single attribute from the
* descriptor of an mbedtls_oid_descriptor_t wrapper.
Expand All @@ -73,7 +73,7 @@
*ATTR1 = data->descriptor.ATTR1; \
return 0; \
}
#endif /* MBEDTLS_X509_REMOVE_INFO */
#endif /* OID_INFO_STRINGS */

/*
* Macro to generate a function for retrieving a single attribute from an
Expand Down Expand Up @@ -327,7 +327,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_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
static const mbedtls_oid_descriptor_t oid_ext_key_usage[] =
{
OID_DESCRIPTOR(MBEDTLS_OID_SERVER_AUTH,
Expand Down Expand Up @@ -365,7 +365,7 @@ FN_OID_GET_ATTR1(mbedtls_oid_get_certificate_policies,
certificate_policies,
const char *,
description)
#endif /* MBEDTLS_X509_REMOVE_INFO */
#endif /* OID_INFO_STRINGS */

/*
* For SignatureAlgorithmIdentifier
Expand Down Expand Up @@ -472,13 +472,13 @@ 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_REMOVE_INFO)
#if 1 /* OID_INFO_STRINGS */
FN_OID_GET_DESCRIPTOR_ATTR1(mbedtls_oid_get_sig_alg_desc,
oid_sig_alg_t,
sig_alg,
const char *,
description)
#endif
#endif /* OID_INFO_STRINGS */

FN_OID_GET_ATTR2(mbedtls_oid_get_sig_alg,
oid_sig_alg_t,
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_oid.function
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* END_HEADER */

/* BEGIN_DEPENDENCIES
* depends_on:MBEDTLS_OID_C:!MBEDTLS_X509_REMOVE_INFO
* depends_on:MBEDTLS_OID_C
* END_DEPENDENCIES
*/

Expand Down

0 comments on commit 30b6352

Please sign in to comment.