]> granicus.if.org Git - python/commitdiff
raise an error when STARTTLS fails
authorBenjamin Peterson <benjamin@python.org>
Sat, 11 Jun 2016 20:16:42 +0000 (13:16 -0700)
committerBenjamin Peterson <benjamin@python.org>
Sat, 11 Jun 2016 20:16:42 +0000 (13:16 -0700)
Lib/smtplib.py
Misc/NEWS

index 8388b984a11aca88face0055480e8620a275e43f..e1651c0a8bcf1c1ab70e2ccca0f4869be30837a2 100755 (executable)
@@ -656,6 +656,11 @@ class SMTP:
             self.ehlo_resp = None
             self.esmtp_features = {}
             self.does_esmtp = 0
+        else:
+            # RFC 3207:
+            # 501 Syntax error (no parameters allowed)
+            # 454 TLS not available due to temporary reason
+            raise SMTPResponseException(resp, reply)
         return (resp, reply)
 
     def sendmail(self, from_addr, to_addrs, msg, mail_options=[],
index 4c643efe2381f376f44ef7962e2f3d143efe1c3d..313d913fe80713b7f8a197fb26f3e825ae2508aa 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -92,6 +92,9 @@ Core and Builtins
 Library
 -------
 
+- Fix TLS stripping vulnerability in smptlib, CVE-2016-0772.  Reported by Team
+  Oststrom
+
 - Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
   locale.