aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-21 08:44:17 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-04-21 08:44:17 -0500
commitd04b39b253916223e9dd99831586822a4f9a2fc1 (patch)
treecf057817a98a2f2df5bffcb8c66d0214272a51d5 /src
parentbd11e028dcf763171097f5366f87f95ad0371a03 (diff)
downloadcryptography-d04b39b253916223e9dd99831586822a4f9a2fc1.tar.gz
cryptography-d04b39b253916223e9dd99831586822a4f9a2fc1.tar.bz2
cryptography-d04b39b253916223e9dd99831586822a4f9a2fc1.zip
add a check to require that the list passed to SAN is all general names
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index cdc0e430..898ab6c7 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -542,6 +542,12 @@ class IPAddress(object):
class SubjectAlternativeName(object):
def __init__(self, general_names):
+ if not all(isinstance(x, GeneralName) for x in general_names):
+ raise TypeError(
+ "Every item in the general_names list must be an "
+ "object conforming to the GeneralName interface"
+ )
+
self._general_names = general_names
def __iter__(self):