[FL-2226] BadUSB, U2F: missing assets error (#979)

* badusb, u2f: showing error screen if assets are missing
* BadUsb: remove dead code
* U2F: remove dead code

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-02-02 17:27:33 +03:00
committed by GitHub
parent 0acea5b25f
commit d2c4f15af5
12 changed files with 182 additions and 5 deletions

View File

@@ -38,6 +38,26 @@ typedef struct {
uint32_t control;
} __attribute__((packed)) U2fCounterData;
bool u2f_data_check() {
bool state = false;
Storage* fs_api = furi_record_open("storage");
File* file = storage_file_alloc(fs_api);
if(storage_file_open(file, U2F_CERT_FILE, FSAM_READ, FSOM_OPEN_EXISTING)) {
storage_file_close(file);
if(storage_file_open(file, U2F_CERT_KEY_FILE, FSAM_READ, FSOM_OPEN_EXISTING)) {
state = true;
}
}
storage_file_close(file);
storage_file_free(file);
furi_record_close("storage");
return state;
}
bool u2f_data_cert_check() {
bool state = false;
Storage* fs_api = furi_record_open("storage");