From 874445aea9e2d07a94444855ccfeaa3082de26a9 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 13 Dec 2016 11:09:35 -0600 Subject: fix a regression in int_from_bytes (#3316) * fix a regression in int_from_bytes * add a new test file --- src/cryptography/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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): -- cgit v1.2.3