Commit Graph

50 Commits

Author SHA1 Message Date
Pol Henarejos
623cf10dba
Add phy command to pico-hsm-tool to change VIDPID dynamically.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-04-17 11:51:25 +02:00
Pol Henarejos
38bef5b43f
Fix error message
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2024-01-09 11:26:26 +01:00
Pol Henarejos
2974aa234a
Added required for subparsers.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-13 16:59:15 +01:00
Pol Henarejos
d90b296237
Added keygen command to generate AES, X25519 and X448 keys.
It replaces x25519/x448 commands and cipher keygen subcommand.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-13 16:57:11 +01:00
Pol Henarejos
e98b26fee5
Flush stderr.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-13 15:34:33 +01:00
Pol Henarejos
2086a68c53
Key id not needed on keygen.
It also returns the fresh new generated key id.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-13 15:34:21 +01:00
Pol Henarejos
a5ab1cabc5
Add support for AES-ECB, AES-CBC with custom IV, AES-OFB, AES-CFB, AES-GCM, AES-CCM, AES-CTR and AES-XTS.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-11 21:19:31 +01:00
Pol Henarejos
1c7cdc8564
Added support for CMAC.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-11 20:28:13 +01:00
Pol Henarejos
d74b3418bc
Fix typo
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-11 20:13:38 +01:00
Pol Henarejos
a3bf2e9e14
If no key is found, generate a new one.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-11-06 17:10:19 +01:00
Pol Henarejos
3d7f714936
Fix initialization with so-pin.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-09-05 19:56:11 +02:00
Pol Henarejos
f09654ccf4
Added --silent flag to initialization to avoid prompt display.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-09-05 19:56:11 +02:00
Pol Henarejos
6af4cc7fec
Fix getting RTC with pico-hsm-tool.
Closes #25.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-06-20 13:32:30 +02:00
Pol Henarejos
ebcac9dfdc
Upgrade to pico-hsm-tool to use the newer PicoHSM python package.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-23 20:19:53 +01:00
Pol Henarejos
8fd3b4d858
CA cert is also uploaded to perform PKA.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-03-06 01:01:20 +01:00
Pol Henarejos
b24e109a3c
Fix error message when no card is detected.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-16 22:50:53 +01:00
Pol Henarejos
7d906851dd
Updating to newer version of Pico HSM SDK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-20 23:51:49 +01:00
Pol Henarejos
f2874ae3ef
Fix when ping is provided during the initialization.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 20:00:19 +01:00
Pol Henarejos
c95dee84f2
Changing backend service url.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 19:00:35 +01:00
Pol Henarejos
63c85000d0
Added support for kdf.
It supports HKDF, PBKDF2 and X963, with multiple MD (SHA family), salt/nonces and configurable output size.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-15 00:15:59 +01:00
Pol Henarejos
bb4c293736
Adding subparsers for subcommands.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 16:27:51 +01:00
Pol Henarejos
f65167e3c7
Adding support for keypair generation for Curve25519 and Curve448.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-11 17:10:34 +01:00
Pol Henarejos
6bf72e5a59
Added support for HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384 and HMAC-SHA512.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-08 17:26:32 +01:00
Pol Henarejos
7c877ebea2
Using file_out parameter.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-07 22:31:19 +01:00
Pol Henarejos
e1983f7bcc
Now is possible pipe encrypt & decrypt commands.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-07 22:16:10 +01:00
Pol Henarejos
a5e025a4e5
If no applet is selected, then select it.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-07 21:37:42 +01:00
Pol Henarejos
a7682d2639
Adding Extended Cipher feature.
With this new subcommand, Pico HSM will support newer cipher algorithms.
ChaCha20-Poly1305 is the first. It will be based on a custom P2 subcommand to support an arbitrary structure with multiple parameters (AAD, IV, etc.)

pico-hsm-tool.py shall be used.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-07 21:37:11 +01:00
Pol Henarejos
30301c68f1
Linux uses the generic interface. Needs deep testing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-07 13:14:37 +01:00
Pol Henarejos
abf980d84e
Fixes in windows backend.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-03 18:41:02 +01:00
Pol Henarejos
8718f55df2
Adding secure_key for windows.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-03 18:26:35 +01:00
Pol Henarejos
d1a3a24527
Import secure_key only when needed.
Now, it does not block anymore the entire execution of pico tool.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-03 16:09:42 +01:00
Pol Henarejos
f363b77a07
Adding secure_key for macOS.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-03 16:06:06 +01:00
Pol Henarejos
f1058ea611
Merge branch 'master' into small-fixes 2022-11-03 15:48:33 +01:00
Pol Henarejos
00279da8d5
Adding Secure Lock to lock the device with a random 256 bit key.
This is an extra layer of security to avoid brute force attacks if PIN is too weak.
At every hard reset (on device plug), the device must be unlocked prior any other command. Once unlocked, the device can be used as usual.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-31 15:09:54 +01:00
Reiner Rottmann
1a6cfd17cb Small fix in ModuleNotFoundError handling. 2022-10-30 08:51:57 +01:00
Pol Henarejos
3835507e00
Fix displaying error message if pycvc is missing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-29 11:35:54 +02:00
Pol Henarejos
4536589e2c
Added error message if package is missing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-10 11:02:07 +02:00
Pol Henarejos
1e39558fbc
Typo
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-10 00:39:32 +02:00
Pol Henarejos
67ea640a14
Fix endianness of patcher (again)
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-09 22:20:41 +02:00
Pol Henarejos
8b29b137a8
Small fixes.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-09 22:04:30 +02:00
Pol Henarejos
9e1747e539
Upgrading pico-hsm-sdk version to v3.0 2022-08-31 14:09:02 +02:00
Pol Henarejos
a7396dc698
Fix the endianness of vid/pid patcher. 2022-08-31 14:08:29 +02:00
Pol Henarejos
67699bd24c
Before initializing, we select the applet. 2022-08-30 17:55:56 +02:00
Pol Henarejos
6e5db3c292
Upgrading pico-ccid to version 2.2 2022-08-29 11:31:47 +02:00
Pol Henarejos
4fb26559f4
Adding --so-pin flag for initialize command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 13:47:42 +02:00
Pol Henarejos
c366c1d1a3
Added datetime and options menu to manipulate the RTC and options (press-to-confirm button and optional counter for each key).
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 13:38:09 +02:00
Pol Henarejos
138af5c113
Adding --pin parameter for initialization.
If provided, it unlocks MKEK before initialization.
If not, it will generate a new MKEK and device certificate.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +02:00
Pol Henarejos
cd6f898f8e
Fix storing certs in DER format.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +02:00
Pol Henarejos
9ef088971b
Integrate all commands to a single script
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +02:00
Pol Henarejos
e399b1c0b1
Renaming the tools and moving to tools/ folder.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +02:00