@@ -3660,7 +3660,7 @@ int StreamOctetString(const byte* inBuf, word32 inBufSz, byte* out, word32* outS
36603660
36613661/* Convert BER to DER */
36623662
3663- /* Pull informtation from the ASN.1 BER encoded item header */
3663+ /* Pull information from the ASN.1 BER encoded item header */
36643664static int GetBerHeader(const byte* data, word32* idx, word32 maxIdx,
36653665 byte* pTag, word32* pLen, int* indef)
36663666{
@@ -6226,7 +6226,8 @@ static int RsaPssHashOidToMgf1(word32 oid, int* mgf)
62266226 return ret;
62276227}
62286228
6229- #ifndef NO_CERTS
6229+ #if !defined(NO_CERTS) && !defined(NO_ASN_CRYPT)
6230+
62306231/* Convert a hash OID to a fake signature OID.
62316232 *
62326233 * @param [in] oid Hash OID.
@@ -21407,8 +21408,7 @@ enum {
2140721408#define certExtASN_Length (sizeof(certExtASN) / sizeof(ASNItem))
2140821409#endif
2140921410
21410- #if defined(WOLFSSL_CUSTOM_OID) && defined(WOLFSSL_ASN_TEMPLATE) \
21411- && defined(HAVE_OID_DECODING)
21411+ #ifdef WC_ASN_UNKNOWN_EXT_CB
2141221412int wc_SetUnknownExtCallback(DecodedCert* cert,
2141321413 wc_UnknownExtCallback cb) {
2141421414 if (cert == NULL) {
@@ -21429,7 +21429,7 @@ int wc_SetUnknownExtCallbackEx(DecodedCert* cert,
2142921429 cert->unknownExtCallbackExCtx = ctx;
2143021430 return 0;
2143121431}
21432- #endif
21432+ #endif /* WC_ASN_UNKNOWN_EXT_CB */
2143321433
2143421434/*
2143521435 * Processing the Certificate Extensions. This does not modify the current
@@ -21583,7 +21583,7 @@ static int DecodeCertExtensions(DecodedCert* cert)
2158321583 /* Decode the extension by type. */
2158421584 ret = DecodeExtensionType(input + idx, length, oid, critical, cert,
2158521585 &isUnknownExt);
21586- #if defined(WOLFSSL_CUSTOM_OID) && defined(HAVE_OID_DECODING)
21586+ #ifdef WC_ASN_UNKNOWN_EXT_CB
2158721587 if (isUnknownExt && (cert->unknownExtCallback != NULL ||
2158821588 cert->unknownExtCallbackEx != NULL)) {
2158921589 word16 decOid[MAX_OID_SZ];
@@ -21612,8 +21612,9 @@ static int DecodeCertExtensions(DecodedCert* cert)
2161221612 cert->unknownExtCallbackExCtx);
2161321613 }
2161421614 }
21615- #endif
21615+ #else
2161621616 (void)isUnknownExt;
21617+ #endif
2161721618
2161821619 /* Move index on to next extension. */
2161921620 idx += length;
@@ -34482,7 +34483,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
3448234483#endif /* WOLFSSL_ASN_TEMPLATE */
3448334484}
3448434485
34485- #if defined( HAVE_ECC_KEY_EXPORT) && !defined(NO_ASN_CRYPT)
34486+ #ifdef HAVE_ECC_KEY_EXPORT
3448634487/* build DER formatted ECC key, include optional public key if requested,
3448734488 * return length on success, negative on error */
3448834489int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
@@ -34913,7 +34914,7 @@ int wc_EccKeyToPKCS8(ecc_key* key, byte* output,
3491334914 return eccToPKCS8(key, output, outLen, 1);
3491434915}
3491534916#endif /* HAVE_PKCS8 */
34916- #endif /* HAVE_ECC_KEY_EXPORT && !NO_ASN_CRYPT */
34917+ #endif /* HAVE_ECC_KEY_EXPORT */
3491734918#endif /* HAVE_ECC */
3491834919
3491934920#ifdef WC_ENABLE_ASYM_KEY_IMPORT
0 commit comments