Add some more cleanups
Follow up from the conversion to use SSLfatal() in the state machine to
clean things up a bit more.
[extended tests]
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4778)
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index 038fac9..48e6a0a 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -1310,11 +1310,10 @@
PACKET session_id, extpkt;
size_t session_id_len;
const unsigned char *cipherchars;
- int al = SSL_AD_INTERNAL_ERROR;
unsigned int compression;
unsigned int sversion;
unsigned int context;
- int protverr, discard;
+ int discard;
RAW_EXTENSION *extensions = NULL;
#ifndef OPENSSL_NO_COMP
SSL_COMP *comp;
@@ -1338,10 +1337,8 @@
* Must be done after reading the random data so we can check for the
* TLSv1.3 downgrade sentinels
*/
- protverr = ssl_choose_client_version(s, sversion, 1, &al);
- if (protverr != 0) {
- SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PROCESS_SERVER_HELLO,
- protverr);
+ if (!ssl_choose_client_version(s, sversion, 1)) {
+ /* SSLfatal() already called */
goto err;
}