Second wc_EccPrivateKeyDecode not needed now that it supports PKCS8

This commit is contained in:
Juliusz Sosinowicz
2021-07-22 20:47:36 +02:00
parent 9f7aa32662
commit 23cff71bbf

View File

@ -38445,15 +38445,6 @@ int wolfSSL_EC_KEY_LoadDer_ex(WOLFSSL_EC_KEY* key, const unsigned char* derBuf,
ret = wc_EccPublicKeyDecode(derBuf, &idx, (ecc_key*)key->internal,
derSz);
}
if (ret < 0 && opt == WOLFSSL_EC_KEY_LOAD_PRIVATE) {
/* Might be in PKCS8 format so let's try */
idx = 0;
ret = ToTraditionalInline(derBuf, &idx, (word32)derSz);
if (ret > 0) {
ret = wc_EccPrivateKeyDecode(derBuf, &idx,
(ecc_key*)key->internal, derSz);
}
}
if (ret < 0) {
if (opt == WOLFSSL_EC_KEY_LOAD_PRIVATE) {
WOLFSSL_MSG("wc_EccPrivateKeyDecode failed");