py3 int.to_bytes is dead to me
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 4ca4a7a..993571b 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -47,16 +47,10 @@
return result
-if hasattr(int, "to_bytes"):
- int_to_bytes = int.to_bytes
-else:
- def int_to_bytes(integer, byteorder, signed=False):
- assert byteorder == 'big'
- assert not signed
-
- hex_string = '%x' % integer
- n = len(hex_string)
- return binascii.unhexlify(hex_string.zfill(n + (n & 1)))
+def int_to_bytes(integer):
+ hex_string = '%x' % integer
+ n = len(hex_string)
+ return binascii.unhexlify(hex_string.zfill(n + (n & 1)))
class InterfaceNotImplemented(Exception):
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 3254f26..82b8bd3 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -698,7 +698,7 @@
for bit in spki.getComponentByName("subjectPublicKey"):
bits = bits << 1 | bit
- data = utils.int_to_bytes(bits, "big")
+ data = utils.int_to_bytes(bits)
return cls(hashlib.sha1(data).digest())
digest = utils.read_only_property("_digest")