diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 18:33:33 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 18:33:33 -0700 |
commit | eb177931f825308f9b4df9c789f76b7ce04751f6 (patch) | |
tree | 70ab7d203fa053b240b4888c2012fb6ceb9d5db6 /src | |
parent | b0391810fb74bd098592b03ffbb937daeed4561f (diff) | |
download | cryptography-eb177931f825308f9b4df9c789f76b7ce04751f6.tar.gz cryptography-eb177931f825308f9b4df9c789f76b7ce04751f6.tar.bz2 cryptography-eb177931f825308f9b4df9c789f76b7ce04751f6.zip |
IPAddress needs to support networks for nameconstraints
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 325d6d62..17c2a7c4 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -909,11 +909,18 @@ class RegisteredID(object): class IPAddress(object): def __init__(self, value): if not isinstance( - value, (ipaddress.IPv4Address, ipaddress.IPv6Address) + value, + ( + ipaddress.IPv4Address, + ipaddress.IPv6Address, + ipaddress.IPv4Network, + ipaddress.IPv6Network + ) ): raise TypeError( - "value must be an instance of ipaddress.IPv4Address or " - "ipaddress.IPv6Address" + "value must be an instance of ipaddress.IPv4Address, " + "ipaddress.IPv6Address, ipaddress.IPv4Network, or " + "ipaddress.IPv6Network" ) self._value = value |