add spacing

This commit is contained in:
Conor Patrick 2018-09-03 00:23:10 -04:00
parent a76564f488
commit b6d077c226
2 changed files with 115 additions and 91 deletions

View File

@ -155,20 +155,37 @@ int ctap_user_verification(uint8_t arg)
// Return 1 for user is present, 0 user not present
int ctap_user_presence_test()
{
#ifdef SKIP_BUTTON_CHECK
return 1;
#endif
uint32_t t1 = millis();
RGB(0x304010);
#ifdef USE_BUTTON_DELAY
delay(3000);
RGB(0x001040);
delay(50);
return 1;
#endif
while (IS_BUTTON_PRESSED())
{
if (t1 + 5000 < millis())
{
printf1(TAG_GEN,"Button not pressed\n");
return 0;
}
}
t1 = millis();
do
{
if (t1 + 5000 < millis())
{
return 0;
}
if (! IS_BUTTON_PRESSED())
continue;
delay(1);
@ -214,8 +231,8 @@ void heartbeat()
state = !state;
}
// if (but) RGB(val * 2);
// else
// if (but) RGB(val * 2);
// else
RGB((val << 16) | (val*2 << 8));
}
@ -227,6 +244,12 @@ void heartbeat()
int but = IS_BUTTON_PRESSED();
#if 0
RGB(0x70fefe); // bright ass light
return;
#endif
if (state)
{
val--;
@ -236,13 +259,14 @@ void heartbeat()
val++;
}
if (val > 30 || val < 1)
if (val >120/3 || val < 1)
{
state = !state;
}
if (but) RGB(val * 2);
else RGB(val << 8);
else RGB(val*3 | ((val*3) << 8) | (val << 16) );
// else RGB((val*3) << 8);
}
#endif
@ -295,9 +319,9 @@ int usbhid_recv(uint8_t * msg)
wait_for_efm8_busy();
// // msgs_to_recv--;
// printf(">> ");
// dump_hex(msg,64);
// // msgs_to_recv--;
// printf(">> ");
// dump_hex(msg,64);
return 64;
}
@ -620,13 +644,13 @@ int bootloader_bridge(uint8_t klen, uint8_t * keyh)
MSC_WriteWordFast(ptr,payload, req->len + (req->len%4));
break;
case BootDone:
// printf("BootDone\n");
// printf("BootDone\n");
ptr = APPLICATION_START_ADDR;
crypto_sha256_init();
crypto_sha256_update(ptr, APPLICATION_END_ADDR-APPLICATION_START_ADDR);
crypto_sha256_final(hash);
// printf("hash: "); dump_hex(hash, 32);
// printf("sig: "); dump_hex(payload, 64);
// printf("hash: "); dump_hex(hash, 32);
// printf("sig: "); dump_hex(payload, 64);
curve = uECC_secp256r1();
if (! uECC_verify(pubkey,

View File

@ -31,7 +31,7 @@ void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
rcode = U2F_SW_CLASS_NOT_SUPPORTED;
goto end;
}
#if defined(BRIDGE_TO_WALLET)
#if defined(BRIDGE_TO_WALLET) || defined(IS_BOOTLOADER)
struct u2f_authenticate_request * auth = (struct u2f_authenticate_request *) req->payload;