diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2017-08-09 16:50:01 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2017-08-09 16:50:01 +0000 |
commit | 50f8fbc1f5a702a76cb0ed7c1f84654496198835 (patch) | |
tree | 9e9d9a337b928cac3d7d9bf6e025c28644bdbb6b /lib/libssl/s3_lib.c | |
parent | b9ba7ace4fb98ce503c0164ff19802877e8c3d18 (diff) |
Be consistent and return from each SSL control case, rather than breaking
from some.
Diffstat (limited to 'lib/libssl/s3_lib.c')
-rw-r--r-- | lib/libssl/s3_lib.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index b9e2d8d97df..e3fcf598224 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.150 2017/08/09 16:47:18 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.151 2017/08/09 16:50:00 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1971,8 +1971,6 @@ SSL_set1_groups_list(SSL *s, const char *groups) long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) { - int ret = 0; - switch (cmd) { case SSL_CTRL_GET_SESSION_REUSED: return _SSL_session_reused(s); @@ -2001,7 +1999,7 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_SET_TMP_ECDH_CB: SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return (0); + return 0; case SSL_CTRL_SET_ECDH_AUTO: return _SSL_set_ecdh_auto(s, larg); @@ -2044,43 +2042,37 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) return SSL_set1_groups_list(s, parg); case SSL_CTRL_GET_SERVER_TMP_KEY: - ret = ssl_ctrl_get_server_tmp_key(s, parg); - break; + return ssl_ctrl_get_server_tmp_key(s, parg); case SSL_CTRL_SET_MIN_PROTO_VERSION: if (larg < 0 || larg > UINT16_MAX) - return (0); + return 0; return SSL_set_min_proto_version(s, larg); case SSL_CTRL_SET_MAX_PROTO_VERSION: if (larg < 0 || larg > UINT16_MAX) - return (0); + return 0; return SSL_set_max_proto_version(s, larg); /* * Legacy controls that should eventually be removed. */ case SSL_CTRL_GET_CLIENT_CERT_REQUEST: - break; + return 0; case SSL_CTRL_GET_FLAGS: - ret = (int)(s->s3->flags); - break; + return (int)(s->s3->flags); case SSL_CTRL_NEED_TMP_RSA: - ret = 0; - break; + return 0; case SSL_CTRL_SET_TMP_RSA: case SSL_CTRL_SET_TMP_RSA_CB: SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - break; - - default: - break; + return 0; } - return (ret); + return 0; } long |