Commit Graph

34 Commits

Author SHA1 Message Date
Pol Henarejos
8f14db677e Fix strange bug when usb cannot write.
In this case, the buffer is kept until the next success call.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-29 23:11:49 +02:00
Pol Henarejos
d0fe447416 Fix PING with no data.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-29 16:59:30 +02:00
Pol Henarejos
2aff75a3ec Fix keepalive msg.
Only sent when CBOR is initiatied.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-27 22:09:16 +02:00
Pol Henarejos
3912775ccb Fix writting large packets.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-27 12:23:16 +02:00
Pol Henarejos
18fa1d7f37 Reseting previous command if new arrives.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-25 18:09:37 +02:00
Pol Henarejos
f8590ba8c7 Added CTAPHID_CANCEL support.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-23 18:07:27 +02:00
Pol Henarejos
4d7101b802 Fix send_keepalive with auxiliary buffer.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 23:53:55 +02:00
Pol Henarejos
988d4e23c2 Fix combining APDU MSG and keepalive.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 22:52:41 +02:00
Pol Henarejos
c23f17107a Random functions shall be called for each core, otherwise it will hung.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 20:18:05 +02:00
Pol Henarejos
e29521fcf6 Multiple bug fixes to pass HID tests.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 19:23:39 +02:00
Pol Henarejos
4ab68cc822 HID fixes.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-22 14:05:39 +02:00
Pol Henarejos
5a4aff7008 Adding KEEP_ALIVE response.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-20 15:31:34 +02:00
Pol Henarejos
8b97791d8f Reorganizing core0/core1 split.
Now CBOR and APDU (i.e., intensive processing) areas are executed on core1, while core0 is dedicated for hardware tasks (usb, button, led, etc.).
2022-09-20 14:39:59 +02:00
Pol Henarejos
847005d94f Adding support for clientPIN.
It does not pass the tests yet.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-19 17:20:52 +02:00
Pol Henarejos
4c49e59edc Major CTAP refactoring.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-15 14:16:40 +02:00
Pol Henarejos
42f3c67c61 Adding Credentials structure.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-14 17:27:00 +02:00
Pol Henarejos
607f7c50d4 Adding some macros for CBOR parsing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-14 00:08:05 +02:00
Pol Henarejos
2cb59d57d2 Adding first attempt of adding make_credential.
It requires lot of efforts to parse CBOR incoming data.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-13 20:37:15 +02:00
Pol Henarejos
d1530733a2 Lots of fixes with CBOR encoding cbor_get_info().
- Numeric fields shall be encoded with uint and NOT with simple, despite are < 24.
- maxCredentialCountInList and maxCredentialIdLength only accept uint values.
- up shall not be present (assumed True always).
- Also added cbor_reset(). It does nothing but ok.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-12 00:50:38 +02:00
Pol Henarejos
4a1bddb3d5 Adding cbor_get_info().
This is the first funciont that uses TinyCBOR to encode the cbor message.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-09 20:35:11 +02:00
Pol Henarejos
abd52c34ba Added CBOR processing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 20:37:21 +02:00
Pol Henarejos
7aeac46eef Adding CTAP2 commands.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 17:49:56 +02:00
Pol Henarejos
867d4637ee Moving from U2F to CTAP1.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 17:35:40 +02:00
Pol Henarejos
7491021102 Fix initializing variables.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 16:38:13 +02:00
Pol Henarejos
799733203b Added SYNC command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 13:24:03 +02:00
Pol Henarejos
0be497e713 Added LOCK command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 13:12:17 +02:00
Pol Henarejos
e23dead31d Add PING command.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 12:56:32 +02:00
Pol Henarejos
4d9faccedb Added some sanity checks.
Also fix u2f_error report.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-08 12:13:34 +02:00
Pol Henarejos
c0123aa669 Adding blink in 1 second on WINK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-06 16:09:02 +02:00
Pol Henarejos
43dfb0cde5 Fix APDU processing for small packets.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-05 17:30:05 +02:00
Pol Henarejos
f14cc8dba5 Clearing tx buffer for every transmission.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-05 16:47:07 +02:00
Pol Henarejos
16a1981dc3 When a packet > 57 bytes is sent, it must be chunked.
Once the packet is sent, a callback is triggered to send the next chunk.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-09-05 11:29:04 +02:00
Pol Henarejos
214ec2b9ae Adding support for U2F_MSG 2022-09-02 18:02:31 +02:00
Pol Henarejos
40288a85f1 It's a major reorganization.
In order to add FIDO2 support, we need to reorganize some USB/CCID calls to specific area (named driver).
Thus, pico-hsm-sdk has two drivers:
- CCID driver implements APDU over USB/CCID ISO-7816 standard procedures.
- HID driver implements APDU over HID.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-08-30 02:00:11 +02:00