[Cryptech-Commits] [sw/pkcs11] branch python3 updated: Wow, python-version-independent hexadecimal is painful

git at cryptech.is git at cryptech.is
Tue May 26 19:18:32 UTC 2020


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch python3
in repository sw/pkcs11.

The following commit(s) were added to refs/heads/python3 by this push:
     new 3e6addd  Wow, python-version-independent hexadecimal is painful
3e6addd is described below

commit 3e6addd37b2165857a8208b7cb003485a5654cfa
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Tue May 26 15:18:35 2020 -0400

    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")

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list