mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
components/openssl: SSL load verify data from itself structure when "new"
This commit is contained in:
@@ -177,6 +177,8 @@ int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx,
|
||||
if (!ret)
|
||||
SSL_RET(failed2, "SSL_CTX_use_PrivateKey\n");
|
||||
|
||||
ctx->cert->pkey->ref++;
|
||||
|
||||
return 1;
|
||||
|
||||
failed2:
|
||||
@@ -203,7 +205,10 @@ int SSL_use_PrivateKey_ASN1(int type, SSL *ssl,
|
||||
int ret;
|
||||
EVP_PKEY *pkey;
|
||||
|
||||
pkey = d2i_PrivateKey(0, &ssl->cert->pkey, &d, len);
|
||||
if (ssl->cert->pkey->ref)
|
||||
SSL_RET(failed1);
|
||||
|
||||
pkey = d2i_PrivateKey(0, NULL, &d, len);
|
||||
if (!pkey)
|
||||
SSL_RET(failed1, "d2i_PrivateKey\n");
|
||||
|
||||
@@ -211,6 +216,8 @@ int SSL_use_PrivateKey_ASN1(int type, SSL *ssl,
|
||||
if (!ret)
|
||||
SSL_RET(failed2, "SSL_CTX_use_PrivateKey\n");
|
||||
|
||||
ssl->cert->pkey->ref++;
|
||||
|
||||
return 1;
|
||||
|
||||
failed2:
|
||||
|
Reference in New Issue
Block a user