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