4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-09 17:29:33 +00:00

ossl: pkcs12: Don't crash on unknown private key type

BUGS: 423355
This commit is contained in:
Albert Astals Cid 2020-06-22 21:45:39 +02:00
parent ae5dec259f
commit 3242caee6a

@ -4822,6 +4822,14 @@ public:
MyPKeyContext *pk = new MyPKeyContext(provider());
PKeyBase *k = pk->pkeyToBase(pkey, true); // does an EVP_PKEY_free()
if (!k) {
delete pk;
if(cert)
X509_free(cert);
if(ca)
sk_X509_pop_free(ca, X509_free);
return ErrorDecode;
}
pk->k = k;
*priv = pk;