diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 4ab62a189..bcdf3737c 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -11646,6 +11646,7 @@ int wc_PemToDer(const unsigned char* buff, long longSz, int type, DerBuffer** pDer, void* heap, EncryptedInfo* info, int* keyFormat) { int ret = PemToDer(buff, longSz, type, pDer, heap, info, keyFormat); +#if defined(HAVE_PKCS8) || defined(HAVE_PKCS12) if (ret == 0 && type == PRIVATEKEY_TYPE) { DerBuffer* der = *pDer; /* if a PKCS8 key header exists remove it */ @@ -11655,6 +11656,7 @@ int wc_PemToDer(const unsigned char* buff, long longSz, int type, ret = 0; } } +#endif return ret; } diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index e6e6550ac..314388518 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -2147,7 +2147,7 @@ extern void uITRON4_free(void *p) ; #endif #endif -#ifndef NO_PKCS12 +#if !defined(NO_PKCS12) && !defined(NO_PKCS8) #undef HAVE_PKCS12 #define HAVE_PKCS12 #endif