Commit Graph

19 Commits

Author SHA1 Message Date
Pol Henarejos
2eab8eba09 Added asymmetric key derivation. Only for EC.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-21 15:37:34 +01:00
Pol Henarejos
783c901567 Replaced EC load private key with read_key, which performs sanity checks.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-21 14:25:00 +01:00
Pol Henarejos
90d1fa0f9b If modulusSize is used, the test will fail as it is an unexpected field. It does not seems necessary.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-21 11:37:05 +01:00
Pol Henarejos
96b791b3b9 - Fixed bug where PublicKD was saved in EE_CERTIFICATE_PREFIX. We save there the CSR instead in CVC format.
- We put the CHR and CAR into the CSR if provided during the keypair generation.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-21 11:31:24 +01:00
Pol Henarejos
0a2740fbab Added AES derive support based on HKDF.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-21 00:54:59 +01:00
Pol Henarejos
ae1e2ac111 Fix storing public key description when generating a new keypair.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-19 19:11:09 +01:00
Pol Henarejos
d87073f4cc Auth status should not be removed when apple is reselected. Auth status is removed when the reader disconnects the card (unloads it).
With this fix, it is possible to login first and send immediate low level APDU command that requires authentification (such as login+CMAC).

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-17 23:37:02 +01:00
Pol Henarejos
36a8f78313 Added support for AES-CMAC.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-17 23:35:07 +01:00
Pol Henarejos
ab1490a50b Added ECDH key derivation.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-17 00:28:16 +01:00
Pol Henarejos
23f53a6095 Added some free on bad return.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-16 23:40:09 +01:00
Pol Henarejos
8988d1cf15 Fix support for ECDSA and ECDSA-SHAx signatures.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-16 18:20:17 +01:00
Pol Henarejos
591b02804e Fix for HASH PSS and HASH PKCS.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-16 12:02:49 +01:00
Pol Henarejos
73bc2ede6b Fixed a bug with RSA-PKCS-PSS. Surprisingly, PKCS_V21 signature takes in place (input buffer = output buffer) and, for a strange reason, it does not work for res_APDU.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-16 00:27:07 +01:00
Pol Henarejos
1c6fb98350 Logout user when applet selected.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-10 00:48:47 +01:00
Pol Henarejos
f1c0b12f5c Increasing random buffer and checks.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-10 00:13:13 +01:00
Pol Henarejos
213b675b9f Fix returned error code for wrong pin.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-10 00:09:35 +01:00
Pol Henarejos
4a0144ed2a Adding version header to show in lsusb command (bcdDevice) and major version in pkcs15-tool -D.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-08 18:43:30 +01:00
Pol Henarejos
9be78aade6 Changing project name.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-08 00:37:27 +01:00
Pol Henarejos
7988083d6b Reorganization of file structure.
At this moment I disabled openpgp/gnuk due to missing deep tests.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-03-07 23:37:10 +01:00