Skip to content

Nickez/fix u2f safari #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@

# This makefile is used as a command runner and not for tracking dependencies between recipies

UNAME_S := $(shell uname -s)

.DEFAULT_GOAL := firmware
SANITIZE ?= ON
# asan/ubsan is not supported on darwin, default to off
ifeq ($(UNAME_S),Darwin)
SANITIZE ?= OFF
else
SANITIZE ?= ON
endif
simulator: SANITIZE = OFF

bootstrap:
Expand Down
7 changes: 7 additions & 0 deletions src/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include "screen.h"
#include "ui/screen_stack.h"

#if APP_U2F == 1
#include <u2f.h>
#endif

uint32_t __stack_chk_guard = 0;

int main(void)
Expand All @@ -36,6 +40,9 @@ int main(void)
qtouch_init();
common_main();
bitbox02_smarteeprom_init();
#if APP_U2F == 1
u2f_device_setup();
#endif
firmware_main_loop();
return 0;
}
7 changes: 7 additions & 0 deletions src/firmware_main_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ void firmware_main_loop(void)
}
if (!u2f_data) {
u2f_data = queue_pull(queue_u2f_queue());
// If USB stack was locked and there is no more messages to send out, time to
// unlock it.
if (!u2f_data && usb_processing_locked(usb_processing_u2f())) {
util_log("u2f unlock");
usb_processing_unlock();
}
}
#endif
// Only read new messages if we have nothing to send
Expand All @@ -67,6 +73,7 @@ void firmware_main_loop(void)
}
#if APP_U2F == 1
if (!u2f_data && hid_u2f_read(&u2f_frame[0])) {
util_log("u2f data %s", util_dbg_hex((void*)u2f_frame, 16));
u2f_packet_process((const USB_FRAME*)u2f_frame);
}
#endif
Expand Down
Loading
Loading