mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
fido2/ctap: uncrustify files
This commit is contained in:
parent
37c35112e2
commit
aa22771bd9
@ -406,7 +406,8 @@ size_t fido2_ctap_reset(ctap_resp_t *resp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t get_id(void) {
|
static uint32_t get_id(void)
|
||||||
|
{
|
||||||
return _state.id_cnt++;
|
return _state.id_cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,8 +477,8 @@ static int _make_credential(ctap_req_t *req_raw)
|
|||||||
|
|
||||||
if (req.exclude_list_len > 0) {
|
if (req.exclude_list_len > 0) {
|
||||||
if (_find_matching_rks(_assert_state.rks, CTAP_MAX_EXCLUDE_LIST_SIZE,
|
if (_find_matching_rks(_assert_state.rks, CTAP_MAX_EXCLUDE_LIST_SIZE,
|
||||||
req.exclude_list, req.exclude_list_len, req.rp.id,
|
req.exclude_list, req.exclude_list_len, req.rp.id,
|
||||||
req.rp.id_len) > 0x0) {
|
req.rp.id_len) > 0x0) {
|
||||||
if (!IS_ACTIVE(CONFIG_FIDO2_CTAP_DISABLE_UP)) {
|
if (!IS_ACTIVE(CONFIG_FIDO2_CTAP_DISABLE_UP)) {
|
||||||
fido2_ctap_utils_user_presence_test();
|
fido2_ctap_utils_user_presence_test();
|
||||||
}
|
}
|
||||||
@ -1400,6 +1401,7 @@ static int _find_matching_rks(ctap_resident_key_t *rks, size_t rks_len,
|
|||||||
|
|
||||||
ctap_resident_key_t rk = { 0 };
|
ctap_resident_key_t rk = { 0 };
|
||||||
uint32_t addr = 0x0;
|
uint32_t addr = 0x0;
|
||||||
|
|
||||||
while (fido2_ctap_mem_read_rk_from_flash(&rk, rp_id_hash, &addr) == CTAP2_OK) {
|
while (fido2_ctap_mem_read_rk_from_flash(&rk, rp_id_hash, &addr) == CTAP2_OK) {
|
||||||
if (allow_list_len == 0) {
|
if (allow_list_len == 0) {
|
||||||
memcpy(&rks[index], &rk, sizeof(rk));
|
memcpy(&rks[index], &rk, sizeof(rk));
|
||||||
@ -1698,4 +1700,4 @@ int fido2_ctap_get_sig(const uint8_t *auth_data, size_t auth_data_len,
|
|||||||
return fido2_ctap_crypto_get_sig(hash, sizeof(hash), sig, sig_len,
|
return fido2_ctap_crypto_get_sig(hash, sizeof(hash), sig, sig_len,
|
||||||
rk->priv_key,
|
rk->priv_key,
|
||||||
sizeof(rk->priv_key));
|
sizeof(rk->priv_key));
|
||||||
}
|
}
|
||||||
|
@ -146,9 +146,9 @@ int fido2_ctap_mem_erase_flash(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CTAP state information is stored at flashpage 0 of the memory area
|
* CTAP state information is stored at flashpage 0 of the memory area
|
||||||
* dedicated for storing CTAP data
|
* dedicated for storing CTAP data
|
||||||
*/
|
*/
|
||||||
int fido2_ctap_mem_read_state_from_flash(ctap_state_t *state)
|
int fido2_ctap_mem_read_state_from_flash(ctap_state_t *state)
|
||||||
{
|
{
|
||||||
uint32_t addr = (uint32_t)flashpage_addr(_flash_start());
|
uint32_t addr = (uint32_t)flashpage_addr(_flash_start());
|
||||||
@ -176,7 +176,7 @@ int fido2_ctap_mem_write_rk_to_flash(ctap_resident_key_t *rk)
|
|||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DEBUG("%s, %d: mtd_read failed", RIOT_FILE_RELATIVE,
|
DEBUG("%s, %d: mtd_read failed", RIOT_FILE_RELATIVE,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,6 +216,7 @@ int fido2_ctap_mem_read_rk_from_flash(ctap_resident_key_t *key, uint8_t *rp_id_h
|
|||||||
{
|
{
|
||||||
uint16_t end;
|
uint16_t end;
|
||||||
uint16_t amt_stored = fido2_ctap_get_state()->rk_amount_stored;
|
uint16_t amt_stored = fido2_ctap_get_state()->rk_amount_stored;
|
||||||
|
|
||||||
if (*addr == 0x0) {
|
if (*addr == 0x0) {
|
||||||
end = amt_stored;
|
end = amt_stored;
|
||||||
*addr = (uint32_t)flashpage_addr(_flash_start() + CTAP_FLASH_RK_OFF);
|
*addr = (uint32_t)flashpage_addr(_flash_start() + CTAP_FLASH_RK_OFF);
|
||||||
@ -236,7 +237,7 @@ int fido2_ctap_mem_read_rk_from_flash(ctap_resident_key_t *key, uint8_t *rp_id_h
|
|||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DEBUG("%s, %d: mtd_read failed", RIOT_FILE_RELATIVE,
|
DEBUG("%s, %d: mtd_read failed", RIOT_FILE_RELATIVE,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
return CTAP1_ERR_OTHER;
|
return CTAP1_ERR_OTHER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define CTAP_MAKE_CREDENTIAL 0x01 /**< authenticatorMakeCredential method */
|
#define CTAP_MAKE_CREDENTIAL 0x01 /**< authenticatorMakeCredential method */
|
||||||
#define CTAP_GET_ASSERTION 0x02 /**< authenticatorGetAssertion method */
|
#define CTAP_GET_ASSERTION 0x02 /**< authenticatorGetAssertion method */
|
||||||
#define CTAP_GET_INFO 0x04 /**< authenticatorGetInfo method */
|
#define CTAP_GET_INFO 0x04 /**< authenticatorGetInfo method */
|
||||||
#define CTAP_CLIENT_PIN 0x06 /**< authenticatorClientPIN method */
|
#define CTAP_CLIENT_PIN 0x06 /**< authenticatorClientPIN method */
|
||||||
#define CTAP_RESET 0x07 /**< authenticatorReset method */
|
#define CTAP_RESET 0x07 /**< authenticatorReset method */
|
||||||
#define CTAP_GET_NEXT_ASSERTION 0x08 /**< authenticatorGetNextAssertion method */
|
#define CTAP_GET_NEXT_ASSERTION 0x08 /**< authenticatorGetNextAssertion method */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,9 +79,9 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define CTAP_VERSION_FLAG_FIDO_PRE 0x01 /**< FIDO 2.1 flag */
|
#define CTAP_VERSION_FLAG_FIDO_PRE 0x01 /**< FIDO 2.1 flag */
|
||||||
#define CTAP_VERSION_FLAG_FIDO 0x02 /**< FIDO 2 flag */
|
#define CTAP_VERSION_FLAG_FIDO 0x02 /**< FIDO 2 flag */
|
||||||
#define CTAP_VERSION_FLAG_U2F_V2 0x04 /**< U2F V2 flag */
|
#define CTAP_VERSION_FLAG_U2F_V2 0x04 /**< U2F V2 flag */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,11 +103,11 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define CTAP_INFO_OPTIONS_FLAG_PLAT (1 << 0) /**< platform device flag */
|
#define CTAP_INFO_OPTIONS_FLAG_PLAT (1 << 0) /**< platform device flag */
|
||||||
#define CTAP_INFO_OPTIONS_FLAG_RK (1 << 1) /**< resident key flag */
|
#define CTAP_INFO_OPTIONS_FLAG_RK (1 << 1) /**< resident key flag */
|
||||||
#define CTAP_INFO_OPTIONS_FLAG_CLIENT_PIN (1 << 2) /**< clientPIN flag */
|
#define CTAP_INFO_OPTIONS_FLAG_CLIENT_PIN (1 << 2) /**< clientPIN flag */
|
||||||
#define CTAP_INFO_OPTIONS_FLAG_UP (1 << 3) /**< user presence flag */
|
#define CTAP_INFO_OPTIONS_FLAG_UP (1 << 3) /**< user presence flag */
|
||||||
#define CTAP_INFO_OPTIONS_FLAG_UV (1 << 4) /**< user verification flag */
|
#define CTAP_INFO_OPTIONS_FLAG_UV (1 << 4) /**< user verification flag */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,11 +115,11 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define CTAP_CP_REQ_SUB_COMMAND_GET_RETRIES 0x01 /**< getRetries subCommand */
|
#define CTAP_CP_REQ_SUB_COMMAND_GET_RETRIES 0x01 /**< getRetries subCommand */
|
||||||
#define CTAP_CP_REQ_SUB_COMMAND_GET_KEY_AGREEMENT 0x02 /**< getKeyAgreement subCommand */
|
#define CTAP_CP_REQ_SUB_COMMAND_GET_KEY_AGREEMENT 0x02 /**< getKeyAgreement subCommand */
|
||||||
#define CTAP_CP_REQ_SUB_COMMAND_SET_PIN 0x03 /**< setPIN subCommand */
|
#define CTAP_CP_REQ_SUB_COMMAND_SET_PIN 0x03 /**< setPIN subCommand */
|
||||||
#define CTAP_CP_REQ_SUB_COMMAND_CHANGE_PIN 0x04 /**< changePIN subCommand */
|
#define CTAP_CP_REQ_SUB_COMMAND_CHANGE_PIN 0x04 /**< changePIN subCommand */
|
||||||
#define CTAP_CP_REQ_SUB_COMMAND_GET_PIN_TOKEN 0x05 /**< getPinToken subCommand */
|
#define CTAP_CP_REQ_SUB_COMMAND_GET_PIN_TOKEN 0x05 /**< getPinToken subCommand */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +155,8 @@ int fido2_ctap_mem_write_state_to_flash(ctap_state_t *state);
|
|||||||
*
|
*
|
||||||
* @return @ref ctap_status_codes_t
|
* @return @ref ctap_status_codes_t
|
||||||
*/
|
*/
|
||||||
int fido2_ctap_mem_read_rk_from_flash(ctap_resident_key_t *key, uint8_t *rp_id_hash, uint32_t *addr);
|
int fido2_ctap_mem_read_rk_from_flash(ctap_resident_key_t *key, uint8_t *rp_id_hash,
|
||||||
|
uint32_t *addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write resident credential to flash
|
* @brief Write resident credential to flash
|
||||||
|
Loading…
Reference in New Issue
Block a user