diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-07-12 12:08:28 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-07-12 12:08:28 -0500 |
commit | 828908623ac1714e9b66de56e6707e399a1aa5b8 (patch) | |
tree | 77f978bebc8eedb92e179ea6e6391b19d400e288 /src | |
parent | 01d5d0b44256bed5e49f37e2f92e1f4e4fc0154e (diff) | |
download | cryptography-828908623ac1714e9b66de56e6707e399a1aa5b8.tar.gz cryptography-828908623ac1714e9b66de56e6707e399a1aa5b8.tar.bz2 cryptography-828908623ac1714e9b66de56e6707e399a1aa5b8.zip |
simplify logic, it doesn't appear parts > 2 is possible
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index ca91b07a..8bed79e2 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -906,10 +906,9 @@ class RFC822Name(object): name, address = parseaddr(value) parts = address.split(u"@") - if name or len(parts) > 2 or not address: - # parseaddr has found a name (e.g. Name <email>) or the split - # has found more than 2 parts (which means more than one @) - # or the entire value is an empty string. + if name or not address: + # parseaddr has found a name (e.g. Name <email>) or the entire + # value is an empty string. raise ValueError("Invalid rfc822name value") elif len(parts) == 1: # Single label email name. This is valid for local delivery. |