diff options
author | jsing <> | 2018-09-05 16:48:11 +0000 |
---|---|---|
committer | jsing <> | 2018-09-05 16:48:11 +0000 |
commit | 3dd336e6ff4073ca34d5f248d90afd65c6e3f27f (patch) | |
tree | 7285548c994d450785c9af93c1936fef8e5ee489 /src/lib/libssl/ssl_locl.h | |
parent | 500c35c4f020d87efbd1b5f638d51d78cce1b5ea (diff) | |
download | openbsd-3dd336e6ff4073ca34d5f248d90afd65c6e3f27f.tar.gz openbsd-3dd336e6ff4073ca34d5f248d90afd65c6e3f27f.tar.bz2 openbsd-3dd336e6ff4073ca34d5f248d90afd65c6e3f27f.zip |
Correctly clear the current cipher state, when changing cipher state.
When a renegotiation results in a change of cipher suite, the renegotation
would fail if it switched from AEAD to non-AEAD or vice versa. This is due
to the fact that the previous EVP_AEAD or EVP_CIPHER state remained,
resulting in incorrect logic that caused MAC failures.
Rename ssl_clear_cipher_ctx() to ssl_clear_cipher_state() and split it
into separate read/write components, then call these functions from the
appropriate places when a ChangeCipherSpec message is being processed.
Also, remove the separate ssl_clear_hash_ctx() calls and fold these into
the ssl_clear_cipher_{read,write}_state() functions.
Issue reported by Bernard Spil, who also tested this diff.
ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index b6d71492fd..a4e831577d 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_locl.h,v 1.212 2018/08/30 16:56:16 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.213 2018/09/05 16:48:11 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 | * |
@@ -1039,7 +1039,9 @@ extern SSL3_ENC_METHOD TLSv1_enc_data; | |||
1039 | extern SSL3_ENC_METHOD TLSv1_1_enc_data; | 1039 | extern SSL3_ENC_METHOD TLSv1_1_enc_data; |
1040 | extern SSL3_ENC_METHOD TLSv1_2_enc_data; | 1040 | extern SSL3_ENC_METHOD TLSv1_2_enc_data; |
1041 | 1041 | ||
1042 | void ssl_clear_cipher_ctx(SSL *s); | 1042 | void ssl_clear_cipher_state(SSL *s); |
1043 | void ssl_clear_cipher_read_state(SSL *s); | ||
1044 | void ssl_clear_cipher_write_state(SSL *s); | ||
1043 | int ssl_clear_bad_session(SSL *s); | 1045 | int ssl_clear_bad_session(SSL *s); |
1044 | CERT *ssl_cert_new(void); | 1046 | CERT *ssl_cert_new(void); |
1045 | CERT *ssl_cert_dup(CERT *cert); | 1047 | CERT *ssl_cert_dup(CERT *cert); |
@@ -1279,7 +1281,6 @@ int tls12_get_sigid(const EVP_PKEY *pk); | |||
1279 | int tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md); | 1281 | int tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md); |
1280 | const EVP_MD *tls12_get_hash(unsigned char hash_alg); | 1282 | const EVP_MD *tls12_get_hash(unsigned char hash_alg); |
1281 | 1283 | ||
1282 | void ssl_clear_hash_ctx(EVP_MD_CTX **hash); | ||
1283 | long ssl_get_algorithm2(SSL *s); | 1284 | long ssl_get_algorithm2(SSL *s); |
1284 | int tls1_process_sigalgs(SSL *s, CBS *cbs); | 1285 | int tls1_process_sigalgs(SSL *s, CBS *cbs); |
1285 | void tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, | 1286 | void tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, |