aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509/name.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-19 01:00:42 -1000
committerAlex Gaynor <alex.gaynor@gmail.com>2017-06-19 07:00:42 -0400
commit312ed095d81f85e6689be5d11072440117fd8d72 (patch)
treef85e87cd21189adfbec2bae6b4ac94b19caba097 /src/cryptography/x509/name.py
parent63df0102a4f9ba01bbff4ccf61491f53dbf8f4c2 (diff)
downloadcryptography-312ed095d81f85e6689be5d11072440117fd8d72.tar.gz
cryptography-312ed095d81f85e6689be5d11072440117fd8d72.tar.bz2
cryptography-312ed095d81f85e6689be5d11072440117fd8d72.zip
disallow empty string for NameAttribute (#3711)
Diffstat (limited to 'src/cryptography/x509/name.py')
-rw-r--r--src/cryptography/x509/name.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptography/x509/name.py b/src/cryptography/x509/name.py
index 277128fa..108b60cc 100644
--- a/src/cryptography/x509/name.py
+++ b/src/cryptography/x509/name.py
@@ -27,6 +27,9 @@ class NameAttribute(object):
"Country name must be a 2 character country code"
)
+ if len(value) == 0:
+ raise ValueError("Value cannot be an empty string")
+
self._oid = oid
self._value = value