mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 00:49:45 +01:00
sys/fido2: Small fix to dependencies && cleanup
This commit is contained in:
parent
7e0a86ba32
commit
db95ef6f10
@ -28,4 +28,5 @@ endif
|
|||||||
USEMODULE += crypto_aes_256
|
USEMODULE += crypto_aes_256
|
||||||
USEMODULE += hashes
|
USEMODULE += hashes
|
||||||
USEMODULE += fido2
|
USEMODULE += fido2
|
||||||
|
USEMODULE += fmt
|
||||||
endif
|
endif
|
||||||
|
@ -921,7 +921,6 @@ static int _get_key_agreement(void)
|
|||||||
int ret;
|
int ret;
|
||||||
ctap_public_key_cose_t key = { 0 };
|
ctap_public_key_cose_t key = { 0 };
|
||||||
|
|
||||||
|
|
||||||
/* generate key agreement key */
|
/* generate key agreement key */
|
||||||
ret =
|
ret =
|
||||||
fido2_ctap_crypto_gen_keypair(&_state.ag_key.pub, _state.ag_key.priv,
|
fido2_ctap_crypto_gen_keypair(&_state.ag_key.pub, _state.ag_key.priv,
|
||||||
|
@ -107,14 +107,16 @@ static ctap_status_code_t _parse_int(CborValue *it, int *num);
|
|||||||
/**
|
/**
|
||||||
* @brief Parse credential description
|
* @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
|
* @brief Encode public key into COSE_KEY format
|
||||||
*
|
*
|
||||||
* See https://tools.ietf.org/html/rfc8152#page-34 Section 13.1.1 for details.
|
* 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
|
* @brief Encode PublicKeyCredentialDescriptor into CBOR format
|
||||||
@ -743,7 +745,8 @@ static ctap_status_code_t _encode_user_entity(CborEncoder *encoder,
|
|||||||
return CTAP2_OK;
|
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;
|
int ret;
|
||||||
CborEncoder map;
|
CborEncoder map;
|
||||||
@ -1620,7 +1623,8 @@ static ctap_status_code_t _parse_exclude_list(CborValue *it, ctap_cred_desc_alt_
|
|||||||
return CTAP2_OK;
|
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 ret;
|
||||||
int type;
|
int type;
|
||||||
|
@ -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
|
* wrapper for @ref fido2_ctap_crypto_prng
|
||||||
*/
|
*/
|
||||||
static int _RNG(uint8_t *dest, unsigned size);
|
|
||||||
|
|
||||||
static int _RNG(uint8_t *dest, unsigned size)
|
static int _RNG(uint8_t *dest, unsigned size)
|
||||||
{
|
{
|
||||||
fido2_ctap_crypto_prng(dest, (size_t)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;
|
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);
|
sha256_update(ctx, data, len);
|
||||||
return CTAP2_OK;
|
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;
|
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);
|
hmac_sha256_update(ctx, data, len);
|
||||||
return CTAP2_OK;
|
return CTAP2_OK;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#ifdef BOARD_NATIVE
|
#ifdef BOARD_NATIVE
|
||||||
#include "mtd_default.h"
|
#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;
|
char *_backing_memory = NULL;
|
||||||
static mtd_dev_t *_mtd_dev = NULL;
|
static mtd_dev_t *_mtd_dev = NULL;
|
||||||
#else
|
#else
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
include ../Makefile.tests_common
|
BOARD ?= native
|
||||||
|
|
||||||
|
include ../Makefile.sys_common
|
||||||
|
|
||||||
|
BOARD_WHITELIST = \
|
||||||
|
native \
|
||||||
|
nrf52840dk \
|
||||||
|
nrf52840dongle
|
||||||
|
|
||||||
# same as CTAP_STACKSIZE
|
# same as CTAP_STACKSIZE
|
||||||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=15000
|
CFLAGS += -DTHREAD_STACKSIZE_MAIN=15000
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
BOARD ?= nrf52840dk
|
BOARD ?= nrf52840dk
|
||||||
#BOARD ?= nrf52840dongle
|
#BOARD ?= nrf52840dongle
|
||||||
|
|
||||||
include ../Makefile.tests_common
|
include ../Makefile.sys_common
|
||||||
|
|
||||||
|
BOARD_WHITELIST = \
|
||||||
|
nrf52840dk \
|
||||||
|
nrf52840dongle
|
||||||
|
|
||||||
USEMODULE += fido2_ctap_transport_hid
|
USEMODULE += fido2_ctap_transport_hid
|
||||||
USEPKG += fido2_tests
|
USEPKG += fido2_tests
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include "xtimer.h"
|
#include "ztimer.h"
|
||||||
|
|
||||||
#include "fido2/ctap/transport/ctap_transport.h"
|
#include "fido2/ctap/transport/ctap_transport.h"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* sleep in order to see early DEBUG outputs */
|
/* sleep in order to see early DEBUG outputs */
|
||||||
xtimer_sleep(3);
|
ztimer_sleep(ZTIMER_MSEC, 3000);
|
||||||
fido2_ctap_transport_init();
|
fido2_ctap_transport_init();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user