From 1a6cfd17cbd581fce4d2697c73fafecf0d023279 Mon Sep 17 00:00:00 2001 From: Reiner Rottmann Date: Sun, 30 Oct 2022 08:51:57 +0100 Subject: [PATCH 1/2] Small fix in ModuleNotFoundError handling. --- tools/pico-hsm-tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pico-hsm-tool.py b/tools/pico-hsm-tool.py index 9df8763..93d001e 100755 --- a/tools/pico-hsm-tool.py +++ b/tools/pico-hsm-tool.py @@ -24,17 +24,17 @@ try: from smartcard.CardType import AnyCardType from smartcard.CardRequest import CardRequest from smartcard.Exceptions import CardRequestTimeoutException - from cvc.certificates import CVC -except: +except ModuleNotFoundError: print('ERROR: smarctard module not found! Install pyscard package.\nTry with `pip install pyscard`') sys.exit(-1) try: + from cvc.certificates import CVC from cvc.asn1 import ASN1 from cvc.oid import oid2scheme from cvc.utils import scheme_rsa from cryptography.hazmat.primitives.asymmetric import ec -except: +except ModuleNotFoundError: print('ERROR: cvc module not found! Install pycvc package.\nTry with `pip install pycvc`') sys.exit(-1) import json From 14e8d9cd04b75924e7c6ed70ccd39ad3251a6161 Mon Sep 17 00:00:00 2001 From: Reiner Rottmann Date: Sun, 30 Oct 2022 08:52:28 +0100 Subject: [PATCH 2/2] Fixing typo in command. --- doc/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/usage.md b/doc/usage.md index 80c7d1e..6dd2eb9 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -30,7 +30,7 @@ PIN=648219 ## Initialization The first step is to initialize the HSM. To do so, use the `pico-hsm-tool.py` in `tools` folder: ``` -$ python3 pico-hsm-tool initialize --so-pin 3537363231383830 --pin 648219 +$ python3 pico-hsm-tool.py initialize --so-pin 3537363231383830 --pin 648219 ``` The PIN number is used to manage all private keys in the device. It supports three attemps. After the third PIN failure, it gets blocked. The PIN accepts from 6 to 16 characters.