Commit Graph

571 Commits

Author SHA1 Message Date
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
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
a089cc279b
Adding support for changing SO-PIN.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-10 00:37:56 +02:00
Pol Henarejos
84f646dbad
Fix storing SO-PIN session when checking PIN with SO-PIN.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-10 00:37:33 +02:00
Pol Henarejos
b9ec473aaa
Fix critical bug saving SO-PIN securely.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-10 00:27:46 +02:00
Pol Henarejos
b7eb0dff02
Upgrade to Version 3.0.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-09 22:27:11 +02:00
Pol Henarejos
06f550cc04
Update usage.md 2022-10-09 22:26:45 +02:00
Pol Henarejos
1752b1aec7
Update usage.md 2022-10-09 22:25:35 +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
f593060007
Moving delete_file() outside.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-09 22:07:21 +02:00
Pol Henarejos
8504eed35c
Adding fixes and moving to Mbedtls 3.2.1
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-10-09 22:07:10 +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
08d3ca6d27
Update README.md 2022-10-09 19:57:52 +02:00
Pol Henarejos
e6767f4c0a
Moving pointer.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-25 23:25:16 +02:00
Pol Henarejos
9e5d65706e
Merge pull request #2 from rrottmann/master
Building pico-hsm using Linux containers
2022-09-25 18:42:37 +02:00
Reiner Rottmann
61d7b6da38 Added Dockerfile for building pico-hsm and updated README.md with instructions. 2022-09-23 20:36:05 +02:00
Pol Henarejos
6affe64ec5
Adding missing file to pico-hsm-sdk. 2022-08-31 14:19:32 +02:00
Pol Henarejos
ab75718927
Using pico_hsm_sdk library instead. 2022-08-31 14:10:04 +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
62c72c48a5
Moving to new pico-hsm-sdk. 2022-08-30 17:55:42 +02:00
Pol Henarejos
3944c8437a
Moving to pico-hsm-sdk 2022-08-30 17:54:38 +02:00
Pol Henarejos
b7d603342e
Upgrading pico-ccid 2022-08-29 11:32:39 +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
e8cc6a169e
Try to recover MKEK twice: with previous PIN/SO-PIN or after setting the new PIN/SO-PIN just in case some is the same as previous.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +02:00
Pol Henarejos
7d7b6b88ba
Trying to recover MKEK to preserver device private key. If not, all are generated again.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-25 01:51:16 +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
b3bcad9ce6
Making MKEK persistent.
It must be persistent as it encrypts device private key and therefore it must survive across reinitializations.
However, if no PIN is provided to unlock it, it will be lost, as with device private key.

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