diff options
Diffstat (limited to 'src/lib/libssl/tls13_record_layer.c')
-rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c index e5f8ba8859..7d882924bc 100644 --- a/src/lib/libssl/tls13_record_layer.c +++ b/src/lib/libssl/tls13_record_layer.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_record_layer.c,v 1.25 2020/01/24 04:36:29 beck Exp $ */ | 1 | /* $OpenBSD: tls13_record_layer.c,v 1.26 2020/01/25 09:20:56 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -29,9 +29,11 @@ static ssize_t tls13_record_layer_write_record(struct tls13_record_layer *rl, | |||
29 | 29 | ||
30 | struct tls13_record_layer { | 30 | struct tls13_record_layer { |
31 | uint16_t legacy_version; | 31 | uint16_t legacy_version; |
32 | |||
32 | int ccs_allowed; | 33 | int ccs_allowed; |
33 | int ccs_seen; | 34 | int ccs_seen; |
34 | int handshake_completed; | 35 | int handshake_completed; |
36 | int legacy_alerts_allowed; | ||
35 | int phh; | 37 | int phh; |
36 | 38 | ||
37 | /* | 39 | /* |
@@ -207,6 +209,12 @@ tls13_record_layer_allow_ccs(struct tls13_record_layer *rl, int allow) | |||
207 | } | 209 | } |
208 | 210 | ||
209 | void | 211 | void |
212 | tls13_record_layer_allow_legacy_alerts(struct tls13_record_layer *rl, int allow) | ||
213 | { | ||
214 | rl->legacy_alerts_allowed = allow; | ||
215 | } | ||
216 | |||
217 | void | ||
210 | tls13_record_layer_set_aead(struct tls13_record_layer *rl, | 218 | tls13_record_layer_set_aead(struct tls13_record_layer *rl, |
211 | const EVP_AEAD *aead) | 219 | const EVP_AEAD *aead) |
212 | { | 220 | { |
@@ -279,10 +287,15 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl) | |||
279 | rl->read_closed = 1; | 287 | rl->read_closed = 1; |
280 | rl->write_closed = 1; | 288 | rl->write_closed = 1; |
281 | ret = TLS13_IO_ALERT; | 289 | ret = TLS13_IO_ALERT; |
282 | } else | 290 | } else if (rl->legacy_alerts_allowed && alert_level == SSL3_AL_WARNING) { |
291 | /* Ignored and not passed to the callback. */ | ||
292 | return TLS13_IO_WANT_RETRY; | ||
293 | } else { | ||
283 | return tls13_send_alert(rl, SSL_AD_ILLEGAL_PARAMETER); | 294 | return tls13_send_alert(rl, SSL_AD_ILLEGAL_PARAMETER); |
295 | } | ||
284 | 296 | ||
285 | rl->alert_cb(alert_desc, rl->cb_arg); | 297 | rl->alert_cb(alert_desc, rl->cb_arg); |
298 | |||
286 | return ret; | 299 | return ret; |
287 | } | 300 | } |
288 | 301 | ||