From 312ed095d81f85e6689be5d11072440117fd8d72 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 19 Jun 2017 01:00:42 -1000 Subject: disallow empty string for NameAttribute (#3711) --- src/cryptography/x509/name.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 -- cgit v1.2.3