From 7caec30cb620cf1191c65be4ed4cc06ff7a70189 Mon Sep 17 00:00:00 2001 From: jsing Date: Sun, 9 Jan 2022 15:34:21 +0000 Subject: [PATCH] Return 0/1 from ssl3_{send,get}_client_kex_gost() Like other KEX handling functions, there is no need to return anything other than failure/success here. ok inoguchi@ tb@ --- lib/libssl/ssl_clnt.c | 8 ++++---- lib/libssl/ssl_srvr.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libssl/ssl_clnt.c b/lib/libssl/ssl_clnt.c index d0910c8f739..cc66ed0473e 100644 --- a/lib/libssl/ssl_clnt.c +++ b/lib/libssl/ssl_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_clnt.c,v 1.130 2022/01/09 15:29:42 jsing Exp $ */ +/* $OpenBSD: ssl_clnt.c,v 1.131 2022/01/09 15:34:21 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1931,9 +1931,9 @@ ssl3_send_client_kex_gost(SSL *s, CBB *cbb) size_t msglen; unsigned int md_len; EVP_MD_CTX *ukm_hash; - int ret = -1; int nid; CBB gostblob; + int ret = 0; /* Get server sertificate PKEY and create ctx from it */ peer_cert = s->session->peer_pkeys[SSL_PKEY_GOST01].x509; @@ -2027,7 +2027,7 @@ ssl3_send_client_kex_gost(SSL *s, CBB *cbb) explicit_bzero(premaster_secret, sizeof(premaster_secret)); EVP_PKEY_free(pub_key); - return (ret); + return ret; } int @@ -2055,7 +2055,7 @@ ssl3_send_client_key_exchange(SSL *s) if (!ssl3_send_client_kex_ecdhe(s, &kex)) goto err; } else if (alg_k & SSL_kGOST) { - if (ssl3_send_client_kex_gost(s, &kex) != 1) + if (!ssl3_send_client_kex_gost(s, &kex)) goto err; } else { ssl3_send_alert(s, SSL3_AL_FATAL, diff --git a/lib/libssl/ssl_srvr.c b/lib/libssl/ssl_srvr.c index aa1b62c8db8..1f6753fdf45 100644 --- a/lib/libssl/ssl_srvr.c +++ b/lib/libssl/ssl_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_srvr.c,v 1.135 2022/01/09 15:28:47 jsing Exp $ */ +/* $OpenBSD: ssl_srvr.c,v 1.136 2022/01/09 15:34:21 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1830,7 +1830,7 @@ ssl3_get_client_kex_gost(SSL *s, CBS *cbs) SSLerror(s, SSL_R_BAD_PACKET_LENGTH); ssl3_send_alert(s, SSL3_AL_FATAL, al); err: - return (-1); + return 0; } int @@ -1862,7 +1862,7 @@ ssl3_get_client_key_exchange(SSL *s) if (!ssl3_get_client_kex_ecdhe(s, &cbs)) goto err; } else if (alg_k & SSL_kGOST) { - if (ssl3_get_client_kex_gost(s, &cbs) != 1) + if (!ssl3_get_client_kex_gost(s, &cbs)) goto err; } else { al = SSL_AD_HANDSHAKE_FAILURE; -- 2.20.1