diff options
author | jsing <> | 2021-01-19 18:57:09 +0000 |
---|---|---|
committer | jsing <> | 2021-01-19 18:57:09 +0000 |
commit | eb720c630d40660f4bf00d58faa6f6d59ba82ea2 (patch) | |
tree | 1cc6adc2f532c5f987be2b9a01b957de5960ebfa /src/lib/libssl/ssl_srvr.c | |
parent | ac4995fa26f1a8ba3ff386c0caf843a423a4abc7 (diff) | |
download | openbsd-eb720c630d40660f4bf00d58faa6f6d59ba82ea2.tar.gz openbsd-eb720c630d40660f4bf00d58faa6f6d59ba82ea2.tar.bz2 openbsd-eb720c630d40660f4bf00d58faa6f6d59ba82ea2.zip |
Provide functions to determine if TLSv1.2 record protection is engaged.
Call these functions from code that needs to know if we've changed cipher
state and enabled record protection, rather than inconsistently checking
various pointers from other places in the code base. This also fixes a
minor bug where the wrong pointers are checked if we're operating with
AEAD.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index ac3669550c..000cac6785 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.88 2020/10/14 16:57:33 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.89 2021/01/19 18:57:09 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -853,15 +853,15 @@ ssl3_get_client_hello(SSL *s) | |||
853 | if (!ssl_downgrade_max_version(s, &max_version)) | 853 | if (!ssl_downgrade_max_version(s, &max_version)) |
854 | goto err; | 854 | goto err; |
855 | if (ssl_max_shared_version(s, client_version, &shared_version) != 1) { | 855 | if (ssl_max_shared_version(s, client_version, &shared_version) != 1) { |
856 | SSLerror(s, SSL_R_WRONG_VERSION_NUMBER); | ||
857 | if ((s->client_version >> 8) == SSL3_VERSION_MAJOR && | 856 | if ((s->client_version >> 8) == SSL3_VERSION_MAJOR && |
858 | !s->internal->enc_write_ctx && !s->internal->write_hash) { | 857 | !tls12_record_layer_write_protected(s->internal->rl)) { |
859 | /* | 858 | /* |
860 | * Similar to ssl3_get_record, send alert using remote | 859 | * Similar to ssl3_get_record, send alert using remote |
861 | * version number. | 860 | * version number. |
862 | */ | 861 | */ |
863 | s->version = s->client_version; | 862 | s->version = s->client_version; |
864 | } | 863 | } |
864 | SSLerror(s, SSL_R_WRONG_VERSION_NUMBER); | ||
865 | al = SSL_AD_PROTOCOL_VERSION; | 865 | al = SSL_AD_PROTOCOL_VERSION; |
866 | goto f_err; | 866 | goto f_err; |
867 | } | 867 | } |