Commit Graph

604 Commits

Author SHA1 Message Date
Pol Henarejos
742c3f3e3c
RTC command is not available in emulation.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-12 20:04:23 +01:00
Pol Henarejos
9793977ffc
Fixed double counter increment.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-12 20:04:05 +01:00
Pol Henarejos
6c85772fff
Added emulated build capability.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-01-12 20:03:42 +01:00
Pol Henarejos
9ff3254a4c
Update to latest HSM SDK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-22 22:50:54 +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
691aa3308c
Fix when importing a dkek and it fails.
Now the dkek state is returned to the previous one.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 20:11:26 +01:00
Pol Henarejos
6a57e67629
Fix importing dkek twice.
It is not allowed anymore.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 20:04:18 +01:00
Pol Henarejos
202c8a4b22
Credentials are not necessary when importing DKEK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 20:00:32 +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
9e9cf9b768
Upgrading version to v3.2.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-06 19:00:44 +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
65cde9960f
Upgrading version to v3.2.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-12-04 17:42:03 +01:00
Pol Henarejos
7ca96178fb
Moving HSM SDK pointer to latest release.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-28 18:54:22 +01:00
Pol Henarejos
020feaf325
Update README.md
Fix header
2022-11-15 22:42:43 +01:00
Pol Henarejos
e70461e551
Merge branch 'master' into development 2022-11-15 17:40:29 +01:00
Pol Henarejos
0e918434a2
Update README.md 2022-11-15 17:38:33 +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
4113f6a65d
Fix parsing PBKDF2 params.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-15 00:14:39 +01:00
Pol Henarejos
f98d744076
Add apdu.ne check for large buffers.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 18:04:44 +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
aa8b1e6efe
Added support for X963 KDF.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 15:38:16 +01:00
Pol Henarejos
0cb2e8ec2e
Added PBES2 key derivation with encryption and decryption support.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 13:07:49 +01:00
Pol Henarejos
0e96753ccb
Added support for PBKDF2.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 12:01:27 +01:00
Pol Henarejos
2b2df22d75
Added support for configurable HKDF.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-14 10:14:54 +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
8fe2677a56
Fix cofactor return with cvc.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-11 17:08:36 +01:00
Pol Henarejos
d09a7cf9c8
If self-signature fails, puts all-0.
When generating a keypair and returns a self-signed CVREQ, the signature might fail for Curve25519 and Curve448. Instead of returning null, it puts zeros in order to return what is expected to return.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-11-11 17:04:17 +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
d5899a90c1
Merge pull request #10 from rrottmann/small-fixes
Small fixes
2022-11-03 16:05:56 +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
Pol Henarejos
eda8b53949
Memory cleanup on ECDH.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-31 12:54:44 +01:00
Pol Henarejos
cfc0cc8f6e
Some optimizations.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-31 00:38:30 +01:00
Pol Henarejos
ab61b2a2d5
Fix returning public key of koblitz curve secp_k1.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-31 00:38:21 +01:00
Pol Henarejos
f79a6ed30a
Do not override Ne.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-30 23:42:12 +01:00
Pol Henarejos
4313722b06
Fix memory free on keygen ecc.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-30 23:15:22 +01:00
Pol Henarejos
eec4612a6f
Fix when secure message cannot be correctly processed.
It is discarded.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-30 21:11:06 +01:00
Pol Henarejos
b2ac893efc
Fix general authentication with AES.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-30 21:09:41 +01:00
Reiner Rottmann
14e8d9cd04 Fixing typo in command. 2022-10-30 08:52:28 +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