From c45f7c87b0447971b15f3056839a79a9ab6b2a2f Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Wed, 28 Jun 2023 13:46:45 -0600 Subject: [PATCH] Make DecodeObjectId available for OPENSSL_ALL --- wolfcrypt/src/asn.c | 9 +++------ wolfssl/wolfcrypt/asn.h | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 1fc42a52d..1d0aadfe2 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -5513,7 +5513,8 @@ int EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz) } #endif /* HAVE_OID_ENCODING */ -#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) +#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) || \ + defined(OPENSSL_ALL) /* Encode dotted form of OID into byte array version. * * @param [in] in Byte array containing OID. @@ -5560,7 +5561,7 @@ int DecodeObjectId(const byte* in, word32 inSz, word16* out, word32* outSz) return 0; } -#endif /* HAVE_OID_DECODING */ +#endif /* HAVE_OID_DECODING || WOLFSSL_ASN_PRINT || OPENSSL_ALL */ /* Decode the header of a BER/DER encoded OBJECT ID. * @@ -12376,13 +12377,9 @@ static int GenerateDNSEntryRIDString(DNS_entry* entry, void* heap) XMEMCPY(finalName, rid, XSTRLEN((const char*)rid)); } else { - #if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) /* Decode OBJECT_ID into dotted form array. */ ret = DecodeObjectId((const byte*)(rid),(word32)entry->len, tmpName, (word32*)&tmpSize); - #else - ret = NOT_COMPILED_IN; - #endif if (ret == 0) { endChar = 1; diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index c6e56372f..a768d6671 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -2172,7 +2172,8 @@ WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx, WOLFSSL_API int EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz); #endif -#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) +#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) || \ + defined(OPENSSL_ALL) WOLFSSL_LOCAL int DecodeObjectId(const byte* in, word32 inSz, word16* out, word32* outSz); #endif