diff options
author | jsing <> | 2020-10-11 03:47:59 +0000 |
---|---|---|
committer | jsing <> | 2020-10-11 03:47:59 +0000 |
commit | d30a2211e331d165f1922febac556a295ba95562 (patch) | |
tree | f9277b2b54fb795da0c1a3524fa83be01c257805 /src/lib/libssl/d1_both.c | |
parent | f66875f2b621714e5cf7553842e67fefa1b1b1c7 (diff) | |
download | openbsd-d30a2211e331d165f1922febac556a295ba95562.tar.gz openbsd-d30a2211e331d165f1922febac556a295ba95562.tar.bz2 openbsd-d30a2211e331d165f1922febac556a295ba95562.zip |
Fix an assert conditioned on DTLS1_VERSION.
This condition previously existed for DTLS BAD_VER, which has long been
removed. Furthermore, conditioning on DTLS1_VERSION means this is broken
for any newer DTLS version. While here roll up two assertions into one.
ok tb@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 3d2516ce41..64b9818f52 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.61 2020/10/11 03:47:59 jsing 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. |
@@ -973,14 +973,9 @@ dtls1_buffer_message(SSL *s, int is_ccs) | |||
973 | 973 | ||
974 | memcpy(frag->fragment, s->internal->init_buf->data, s->internal->init_num); | 974 | memcpy(frag->fragment, s->internal->init_buf->data, s->internal->init_num); |
975 | 975 | ||
976 | if (is_ccs) { | 976 | OPENSSL_assert(D1I(s)->w_msg_hdr.msg_len + |
977 | OPENSSL_assert(D1I(s)->w_msg_hdr.msg_len + | 977 | (is_ccs ? DTLS1_CCS_HEADER_LENGTH : DTLS1_HM_HEADER_LENGTH) == |
978 | ((s->version == DTLS1_VERSION) ? | 978 | (unsigned int)s->internal->init_num); |
979 | DTLS1_CCS_HEADER_LENGTH : 3) == (unsigned int)s->internal->init_num); | ||
980 | } else { | ||
981 | OPENSSL_assert(D1I(s)->w_msg_hdr.msg_len + | ||
982 | DTLS1_HM_HEADER_LENGTH == (unsigned int)s->internal->init_num); | ||
983 | } | ||
984 | 979 | ||
985 | frag->msg_header.msg_len = D1I(s)->w_msg_hdr.msg_len; | 980 | frag->msg_header.msg_len = D1I(s)->w_msg_hdr.msg_len; |
986 | frag->msg_header.seq = D1I(s)->w_msg_hdr.seq; | 981 | frag->msg_header.seq = D1I(s)->w_msg_hdr.seq; |