File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ project(canokey-core C)
5
5
option (ENABLE_TESTS "Perform unit tests after build" OFF )
6
6
option (ENABLE_FUZZING "Build for fuzzing" OFF )
7
7
option (ENABLE_DEBUG_OUTPUT "Print debug messages" ON )
8
+ option (ENABLE_DUMB_DONGLE "Skip all user-presence test (USE AT YOUR OWN RISK)" OFF )
8
9
option (VIRTCARD "Virt Card" OFF )
9
10
10
11
set (CMAKE_C_STANDARD 11)
@@ -21,6 +22,9 @@ if (ENABLE_TESTS OR ENABLE_FUZZING)
21
22
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-usage" )
22
23
endif ()
23
24
endif ()
25
+ if (ENABLE_DUMB_DONGLE)
26
+ add_definitions (-DDUMB_DONGLE)
27
+ endif (ENABLE_DUMB_DONGLE)
24
28
25
29
add_subdirectory (canokey-crypto EXCLUDE_FROM_ALL )
26
30
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ uint8_t wait_for_user_presence(uint8_t entry) {
66
66
uint32_t last = start ;
67
67
DBG_MSG ("start %u\n" , start );
68
68
while (get_touch_result () == TOUCH_NO ) {
69
+ #ifdef DUMB_DONGLE
70
+ break ;
71
+ #endif
69
72
// Keep blinking, in case other applet stops it
70
73
start_blinking (0 );
71
74
// Nested CCID processing is not allowed
@@ -102,6 +105,9 @@ int send_keepalive_during_processing(uint8_t entry) {
102
105
}
103
106
104
107
__attribute__((weak )) int strong_user_presence_test (void ) {
108
+ #ifdef DUMB_DONGLE
109
+ return 0 ;
110
+ #endif
105
111
for (int i = 0 ; i < 5 ; i ++ ) {
106
112
const uint8_t wait_sec = 2 ;
107
113
start_blinking_interval (wait_sec , (i & 1 ) ? 200 : 50 );
You can’t perform that action at this time.
0 commit comments