Blame SOURCES/00237-CVE-2016-0772-smtplib.patch

159b10
From 5b67aca6fb4246e84981d6361ba218bd52e73ac2 Mon Sep 17 00:00:00 2001
159b10
From: Tomas Orsava <torsava@redhat.com>
159b10
Date: Tue, 21 Jun 2016 15:52:03 +0200
159b10
Subject: [PATCH] Raise an error when STARTTLS fails
159b10
159b10
CVE-2016-0772 python: smtplib StartTLS stripping attack
159b10
rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647
159b10
159b10
Based on an upstream change by Benjamin Peterson <benjamin@python.org>
159b10
- in changeset 101887:d590114c2394 3.4
159b10
- https://hg.python.org/cpython/rev/d590114c2394
159b10
---
159b10
 Lib/smtplib.py | 5 +++++
159b10
 1 file changed, 5 insertions(+)
159b10
159b10
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
159b10
index dc16ef6..8bc806b 100755
159b10
--- a/Lib/smtplib.py
159b10
+++ b/Lib/smtplib.py
159b10
@@ -655,6 +655,11 @@ class SMTP:
159b10
             self.ehlo_resp = None
159b10
             self.esmtp_features = {}
159b10
             self.does_esmtp = 0
159b10
+        else:
159b10
+            # RFC 3207:
159b10
+            # 501 Syntax error (no parameters allowed)
159b10
+            # 454 TLS not available due to temporary reason
159b10
+            raise SMTPResponseException(resp, reply)
159b10
         return (resp, reply)
159b10
 
159b10
     def sendmail(self, from_addr, to_addrs, msg, mail_options=[],
159b10
-- 
159b10
2.5.5
159b10