From b73dd29234e854d25c8fc09bdf5bb57143fc0250 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 20 Feb 2014 18:01:03 -0600 Subject: bytes and strings...yes. --- cryptography/hazmat/backends/openssl/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index be584868..de6f841c 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -281,7 +281,7 @@ class Backend(object): ownership of the object). Be sure to register it for GC if it will be discarded after use. """ - hex_num = hex(num).rstrip("L").lstrip("0x") or "0" + hex_num = hex(num).rstrip("L").lstrip("0x").encode("ascii") or b"0" bn_ptr = self._ffi.new("BIGNUM **") res = self._lib.BN_hex2bn(bn_ptr, hex_num) assert res != 0 -- cgit v1.2.3