Commit Graph

  • 8c1977783e Fix AES initialization context. Pol Henarejos 2022-03-06 01:30:39 +01:00
  • 7306a9765e Fix AES key generation for other 128 and 192 bits. Pol Henarejos 2022-03-06 01:29:39 +01:00
  • 5e377cccaf Added AES encryption/decryption. However, I could not find any interface (neither opensc nor sc-hsm-embedded). Needs further testing. Pol Henarejos 2022-03-06 01:28:29 +01:00
  • 37957dd8fd Adding asymmetric decryption. Pol Henarejos 2022-03-06 00:09:01 +01:00
  • ba3fa745a1 Moving load private key methods. Pol Henarejos 2022-03-05 00:31:55 +01:00
  • 982ca07096 Keys are decrypted when are used for signature. Pol Henarejos 2022-03-05 00:09:36 +01:00
  • 6cd575ea51 Added key unwrap support. Pol Henarejos 2022-03-04 23:30:56 +01:00
  • a29b01cdd8 Adding key wrap support. Pol Henarejos 2022-03-04 23:23:15 +01:00
  • 64cf9097e3 Fix saving imported DKEK. Pol Henarejos 2022-03-04 23:10:58 +01:00
  • f022c3235d Fix when initialize with 0 dkek shares. DKEK is automatically generated and saved. Pol Henarejos 2022-03-04 23:10:15 +01:00
  • 010c8018ea DKEK is reencrypted with the new pin if changed. Pol Henarejos 2022-03-04 23:08:15 +01:00
  • 78bad89415 Private and secret keys are now stored encrypted with DKEK. Pol Henarejos 2022-03-04 23:00:59 +01:00
  • dcabd78ddb Cleaning debug. Pol Henarejos 2022-03-04 23:00:24 +01:00
  • 59833d08eb Adding support for generating more than 32 bytes at a time. Pol Henarejos 2022-03-04 10:46:10 +01:00
  • 41f0b53dd5 Fix listing private keys and X509 certificates. Pol Henarejos 2022-03-03 17:56:22 +01:00
  • ab6a081fdf Better debugging. Pol Henarejos 2022-03-03 00:00:29 +01:00
  • 70e153e11d Fix RSA RAW signature. Pol Henarejos 2022-03-03 00:00:14 +01:00
  • 2f4fb3507b Fix ECDSA signature computation. Now it works. Pol Henarejos 2022-03-01 23:37:53 +01:00
  • 9202c4db66 Added ECDSA signature. Added RSA cleanups. Pol Henarejos 2022-03-01 01:15:55 +01:00
  • 486c4eb449 Added RSA signature (not tested). Still missing ECDSA signature. Trying to figure out what is ECDSA RAW. Pol Henarejos 2022-03-01 00:55:01 +01:00
  • ff06414247 Adding signature computation (unfinished) Pol Henarejos 2022-02-28 09:43:09 +01:00
  • 553bd793b9 RP 2040 does not have PIN support (i.e., pin pad support). Thus, we disable it to enable openssl pkcs11 engine interaction. Pol Henarejos 2022-02-27 20:58:04 +01:00
  • 8d6acb8162 Updating ATR. Pol Henarejos 2022-02-27 20:57:24 +01:00
  • 44b3792166 Fix with reading dynamic files. Pol Henarejos 2022-02-27 20:56:45 +01:00
  • 1918a5769c Adding symmetric key generation (AES CBC) Fix file search and discovery. Pol Henarejos 2022-02-25 17:04:31 +01:00
  • 36cd26acd3 More candy debug. Pol Henarejos 2022-02-25 17:03:28 +01:00
  • 6777221e48 Allow for null data write to allocate physical space. Pol Henarejos 2022-02-25 17:03:05 +01:00
  • 857aaf2679 Fix ACL when creating new file. Pol Henarejos 2022-02-24 22:38:15 +01:00
  • a94c74e508 Added PIN change. Pol Henarejos 2022-02-24 22:07:52 +01:00
  • 4cdb2f93e5 Fix reset pin. Pol Henarejos 2022-02-24 20:37:50 +01:00
  • 8657758cf2 Adding acl and pin checks. If pin is blocked, is always blocked despite correct login. Pol Henarejos 2022-02-24 20:00:37 +01:00
  • fce1a30f56 Fix deleting key. Pol Henarejos 2022-02-24 19:04:06 +01:00
  • a4ef5e6d17 Adding delete file command. Pol Henarejos 2022-02-24 16:22:05 +01:00
  • 249de0c5d2 Calling variable token info data generation. Pol Henarejos 2022-02-23 22:17:58 +01:00
  • a90aac5533 Making files to accept data callbacks (useful for asn1 data). Pol Henarejos 2022-02-23 22:17:31 +01:00
  • b874575dab Moving to static dynamic files. Pol Henarejos 2022-02-23 17:35:53 +01:00
  • b9bbddd24e Using separate eps. Pol Henarejos 2022-02-23 17:35:29 +01:00
  • d6368a221f Return some SW even if no app is selected. Pol Henarejos 2022-02-23 17:35:02 +01:00
  • c29f8d6cc5 Migrating to static memory to avoid malloc for new files. Let's see how it works. Pol Henarejos 2022-02-23 12:00:34 +01:00
  • 41b1467ab7 Fix with empty extended length header. Fix buffer overflow when extended length. APDU shall be reset at every APDU beginning. Pol Henarejos 2022-02-23 12:00:04 +01:00
  • 16bd415fb9 Adding sanity checks. Pol Henarejos 2022-02-22 18:26:02 +01:00
  • 173d64dd0e Finalizing EC key generation and storage. Pol Henarejos 2022-02-22 15:36:32 +01:00
  • 67698eca94 Fixed bug with size of cvc. Pol Henarejos 2022-02-22 14:27:13 +01:00
  • f97555a8da Adding ECC storing keygen. Pol Henarejos 2022-02-22 13:22:09 +01:00
  • a28f217c57 Inner signature of CVC encodes the full certificate body. Pol Henarejos 2022-02-22 00:55:36 +01:00
  • e1126b5951 In order to announce the public key, the response must be cvc request authenticated. Pol Henarejos 2022-02-22 00:37:02 +01:00
  • 1688ea540e Fix: FPI containing wrong file length. Pol Henarejos 2022-02-21 16:24:47 +01:00
  • 2a770ee7c9 DKEKS are also initialized. Pol Henarejos 2022-02-21 16:24:32 +01:00
  • 0ef2ee40ac Adding update_ef command. Flash is reset when initialize Pol Henarejos 2022-02-21 16:06:09 +01:00
  • d4e4cbbb0a Adding initialize commands. Pol Henarejos 2022-02-21 16:05:32 +01:00
  • 87a47c626b Fix with extended LE. Pol Henarejos 2022-02-21 13:26:30 +01:00
  • 4e3b43ec35 Adding storage of PRKD and CD. Pol Henarejos 2022-02-21 12:21:16 +01:00
  • d32620710e Adding file chains for CC, CE and CD. Pol Henarejos 2022-02-21 12:20:39 +01:00
  • fe429bf5af Adding signature to public file. Storing private key in disk. Pol Henarejos 2022-02-21 00:27:53 +01:00
  • ecfeb63273 Storing private keys as only P and Q for RSA. They are converted on the fly upon a request. Pol Henarejos 2022-02-20 20:05:46 +01:00
  • e620b891e1 Adding RSA response (unfinished). Adding ECC generation (no response yet). Pol Henarejos 2022-02-20 01:59:48 +01:00
  • d904e55aba Updating CVCA Pol Henarejos 2022-02-20 01:58:56 +01:00
  • 0ae8733d9b Adding keypair generation. At this moment, only RSA works but without any security check. Pol Henarejos 2022-02-19 02:16:29 +01:00
  • 67ac86f97d Fix with endianness and search by path name. Pol Henarejos 2022-02-18 16:42:59 +01:00
  • d6e7fc7cce Adding PIN login. Pol Henarejos 2022-02-18 16:19:54 +01:00
  • eaa0265f74 Adding import dkek shares. Pol Henarejos 2022-02-18 15:46:46 +01:00
  • e59c0d08c4 Adding initialization. - PINs are never stored, neither in flash nor in RAM. - PINs are stored in flash in doubled salted way. - PINs are stored in RAM in single salted way. - SOPIN in RAM (single salted) is used to encrypt/decrypt DKEK. - PINs in RAM (single salted) are used to encrypt/decrypt private keys related with user/so pins. - DKEK is only used to export/import data. Pol Henarejos 2022-02-18 13:28:41 +01:00
  • 0fa7f4cd54 Added DKEK file. Pol Henarejos 2022-02-18 13:25:32 +01:00
  • 4bb756b17c Fix when clearing file. It was omitting fid field and thus causing misalignment and corruption data. Pol Henarejos 2022-02-18 13:25:19 +01:00
  • 1630c7b52d Adding unique_id variable. Pol Henarejos 2022-02-18 10:39:03 +01:00
  • 633f005efd Adding INS_CHALLENGE for DKEK generation. Pol Henarejos 2022-02-17 19:50:12 +01:00
  • 4ccc457fab Using mbedtls tag v3.1.0 Pol Henarejos 2022-02-17 19:46:02 +01:00
  • f7553a0a75 Fix bug of not refilling after random bytes are requested. Pol Henarejos 2022-02-17 19:45:23 +01:00
  • c2733e8977 Using files from mbedtls submodule Pol Henarejos 2022-02-17 19:17:24 +01:00
  • 34a0027e78 Not used as they are pulled from submodule Pol Henarejos 2022-02-17 19:16:55 +01:00
  • 71cf36bbe1 Adding mbedtls submodule Pol Henarejos 2022-02-17 19:03:27 +01:00
  • ad28c3721a Not used Pol Henarejos 2022-02-17 19:00:59 +01:00
  • c8325babb2 Fixed pin reset Pol Henarejos 2022-02-14 00:29:04 +01:00
  • 86cef892ff Adding PIN reset counter. Pol Henarejos 2022-02-13 18:27:49 +01:00
  • 7e5352940b Moving submodule to patches branch. Pol Henarejos 2022-02-13 17:21:00 +01:00
  • 6b86e5dadd Adding max retries EF Pol Henarejos 2022-02-13 17:12:03 +01:00
  • f91c60efa2 Setting tag Pol Henarejos 2022-02-13 01:20:14 +01:00
  • e3e7221d09 Adding OpenSC submodule. Pol Henarejos 2022-02-13 01:18:52 +01:00
  • 0017284103 Starting migration from gnuk to own solution. gnuk/openpgp will be left as another pkcs15 app. Lots of work has been done in the meanwhile. Pol Henarejos 2022-02-13 01:17:14 +01:00
  • 210fa98ca4 Added scan procedure to load fixed files (i.e., pins) from flash memory. Pol Henarejos 2022-02-07 11:15:20 +01:00
  • bb5da16da6 Removing stuff with old read/write. Currently OPENPGP does not work and it won't until we finish the migration. Pol Henarejos 2022-02-07 11:14:33 +01:00
  • 0c43939de2 Fixed lots of write/read stuff. Pol Henarejos 2022-02-07 11:13:37 +01:00
  • badb1780c6 Added read procedures to take values from the cache. Fixed lockcout bug. Added wait_to_finish procedure, which blocks until all cache is written into the ram. Pol Henarejos 2022-02-07 11:13:13 +01:00
  • 565b61926a Merge branch 'gnuk' into main Pol Henarejos 2022-02-05 14:21:20 +01:00
  • 39c7a6f12a Some other not compiling changes Pol Henarejos 2022-02-05 10:27:12 +01:00
  • 222471acb1 We also include the fid into flash files. Pol Henarejos 2022-02-05 01:54:38 +01:00
  • 30a517908c Rewrite flash from scratch. We are migrating to a file system approach. Pol Henarejos 2022-02-05 01:31:24 +01:00
  • 565f64bcbe Added TokenInfo file. Generate PKCS15_TokenInfo structure with make_pkcs15_to_der script Added applet selection. Pol Henarejos 2022-02-04 00:29:30 +01:00
  • f7adf39f81 Added support for ACL Added support for READ BINARY (B0 and B1) Pol Henarejos 2022-02-03 15:35:49 +01:00
  • af1280ca0b Fix with extended APDU Pol Henarejos 2022-02-03 15:35:09 +01:00
  • 9e5a8b0f0f Adding additional messages. Pol Henarejos 2022-02-03 11:27:20 +01:00
  • df1f81c61c Adding ISO 7816 select procedure. Pol Henarejos 2022-02-03 11:27:10 +01:00
  • f7c2c0afaa Adding support for extended APDU. Added SC-HSM ATR Pol Henarejos 2022-02-03 11:26:31 +01:00
  • f262391d62 Adding some big endian uint16_t functions Pol Henarejos 2022-02-03 11:26:05 +01:00
  • 08e6e2d2dd Return when a write fails Pol Henarejos 2022-02-03 11:25:40 +01:00
  • 756d9a3d5b Migrating from PolarSSL to MBEDTLS 3.1 (formerly PolarSSL). Pol Henarejos 2022-01-24 18:14:42 +01:00
  • 62beedfccc - Fix with obtaining random number - Making optional the argument of f_rng Pol Henarejos 2022-01-24 18:11:20 +01:00
  • d9697003a3 Better debug of gnuk stuff Pol Henarejos 2022-01-24 18:07:41 +01:00
  • fcfe24b089 Fix erase sector. Pol Henarejos 2022-01-24 18:04:56 +01:00
  • 937517258e Fix flash size pages Pol Henarejos 2022-01-24 18:02:30 +01:00