aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-06-27 00:07:09 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-06-27 00:07:09 -0400
commitba19c2e73f70e5b3e08d62e13326e91588eae8c4 (patch)
treebce6e02931c8a9da2f8cf0d84472e032138f7511 /src
parent7d85341b2143015756d44c278453c285e1518fbf (diff)
downloadcryptography-ba19c2e73f70e5b3e08d62e13326e91588eae8c4.tar.gz
cryptography-ba19c2e73f70e5b3e08d62e13326e91588eae8c4.tar.bz2
cryptography-ba19c2e73f70e5b3e08d62e13326e91588eae8c4.zip
Fixed #2067 -- raise an error if a CSRbuilder doesn't hav a subject
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py2
-rw-r--r--src/cryptography/x509.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index 78de79d1..e27fb6e8 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -833,7 +833,7 @@ class Backend(object):
# Set subject name.
res = self._lib.X509_REQ_set_subject_name(
- x509_req, _encode_name(self, list(builder._subject_name))
+ x509_req, _encode_name(self, builder._subject_name)
)
assert res == 1
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 0f72abb3..668bc2ef 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -1486,4 +1486,6 @@ class CertificateSigningRequestBuilder(object):
"""
Signs the request using the requestor's private key.
"""
+ if self._subject_name is None:
+ raise ValueError("A CertificateSigningRequest must have a subject")
return backend.create_x509_csr(self, private_key, algorithm)