aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-10-11 22:01:29 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-10-12 10:01:29 +0800
commit31034a03227ebfe63f4025cd95137f116cd4236a (patch)
tree33454544ff3f1f2eec9b7225a681832dd999ebd3 /src/cryptography/x509
parenta87daea52b698a59664d852ecad567a742576265 (diff)
downloadcryptography-31034a03227ebfe63f4025cd95137f116cd4236a.tar.gz
cryptography-31034a03227ebfe63f4025cd95137f116cd4236a.tar.bz2
cryptography-31034a03227ebfe63f4025cd95137f116cd4236a.zip
Inline calls to bit_length now that it's trivial (#3966)
* Inline calls to bit_length now that it's trivial * unused imports * An comment
Diffstat (limited to 'src/cryptography/x509')
-rw-r--r--src/cryptography/x509/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptography/x509/base.py b/src/cryptography/x509/base.py
index 2c96c5bc..45b603f0 100644
--- a/src/cryptography/x509/base.py
+++ b/src/cryptography/x509/base.py
@@ -469,7 +469,7 @@ class CertificateBuilder(object):
# ASN.1 integers are always signed, so most significant bit must be
# zero.
- if utils.bit_length(number) >= 160: # As defined in RFC 5280
+ if number.bit_length() >= 160: # As defined in RFC 5280
raise ValueError('The serial number should not be more than 159 '
'bits.')
return CertificateBuilder(
@@ -686,7 +686,7 @@ class RevokedCertificateBuilder(object):
# ASN.1 integers are always signed, so most significant bit must be
# zero.
- if utils.bit_length(number) >= 160: # As defined in RFC 5280
+ if number.bit_length() >= 160: # As defined in RFC 5280
raise ValueError('The serial number should not be more than 159 '
'bits.')
return RevokedCertificateBuilder(