diff options
author | jsing <> | 2018-08-24 19:35:05 +0000 |
---|---|---|
committer | jsing <> | 2018-08-24 19:35:05 +0000 |
commit | 48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7 (patch) | |
tree | 0307f7740eb171df6ac8bba0e34c600fa20bac94 | |
parent | afdd3306518717990928f2cdef8b089fb44163d0 (diff) | |
download | openbsd-48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7.tar.gz openbsd-48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7.tar.bz2 openbsd-48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7.zip |
unifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE.
This code has been rotting since 2006.
ok bcook@ tb@
-rw-r--r-- | src/lib/libssl/d1_pkt.c | 23 | ||||
-rw-r--r-- | src/lib/libssl/dtls1.h | 6 |
2 files changed, 3 insertions, 26 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 9f670fadfd..b3104d21e7 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.63 2017/05/07 04:22:24 beck Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.64 2018/08/24 19:35:05 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. |
@@ -825,14 +825,6 @@ start: | |||
825 | /* XDTLS: In a pathalogical case, the Client Hello | 825 | /* XDTLS: In a pathalogical case, the Client Hello |
826 | * may be fragmented--don't always expect dest_maxlen bytes */ | 826 | * may be fragmented--don't always expect dest_maxlen bytes */ |
827 | if (rr->length < dest_maxlen) { | 827 | if (rr->length < dest_maxlen) { |
828 | #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
829 | /* | ||
830 | * for normal alerts rr->length is 2, while | ||
831 | * dest_maxlen is 7 if we were to handle this | ||
832 | * non-existing alert... | ||
833 | */ | ||
834 | FIX ME | ||
835 | #endif | ||
836 | s->internal->rstate = SSL_ST_READ_HEADER; | 828 | s->internal->rstate = SSL_ST_READ_HEADER; |
837 | rr->length = 0; | 829 | rr->length = 0; |
838 | goto start; | 830 | goto start; |
@@ -1396,23 +1388,12 @@ dtls1_dispatch_alert(SSL *s) | |||
1396 | *ptr++ = s->s3->send_alert[0]; | 1388 | *ptr++ = s->s3->send_alert[0]; |
1397 | *ptr++ = s->s3->send_alert[1]; | 1389 | *ptr++ = s->s3->send_alert[1]; |
1398 | 1390 | ||
1399 | #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
1400 | if (s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE) { | ||
1401 | s2n(D1I(s)->handshake_read_seq, ptr); | ||
1402 | l2n3(D1I(s)->r_msg_hdr.frag_off, ptr); | ||
1403 | } | ||
1404 | #endif | ||
1405 | |||
1406 | i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf)); | 1391 | i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf)); |
1407 | if (i <= 0) { | 1392 | if (i <= 0) { |
1408 | s->s3->alert_dispatch = 1; | 1393 | s->s3->alert_dispatch = 1; |
1409 | /* fprintf( stderr, "not done with alert\n" ); */ | 1394 | /* fprintf( stderr, "not done with alert\n" ); */ |
1410 | } else { | 1395 | } else { |
1411 | if (s->s3->send_alert[0] == SSL3_AL_FATAL | 1396 | if (s->s3->send_alert[0] == SSL3_AL_FATAL) |
1412 | #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
1413 | || s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
1414 | #endif | ||
1415 | ) | ||
1416 | (void)BIO_flush(s->wbio); | 1397 | (void)BIO_flush(s->wbio); |
1417 | 1398 | ||
1418 | if (s->internal->msg_callback) | 1399 | if (s->internal->msg_callback) |
diff --git a/src/lib/libssl/dtls1.h b/src/lib/libssl/dtls1.h index c7b2d3af76..cc672a5934 100644 --- a/src/lib/libssl/dtls1.h +++ b/src/lib/libssl/dtls1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dtls1.h,v 1.21 2017/01/22 07:16:39 beck Exp $ */ | 1 | /* $OpenBSD: dtls1.h,v 1.22 2018/08/24 19:35:05 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. |
@@ -87,11 +87,7 @@ extern "C" { | |||
87 | 87 | ||
88 | #define DTLS1_CCS_HEADER_LENGTH 1 | 88 | #define DTLS1_CCS_HEADER_LENGTH 1 |
89 | 89 | ||
90 | #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE | ||
91 | #define DTLS1_AL_HEADER_LENGTH 7 | ||
92 | #else | ||
93 | #define DTLS1_AL_HEADER_LENGTH 2 | 90 | #define DTLS1_AL_HEADER_LENGTH 2 |
94 | #endif | ||
95 | 91 | ||
96 | #ifndef OPENSSL_NO_SSL_INTERN | 92 | #ifndef OPENSSL_NO_SSL_INTERN |
97 | 93 | ||