summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_both.c
diff options
context:
space:
mode:
authortb <>2021-02-03 07:06:14 +0000
committertb <>2021-02-03 07:06:14 +0000
commit70029edfad38276befdaee62f4fe7e084070c0cd (patch)
tree9f524641600313fef6d235a1c7bfeced27fbe075 /src/lib/libssl/d1_both.c
parent7708b34c3988d3cd2e01b8bd5d4f1a64461e6464 (diff)
downloadopenbsd-70029edfad38276befdaee62f4fe7e084070c0cd.tar.gz
openbsd-70029edfad38276befdaee62f4fe7e084070c0cd.tar.bz2
openbsd-70029edfad38276befdaee62f4fe7e084070c0cd.zip
This is errata/6.8/013_libressl.patch.siglibressl-v3.2.4
Various interoperability issues and memory leaks were discovered in libcrypto and libssl. The new verifier is not bug compatible with the old verifier and caused many issues by failing to propagate errors correctly, returning different error codes than some software was trained to expect and otherwise failing when it shouldn't. While much of this is fixed in -current, it's still not perfect, so switching back to the legacy verifier is preferable at this point. Other included fixes: * Unbreak DTLS retransmissions for flights that include a CCS * Only check BIO_should_read() on read and BIO_should_write() on write * Implement autochain for the TLSv1.3 server * Use the legacy verifier for AUTO_CHAIN * Implement exporter for TLSv1.3 * Free alert_data and phh_data in tls13_record_layer_free() * Plug leak in x509_verify_chain_dup() * Free the policy tree in x509_vfy_check_policy() Original commits by jsing and tb ok inoguchi jsing
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r--src/lib/libssl/d1_both.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c
index 3d2516ce41..92d86da679 100644
--- a/src/lib/libssl/d1_both.c
+++ b/src/lib/libssl/d1_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_both.c,v 1.60 2020/09/26 14:43:17 jsing Exp $ */ 1/* $OpenBSD: d1_both.c,v 1.60.4.1 2021/02/03 07:06:13 tb Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -1060,18 +1060,18 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off,
1060 frag->msg_header.frag_len); 1060 frag->msg_header.frag_len);
1061 1061
1062 /* save current state */ 1062 /* save current state */
1063 saved_state.enc_write_ctx = s->internal->enc_write_ctx;
1064 saved_state.write_hash = s->internal->write_hash;
1065 saved_state.session = s->session; 1063 saved_state.session = s->session;
1066 saved_state.epoch = D1I(s)->w_epoch; 1064 saved_state.epoch = D1I(s)->w_epoch;
1067 1065
1068 D1I(s)->retransmitting = 1; 1066 D1I(s)->retransmitting = 1;
1069 1067
1070 /* restore state in which the message was originally sent */ 1068 /* restore state in which the message was originally sent */
1071 s->internal->enc_write_ctx = frag->msg_header.saved_retransmit_state.enc_write_ctx;
1072 s->internal->write_hash = frag->msg_header.saved_retransmit_state.write_hash;
1073 s->session = frag->msg_header.saved_retransmit_state.session; 1069 s->session = frag->msg_header.saved_retransmit_state.session;
1074 D1I(s)->w_epoch = frag->msg_header.saved_retransmit_state.epoch; 1070 D1I(s)->w_epoch = frag->msg_header.saved_retransmit_state.epoch;
1071 if (!tls12_record_layer_set_write_cipher_hash(s->internal->rl,
1072 frag->msg_header.saved_retransmit_state.enc_write_ctx,
1073 frag->msg_header.saved_retransmit_state.write_hash, 0))
1074 return 0;
1075 1075
1076 if (frag->msg_header.saved_retransmit_state.epoch == 1076 if (frag->msg_header.saved_retransmit_state.epoch ==
1077 saved_state.epoch - 1) { 1077 saved_state.epoch - 1) {
@@ -1085,10 +1085,11 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off,
1085 SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE); 1085 SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE);
1086 1086
1087 /* restore current state */ 1087 /* restore current state */
1088 s->internal->enc_write_ctx = saved_state.enc_write_ctx;
1089 s->internal->write_hash = saved_state.write_hash;
1090 s->session = saved_state.session; 1088 s->session = saved_state.session;
1091 D1I(s)->w_epoch = saved_state.epoch; 1089 D1I(s)->w_epoch = saved_state.epoch;
1090 if (!tls12_record_layer_set_write_cipher_hash(s->internal->rl,
1091 s->internal->enc_write_ctx, s->internal->write_hash, 0))
1092 return 0;
1092 1093
1093 if (frag->msg_header.saved_retransmit_state.epoch == 1094 if (frag->msg_header.saved_retransmit_state.epoch ==
1094 saved_state.epoch - 1) { 1095 saved_state.epoch - 1) {