summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorxkernel <xkernel.wang@foxmail.com>2022-01-04 22:54:27 +0800
committerTomas Mraz <tomas@openssl.org>2022-01-07 09:49:47 +0100
commit6bb8ef9d0fbe62ea39427eb0b1ffad916f6b8d16 (patch)
tree77522582169a44ae629152cc038ba064dd7ac072 /ssl
parent3f8434150ee7ad2357c8f606d8f9d93938bb17fe (diff)
fix the return check of EVP_PKEY_CTX_ctrl() in 5 spots
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17413) (cherry picked from commit 7b1264baab7edd82fea8b27d9ddec048bafc0048)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem_clnt.c6
-rw-r--r--ssl/statem/statem_srvr.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index c17716283d..435888db21 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -3074,7 +3074,7 @@ static int tls_construct_cke_gost(SSL *s, WPACKET *pkt)
EVP_MD_CTX_free(ukm_hash);
ukm_hash = NULL;
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
- EVP_PKEY_CTRL_SET_IV, 8, shared_ukm) < 0) {
+ EVP_PKEY_CTRL_SET_IV, 8, shared_ukm) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
goto err;
}
@@ -3205,13 +3205,13 @@ static int tls_construct_cke_gost18(SSL *s, WPACKET *pkt)
/* Reuse EVP_PKEY_CTRL_SET_IV, make choice in engine code */
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
- EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst) < 0) {
+ EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
goto err;
}
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
- EVP_PKEY_CTRL_CIPHER, cipher_nid, NULL) < 0) {
+ EVP_PKEY_CTRL_CIPHER, cipher_nid, NULL) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
goto err;
}
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index d0d8d26e11..462fd72071 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -3244,13 +3244,13 @@ static int tls_process_cke_gost18(SSL *s, PACKET *pkt)
/* Reuse EVP_PKEY_CTRL_SET_IV, make choice in engine code depending on size */
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_DECRYPT,
- EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst) < 0) {
+ EVP_PKEY_CTRL_SET_IV, 32, rnd_dgst) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
goto err;
}
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_DECRYPT,
- EVP_PKEY_CTRL_CIPHER, cipher_nid, NULL) < 0) {
+ EVP_PKEY_CTRL_CIPHER, cipher_nid, NULL) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_LIBRARY_BUG);
goto err;
}