diff --git a/fido2/device.h b/fido2/device.h index c1e391c..b85deee 100644 --- a/fido2/device.h +++ b/fido2/device.h @@ -9,12 +9,9 @@ #include "storage.h" -void device_init(int argc, char *argv[]); uint32_t millis(); -void delay(uint32_t ms); - // HID message size in bytes #define HID_MESSAGE_SIZE 64 @@ -26,9 +23,6 @@ void usbhid_send(uint8_t * msg); void usbhid_close(); -void main_loop_delay(); - -void heartbeat(); void device_reboot(); @@ -42,8 +36,7 @@ int authenticator_is_backup_initialized(); void authenticator_write_state(AuthenticatorState *, int backup); -// Called each main loop. Doesn't need to do anything. -void device_manage(); + // sets status that's uses for sending status updates ~100ms. // A timer should be set up to call `ctaphid_update_status` @@ -64,14 +57,6 @@ int ctap_generate_rng(uint8_t * dst, size_t num); // @param amount the amount to increase the counter by. uint32_t ctap_atomic_count(uint32_t amount); -// Verify the user -// return 1 if user is verified, 0 if not -int ctap_user_verification(uint8_t arg); - -// Must be implemented by application -// data is HID_MESSAGE_SIZE long in bytes -void ctaphid_write_block(uint8_t * data); - // Resident key void ctap_reset_rk(); @@ -80,9 +65,7 @@ void ctap_store_rk(int index,CTAP_residentKey * rk); void ctap_load_rk(int index,CTAP_residentKey * rk); void ctap_overwrite_rk(int index,CTAP_residentKey * rk); -// For Solo hacker -void boot_solo_bootloader(); -void boot_st_bootloader(); + // HID wink command void device_wink(); @@ -108,7 +91,6 @@ int device_is_nfc(); void device_disable_up(bool request_active); -void device_init_button(); /** Return pointer to attestation key. */ diff --git a/pc/main.c b/pc/main.c index fafc960..07a0bce 100644 --- a/pc/main.c +++ b/pc/main.c @@ -20,8 +20,8 @@ #include "ctap.h" #include "app.h" -#if !defined(TEST) +void device_init(int argc, char *argv[]); int main(int argc, char *argv[]) { @@ -82,5 +82,3 @@ int main(int argc, char *argv[]) printf1(TAG_GREEN, "done\n"); return 0; } - -#endif diff --git a/targets/stm32l432/src/app.h b/targets/stm32l432/src/app.h index ecda68b..fa3d380 100644 --- a/targets/stm32l432/src/app.h +++ b/targets/stm32l432/src/app.h @@ -8,6 +8,7 @@ #define _APP_H_ #include #include "version.h" +#include "solo.h" #define SOLO diff --git a/targets/stm32l432/src/device.c b/targets/stm32l432/src/device.c index d2525c6..5d83bac 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -285,7 +285,7 @@ static void device_migrate(){ } } -void device_init(int argc, char *argv[]) +void device_init() { hw_init(LOW_FREQUENCY); diff --git a/targets/stm32l432/src/solo.h b/targets/stm32l432/src/solo.h new file mode 100644 index 0000000..6ce8e22 --- /dev/null +++ b/targets/stm32l432/src/solo.h @@ -0,0 +1,22 @@ +#ifndef _SOLO_H_ +#define _SOLO_H_ + +void device_init(); + +void main_loop_delay(); + +void heartbeat(); + +// Called each main loop. Doesn't need to do anything. +void device_manage(); + +void device_init_button(); + +// For Solo hacker +void boot_solo_bootloader(); +void boot_st_bootloader(); + + +void delay(uint32_t ms); + +#endif