提交 7d2c13a7 编写于 作者: M Matt Caswell

Simplify key_exchange_expected() logic

The static function key_exchange_expected() used to return -1 on error.
Commit 361a1191 changed that so that it can never fail. This means that
some tidy up can be done to simplify error handling in callers of that
function.
Reviewed-by: NEmilia Käsper <emilia@openssl.org>
上级 1b5c44b8
...@@ -90,7 +90,6 @@ static ossl_inline int cert_req_allowed(SSL *s) ...@@ -90,7 +90,6 @@ static ossl_inline int cert_req_allowed(SSL *s)
* Return values are: * Return values are:
* 1: Yes * 1: Yes
* 0: No * 0: No
* -1: Error
*/ */
static int key_exchange_expected(SSL *s) static int key_exchange_expected(SSL *s)
{ {
...@@ -174,8 +173,6 @@ int ossl_statem_client_read_transition(SSL *s, int mt) ...@@ -174,8 +173,6 @@ int ossl_statem_client_read_transition(SSL *s, int mt)
} }
} else { } else {
ske_expected = key_exchange_expected(s); ske_expected = key_exchange_expected(s);
if (ske_expected < 0)
goto err;
/* SKE is optional for some PSK ciphersuites */ /* SKE is optional for some PSK ciphersuites */
if (ske_expected if (ske_expected
|| ((s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) || ((s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK)
...@@ -209,8 +206,6 @@ int ossl_statem_client_read_transition(SSL *s, int mt) ...@@ -209,8 +206,6 @@ int ossl_statem_client_read_transition(SSL *s, int mt)
case TLS_ST_CR_CERT_STATUS: case TLS_ST_CR_CERT_STATUS:
ske_expected = key_exchange_expected(s); ske_expected = key_exchange_expected(s);
if (ske_expected < 0)
goto err;
/* SKE is optional for some PSK ciphersuites */ /* SKE is optional for some PSK ciphersuites */
if (ske_expected if (ske_expected
|| ((s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) || ((s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册