mirror of
https://github.com/polhenarejos/pico-fido.git
synced 2025-12-19 02:48:04 +08:00
Adding REGISTER support. NOT WORKING.
It is preliminary. It does not work. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -30,6 +30,7 @@ add_executable(pico_fido)
|
|||||||
|
|
||||||
target_sources(pico_fido PUBLIC
|
target_sources(pico_fido PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/fido/fido.c
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/fido.c
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cmd_register.c
|
||||||
)
|
)
|
||||||
set(HSM_DRIVER "hid")
|
set(HSM_DRIVER "hid")
|
||||||
include(pico-hsm-sdk/pico_hsm_sdk_import.cmake)
|
include(pico-hsm-sdk/pico_hsm_sdk_import.cmake)
|
||||||
|
|||||||
24
src/fido/cmd_register.c
Normal file
24
src/fido/cmd_register.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Pico FIDO distribution (https://github.com/polhenarejos/pico-fido).
|
||||||
|
* Copyright (c) 2022 Pol Henarejos.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "fido.h"
|
||||||
|
#include "hsm.h"
|
||||||
|
#include "apdu.h"
|
||||||
|
|
||||||
|
int cmd_register() {
|
||||||
|
return SW_OK();
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "fido.h"
|
#include "fido.h"
|
||||||
#include "hsm.h"
|
#include "hsm.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
|
#include "u2f.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void init_fido();
|
void init_fido();
|
||||||
@@ -56,8 +57,11 @@ typedef struct cmd
|
|||||||
int (*cmd_handler)();
|
int (*cmd_handler)();
|
||||||
} cmd_t;
|
} cmd_t;
|
||||||
|
|
||||||
|
extern int cmd_register();
|
||||||
|
|
||||||
static const cmd_t cmds[] = {
|
static const cmd_t cmds[] = {
|
||||||
{ 0x00, 0x0}
|
{ U2F_REGISTER, cmd_register },
|
||||||
|
{ 0x00, 0x0}
|
||||||
};
|
};
|
||||||
|
|
||||||
int fido_process_apdu() {
|
int fido_process_apdu() {
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Pico FIDO distribution (https://github.com/polhenarejos/pico-fido).
|
||||||
|
* Copyright (c) 2022 Pol Henarejos.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _FIDO_H_
|
||||||
|
#define _FIDO_H_
|
||||||
|
|
||||||
|
#define U2F_PUBKEY_LEN 65
|
||||||
|
#define KEY_PATH_LEN 32
|
||||||
|
#define KEY_HANDLE_LEN (KEY_PATH_LEN + SHA256_DIGEST_LENGTH)
|
||||||
|
|
||||||
|
#endif //_FIDO_H
|
||||||
|
|||||||
Reference in New Issue
Block a user