diff --git a/sys/fido2/Makefile.dep b/sys/fido2/Makefile.dep index 7830b7e6f3..9f447ef7e1 100644 --- a/sys/fido2/Makefile.dep +++ b/sys/fido2/Makefile.dep @@ -28,4 +28,5 @@ endif USEMODULE += crypto_aes_256 USEMODULE += hashes USEMODULE += fido2 + USEMODULE += fmt endif diff --git a/sys/fido2/ctap/ctap.c b/sys/fido2/ctap/ctap.c index f64c118ef3..55a61b8eff 100644 --- a/sys/fido2/ctap/ctap.c +++ b/sys/fido2/ctap/ctap.c @@ -921,7 +921,6 @@ static int _get_key_agreement(void) int ret; ctap_public_key_cose_t key = { 0 }; - /* generate key agreement key */ ret = fido2_ctap_crypto_gen_keypair(&_state.ag_key.pub, _state.ag_key.priv, diff --git a/sys/fido2/ctap/ctap_cbor.c b/sys/fido2/ctap/ctap_cbor.c index 540889e300..b1b5b223aa 100644 --- a/sys/fido2/ctap/ctap_cbor.c +++ b/sys/fido2/ctap/ctap_cbor.c @@ -107,14 +107,16 @@ static ctap_status_code_t _parse_int(CborValue *it, int *num); /** * @brief Parse credential description */ -static ctap_status_code_t _fido2_ctap_cbor_parse_cred_desc(CborValue *arr, ctap_cred_desc_alt_t *cred); +static ctap_status_code_t _fido2_ctap_cbor_parse_cred_desc(CborValue *arr, + ctap_cred_desc_alt_t *cred); /** * @brief Encode public key into COSE_KEY format * * See https://tools.ietf.org/html/rfc8152#page-34 Section 13.1.1 for details. */ -static ctap_status_code_t _encode_public_key_cose(CborEncoder *cose_key, const ctap_public_key_cose_t *key); +static ctap_status_code_t _encode_public_key_cose(CborEncoder *cose_key, + const ctap_public_key_cose_t *key); /** * @brief Encode PublicKeyCredentialDescriptor into CBOR format @@ -743,7 +745,8 @@ static ctap_status_code_t _encode_user_entity(CborEncoder *encoder, return CTAP2_OK; } -static ctap_status_code_t _encode_public_key_cose(CborEncoder *cose_key, const ctap_public_key_cose_t *key) +static ctap_status_code_t _encode_public_key_cose(CborEncoder *cose_key, + const ctap_public_key_cose_t *key) { int ret; CborEncoder map; @@ -1620,7 +1623,8 @@ static ctap_status_code_t _parse_exclude_list(CborValue *it, ctap_cred_desc_alt_ return CTAP2_OK; } -static ctap_status_code_t _fido2_ctap_cbor_parse_cred_desc(CborValue *arr, ctap_cred_desc_alt_t *cred) +static ctap_status_code_t _fido2_ctap_cbor_parse_cred_desc(CborValue *arr, + ctap_cred_desc_alt_t *cred) { int ret; int type; diff --git a/sys/fido2/ctap/ctap_crypto.c b/sys/fido2/ctap/ctap_crypto.c index 81cd9fdd94..0dba6eb76a 100644 --- a/sys/fido2/ctap/ctap_crypto.c +++ b/sys/fido2/ctap/ctap_crypto.c @@ -44,8 +44,6 @@ static ctap_status_code_t _sig_to_der_format(uint8_t *r, uint8_t *s, uint8_t *si * * wrapper for @ref fido2_ctap_crypto_prng */ -static int _RNG(uint8_t *dest, unsigned size); - static int _RNG(uint8_t *dest, unsigned size) { fido2_ctap_crypto_prng(dest, (size_t)size); @@ -71,7 +69,8 @@ ctap_status_code_t fido2_ctap_crypto_sha256_init(sha256_context_t *ctx) return CTAP2_OK; } -ctap_status_code_t fido2_ctap_crypto_sha256_update(sha256_context_t *ctx, const void *data, size_t len) +ctap_status_code_t fido2_ctap_crypto_sha256_update(sha256_context_t *ctx, + const void *data, size_t len) { sha256_update(ctx, data, len); return CTAP2_OK; @@ -97,7 +96,8 @@ ctap_status_code_t fido2_ctap_crypto_hmac_sha256_init(hmac_context_t *ctx, const return CTAP2_OK; } -ctap_status_code_t fido2_ctap_crypto_hmac_sha256_update(hmac_context_t *ctx, const void *data, size_t len) +ctap_status_code_t fido2_ctap_crypto_hmac_sha256_update(hmac_context_t *ctx, + const void *data, size_t len) { hmac_sha256_update(ctx, data, len); return CTAP2_OK; diff --git a/sys/fido2/ctap/ctap_mem.c b/sys/fido2/ctap/ctap_mem.c index cb4a00028a..629f7a669d 100644 --- a/sys/fido2/ctap/ctap_mem.c +++ b/sys/fido2/ctap/ctap_mem.c @@ -30,7 +30,7 @@ #ifdef BOARD_NATIVE #include "mtd_default.h" -// native mtd is file backed => Start address of flash is 0. +/* native mtd is file backed => Start address of flash is 0. */ char *_backing_memory = NULL; static mtd_dev_t *_mtd_dev = NULL; #else diff --git a/tests/sys/fido2_ctap/Makefile b/tests/sys/fido2_ctap/Makefile index 66a265adb2..9fd89cdf42 100644 --- a/tests/sys/fido2_ctap/Makefile +++ b/tests/sys/fido2_ctap/Makefile @@ -1,4 +1,11 @@ -include ../Makefile.tests_common +BOARD ?= native + +include ../Makefile.sys_common + +BOARD_WHITELIST = \ + native \ + nrf52840dk \ + nrf52840dongle # same as CTAP_STACKSIZE CFLAGS += -DTHREAD_STACKSIZE_MAIN=15000 diff --git a/tests/sys/fido2_ctap_hid/Makefile b/tests/sys/fido2_ctap_hid/Makefile index 51b1153a93..0b26274ee7 100644 --- a/tests/sys/fido2_ctap_hid/Makefile +++ b/tests/sys/fido2_ctap_hid/Makefile @@ -1,7 +1,11 @@ BOARD ?= nrf52840dk #BOARD ?= nrf52840dongle -include ../Makefile.tests_common +include ../Makefile.sys_common + +BOARD_WHITELIST = \ + nrf52840dk \ + nrf52840dongle USEMODULE += fido2_ctap_transport_hid USEPKG += fido2_tests diff --git a/tests/sys/fido2_ctap_hid/main.c b/tests/sys/fido2_ctap_hid/main.c index 4e09323388..95a30713eb 100644 --- a/tests/sys/fido2_ctap_hid/main.c +++ b/tests/sys/fido2_ctap_hid/main.c @@ -19,13 +19,13 @@ #define ENABLE_DEBUG (0) #include "debug.h" -#include "xtimer.h" +#include "ztimer.h" #include "fido2/ctap/transport/ctap_transport.h" int main(void) { /* sleep in order to see early DEBUG outputs */ - xtimer_sleep(3); + ztimer_sleep(ZTIMER_MSEC, 3000); fido2_ctap_transport_init(); }