From: jsing Date: Sat, 20 Feb 2021 07:29:07 +0000 (+0000) Subject: Clean up/simplify dtls1_get_cipher(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3532810670aec94995c5732c7b270aea26315c95;p=openbsd Clean up/simplify dtls1_get_cipher(). ok tb@ --- diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c index 4d406271af4..4a45e66f34b 100644 --- a/lib/libssl/d1_lib.c +++ b/lib/libssl/d1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_lib.c,v 1.52 2021/01/21 18:48:56 jsing Exp $ */ +/* $OpenBSD: d1_lib.c,v 1.53 2021/02/20 07:29:07 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -251,14 +251,15 @@ dtls1_ctrl(SSL *s, int cmd, long larg, void *parg) const SSL_CIPHER * dtls1_get_cipher(unsigned int u) { - const SSL_CIPHER *ciph = ssl3_get_cipher(u); + const SSL_CIPHER *cipher; - if (ciph != NULL) { - if (ciph->algorithm_enc == SSL_RC4) - return NULL; - } + if ((cipher = ssl3_get_cipher(u)) == NULL) + return NULL; + + if (cipher->algorithm_enc == SSL_RC4) + return NULL; - return ciph; + return cipher; } void