TLS1.3: swallow user_cancelled warning alerts

This commit is contained in:
Joseph Birr-Pixton 2020-04-11 17:02:24 +01:00
parent 278009aa58
commit 222bfa8d12
1 changed files with 3 additions and 2 deletions

View File

@ -501,9 +501,10 @@ impl SessionCommon {
return Ok(()); return Ok(());
} }
// Warnings are nonfatal for TLS1.2, but outlawed in TLS1.3. // Warnings are nonfatal for TLS1.2, but outlawed in TLS1.3
// (except, for no good reason, user_cancelled).
if alert.level == AlertLevel::Warning { if alert.level == AlertLevel::Warning {
if self.is_tls13() { if self.is_tls13() && alert.description != AlertDescription::UserCanceled {
self.send_fatal_alert(AlertDescription::DecodeError); self.send_fatal_alert(AlertDescription::DecodeError);
} else { } else {
warn!("TLS alert warning received: {:#?}", msg); warn!("TLS alert warning received: {:#?}", msg);