mirror of
https://github.com/openssl/openssl.git
synced 2024-11-23 01:54:39 +08:00
Fix multiple wrong checks of EVP_PKEY_set1_encoded_public_key
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/25811)
This commit is contained in:
parent
1a93be1eab
commit
1273fae170
@ -65,7 +65,7 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
|
||||
pkpeer = EVP_PKEY_new();
|
||||
if (pkpeer == NULL
|
||||
|| !EVP_PKEY_copy_parameters(pkpeer, pk)
|
||||
|| !EVP_PKEY_set1_encoded_public_key(pkpeer, buf, plen))
|
||||
|| EVP_PKEY_set1_encoded_public_key(pkpeer, buf, plen) <= 0)
|
||||
goto err;
|
||||
|
||||
if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0)
|
||||
|
@ -111,7 +111,7 @@ static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
|
||||
if (p == NULL || plen == 0)
|
||||
goto err;
|
||||
|
||||
if (!EVP_PKEY_set1_encoded_public_key(pkpeer, p, plen))
|
||||
if (EVP_PKEY_set1_encoded_public_key(pkpeer, p, plen) <= 0)
|
||||
goto err;
|
||||
|
||||
if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0)
|
||||
|
@ -3086,7 +3086,7 @@ static int tls_process_cke_dhe(SSL_CONNECTION *s, PACKET *pkt)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_PKEY_set1_encoded_public_key(ckey, data, i)) {
|
||||
if (EVP_PKEY_set1_encoded_public_key(ckey, data, i) <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
|
||||
goto err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user