Skip to content

Commit

Permalink
raise an error when STARTTLS fails
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Jun 11, 2016
1 parent 391f1a4 commit 2e1b7fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ def starttls(self, keyfile=None, certfile=None):
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=[],
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 2e1b7fc

Please sign in to comment.