summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/d1_pkt.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index 2610206797..4e773a42bb 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.101 2021/07/19 08:42:24 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.102 2021/07/21 07:51:12 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.
@@ -323,14 +323,22 @@ dtls1_process_record(SSL *s)
323 if (alert_desc == 0) 323 if (alert_desc == 0)
324 goto err; 324 goto err;
325 325
326 /*
327 * DTLS should silently discard invalid records, including those
328 * with a bad MAC, as per RFC 6347 section 4.1.2.1.
329 */
330 if (alert_desc == SSL_AD_BAD_RECORD_MAC) {
331 out_len = 0;
332 goto done;
333 }
334
326 if (alert_desc == SSL_AD_RECORD_OVERFLOW) 335 if (alert_desc == SSL_AD_RECORD_OVERFLOW)
327 SSLerror(s, SSL_R_ENCRYPTED_LENGTH_TOO_LONG); 336 SSLerror(s, SSL_R_ENCRYPTED_LENGTH_TOO_LONG);
328 else if (alert_desc == SSL_AD_BAD_RECORD_MAC)
329 SSLerror(s, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
330 337
331 goto fatal_err; 338 goto fatal_err;
332 } 339 }
333 340
341 done:
334 rr->data = out; 342 rr->data = out;
335 rr->length = out_len; 343 rr->length = out_len;
336 rr->off = 0; 344 rr->off = 0;
@@ -345,7 +353,6 @@ dtls1_process_record(SSL *s)
345 return (0); 353 return (0);
346} 354}
347 355
348
349/* Call this to get a new input record. 356/* Call this to get a new input record.
350 * It will return <= 0 if more data is needed, normally due to an error 357 * It will return <= 0 if more data is needed, normally due to an error
351 * or non-blocking IO. 358 * or non-blocking IO.