summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_locl.h
diff options
context:
space:
mode:
authorjsing <>2018-09-05 16:48:11 +0000
committerjsing <>2018-09-05 16:48:11 +0000
commit3dd336e6ff4073ca34d5f248d90afd65c6e3f27f (patch)
tree7285548c994d450785c9af93c1936fef8e5ee489 /src/lib/libssl/ssl_locl.h
parent500c35c4f020d87efbd1b5f638d51d78cce1b5ea (diff)
downloadopenbsd-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.h7
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;
1039extern SSL3_ENC_METHOD TLSv1_1_enc_data; 1039extern SSL3_ENC_METHOD TLSv1_1_enc_data;
1040extern SSL3_ENC_METHOD TLSv1_2_enc_data; 1040extern SSL3_ENC_METHOD TLSv1_2_enc_data;
1041 1041
1042void ssl_clear_cipher_ctx(SSL *s); 1042void ssl_clear_cipher_state(SSL *s);
1043void ssl_clear_cipher_read_state(SSL *s);
1044void ssl_clear_cipher_write_state(SSL *s);
1043int ssl_clear_bad_session(SSL *s); 1045int ssl_clear_bad_session(SSL *s);
1044CERT *ssl_cert_new(void); 1046CERT *ssl_cert_new(void);
1045CERT *ssl_cert_dup(CERT *cert); 1047CERT *ssl_cert_dup(CERT *cert);
@@ -1279,7 +1281,6 @@ int tls12_get_sigid(const EVP_PKEY *pk);
1279int tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md); 1281int tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md);
1280const EVP_MD *tls12_get_hash(unsigned char hash_alg); 1282const EVP_MD *tls12_get_hash(unsigned char hash_alg);
1281 1283
1282void ssl_clear_hash_ctx(EVP_MD_CTX **hash);
1283long ssl_get_algorithm2(SSL *s); 1284long ssl_get_algorithm2(SSL *s);
1284int tls1_process_sigalgs(SSL *s, CBS *cbs); 1285int tls1_process_sigalgs(SSL *s, CBS *cbs);
1285void tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, 1286void tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs,