From 3e6addd37b2165857a8208b7cb003485a5654cfa Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 26 May 2020 15:18:35 -0400 Subject: Wow, python-version-independent hexadecimal is painful --- scripts/py11-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/py11-test.py b/scripts/py11-test.py index cf633a3..2ac74b7 100644 --- a/scripts/py11-test.py +++ b/scripts/py11-test.py @@ -95,7 +95,7 @@ print() print("Generating some random data") session = p11.C_OpenSession(slot) random = p11.C_GenerateRandom(session, 33) -print(len(random), hexlify(random)) +print(len(random), hexlify(random).decode("ascii")) print() print("Logging in") @@ -137,7 +137,7 @@ print() print("Testing P-256 signature") p11.C_SignInit(session, CKM_ECDSA_SHA256, ec_p256_keypair[1]) sig_p256 = p11.C_Sign(session, hamster) -print("Signature:", hexlify(sig_p256.encode)) +print("Signature:", hexlify(sig_p256).decode("ascii")) print() print("Testing P256 verification") -- cgit v1.2.3