diff options
author | Rob Austein <sra@hactrn.net> | 2020-05-26 15:18:35 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2020-05-26 15:18:35 -0400 |
commit | 3e6addd37b2165857a8208b7cb003485a5654cfa (patch) | |
tree | 815bf78cd2770d34e74ec33cc7ab3c168cb266ff | |
parent | fa3feddf3a25e34db2ac57ff8e962f13db07bf40 (diff) |
Wow, python-version-independent hexadecimal is painful
-rw-r--r-- | scripts/py11-test.py | 4 |
1 files 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") |