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

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