mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
U2F keys on internal storage
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "u2f_data.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
static bool u2f_app_custom_event_callback(void* context, uint32_t event) {
|
||||
furi_assert(context);
|
||||
@@ -27,6 +28,11 @@ U2fApp* u2f_app_alloc() {
|
||||
app->gui = furi_record_open(RECORD_GUI);
|
||||
app->notifications = furi_record_open(RECORD_NOTIFICATION);
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
storage_common_copy(storage, U2F_CNT_OLD_FILE, U2F_CNT_FILE);
|
||||
storage_common_copy(storage, U2F_KEY_OLD_FILE, U2F_KEY_FILE);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
app->view_dispatcher = view_dispatcher_alloc();
|
||||
app->scene_manager = scene_manager_alloc(&u2f_scene_handlers, app);
|
||||
view_dispatcher_enable_queue(app->view_dispatcher);
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
#define TAG "U2F"
|
||||
|
||||
#define U2F_DATA_FOLDER ANY_PATH("u2f/")
|
||||
#define U2F_CERT_FILE U2F_DATA_FOLDER "assets/cert.der"
|
||||
#define U2F_CERT_KEY_FILE U2F_DATA_FOLDER "assets/cert_key.u2f"
|
||||
#define U2F_KEY_FILE U2F_DATA_FOLDER "key.u2f"
|
||||
#define U2F_CNT_FILE U2F_DATA_FOLDER "cnt.u2f"
|
||||
|
||||
#define U2F_DATA_FILE_ENCRYPTION_KEY_SLOT_FACTORY 2
|
||||
#define U2F_DATA_FILE_ENCRYPTION_KEY_SLOT_UNIQUE 11
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@ extern "C" {
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#define U2F_DATA_FOLDER EXT_PATH("u2f/")
|
||||
#define U2F_CERT_FILE U2F_DATA_FOLDER "assets/cert.der"
|
||||
#define U2F_CERT_KEY_FILE U2F_DATA_FOLDER "assets/cert_key.u2f"
|
||||
#define U2F_KEY_OLD_FILE U2F_DATA_FOLDER "key.u2f"
|
||||
#define U2F_CNT_OLD_FILE U2F_DATA_FOLDER "cnt.u2f"
|
||||
#define U2F_KEY_FILE INT_PATH(".key.u2f")
|
||||
#define U2F_CNT_FILE INT_PATH(".cnt.u2f")
|
||||
|
||||
bool u2f_data_check(bool cert_only);
|
||||
|
||||
bool u2f_data_cert_check();
|
||||
|
||||
Reference in New Issue
Block a user