Fix return values for TLS 1.3 state machine code.

This is a no-op because all affected codepaths are either unreachable or
are fine because ssl_hs_error (intentionally, since C doesn't help us
any) aligns with zero. Still, fix these.

Change-Id: Ieba4e3eec3881a56b5ddcd32abdd2c9dda875eda
Reviewed-on: https://boringssl-review.googlesource.com/12313
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Steven Valdez <svaldez@chromium.org>
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
This commit is contained in:
David Benjamin 2016-11-16 19:10:08 +09:00 committed by CQ bot account: commit-bot@chromium.org
parent 71186e85d1
commit 6929f27ed5
2 changed files with 7 additions and 7 deletions

View File

@ -421,7 +421,7 @@ static enum ssl_hs_wait_t do_process_server_certificate_verify(
if (!tls13_check_message_type(ssl, SSL3_MT_CERTIFICATE_VERIFY) ||
!tls13_process_certificate_verify(ssl) ||
!ssl_hash_current_message(ssl)) {
return 0;
return ssl_hs_error;
}
hs->state = state_process_server_finished;

View File

@ -63,7 +63,7 @@ static int resolve_ecdhe_secret(SSL *ssl, int *out_need_retry,
TLSEXT_TYPE_key_share)) {
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE);
ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION);
return ssl_hs_error;
return 0;
}
int found_key_share;
@ -105,7 +105,7 @@ static enum ssl_hs_wait_t do_process_client_hello(SSL *ssl, SSL_HANDSHAKE *hs) {
/* Load the client random. */
if (client_hello.random_len != SSL3_RANDOM_SIZE) {
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
return -1;
return ssl_hs_error;
}
memcpy(ssl->s3->client_random, client_hello.random, client_hello.random_len);
@ -116,7 +116,7 @@ static enum ssl_hs_wait_t do_process_client_hello(SSL *ssl, SSL_HANDSHAKE *hs) {
!ssl_ext_psk_key_exchange_modes_parse_clienthello(
ssl, &alert, &psk_key_exchange_modes)) {
ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
return 0;
return ssl_hs_error;
}
SSL_SESSION *session = NULL;
@ -131,13 +131,13 @@ static enum ssl_hs_wait_t do_process_client_hello(SSL *ssl, SSL_HANDSHAKE *hs) {
client_hello.extensions + client_hello.extensions_len) {
OPENSSL_PUT_ERROR(SSL, SSL_R_PRE_SHARED_KEY_MUST_BE_LAST);
ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER);
return 0;
return ssl_hs_error;
}
if (!ssl_ext_pre_shared_key_parse_clienthello(ssl, &session, &binders,
&alert, &pre_shared_key)) {
ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
return 0;
return ssl_hs_error;
}
}
}
@ -582,7 +582,7 @@ static enum ssl_hs_wait_t do_process_client_certificate_verify(
if (!tls13_check_message_type(ssl, SSL3_MT_CERTIFICATE_VERIFY) ||
!tls13_process_certificate_verify(ssl) ||
!ssl_hash_current_message(ssl)) {
return 0;
return ssl_hs_error;
}
hs->state = state_process_channel_id;