Only compile in PKCS12 code if PKCS8 is also compiled in.

This commit is contained in:
Hayden Roche
2021-08-03 07:09:34 -07:00
parent 9f6a963c60
commit ba7b1d3be0
2 changed files with 3 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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