aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-12-13 11:09:35 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2016-12-13 12:09:35 -0500
commit874445aea9e2d07a94444855ccfeaa3082de26a9 (patch)
tree8d3c2c0040ad6d5ae6fba72a76061063aa3f5360 /src
parentcd77364230c208d500c84da38c7419e5f573e2f2 (diff)
downloadcryptography-874445aea9e2d07a94444855ccfeaa3082de26a9.tar.gz
cryptography-874445aea9e2d07a94444855ccfeaa3082de26a9.tar.bz2
cryptography-874445aea9e2d07a94444855ccfeaa3082de26a9.zip
fix a regression in int_from_bytes (#3316)
* fix a regression in int_from_bytes * add a new test file
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 6fda2cc1..f16b7efa 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -47,7 +47,8 @@ else:
assert byteorder == 'big'
assert not signed
- return int(data.encode('hex'), 16)
+ # call bytes() on data to allow the use of bytearrays
+ return int(bytes(data).encode('hex'), 16)
def int_to_bytes(integer, length=None):