diff --git a/fido2/wallet.c b/fido2/wallet.c index 6dedb85..40d9046 100644 --- a/fido2/wallet.c +++ b/fido2/wallet.c @@ -186,6 +186,8 @@ int16_t bridge_u2f_to_wallet(uint8_t * _chal, uint8_t * _appid, uint8_t klen, ui int keysize = sizeof(key); + memset(lens,0,sizeof(lens)); + for (i = 0; i < sizeof(sig); i++) { @@ -322,10 +324,10 @@ int16_t bridge_u2f_to_wallet(uint8_t * _chal, uint8_t * _appid, uint8_t klen, ui memmove(chksum, args[0] + lens[0] - 4, 4); lens[0] -= 4; - printf("chksum: "); dump_hex1(TAG_WALLET, chksum, 4); + /*printf("chksum: "); dump_hex1(TAG_WALLET, chksum, 4);*/ // perform integrity check - printf1(TAG_WALLET,"shasum on [%d]: ",lens[0]); dump_hex1(TAG_WALLET, args[0], lens[0]); + /*printf1(TAG_WALLET,"shasum on [%d]: ",lens[0]); dump_hex1(TAG_WALLET, args[0], lens[0]);*/ crypto_sha256_init(); crypto_sha256_update(args[0], lens[0]); crypto_sha256_final(shasum); @@ -333,7 +335,7 @@ int16_t bridge_u2f_to_wallet(uint8_t * _chal, uint8_t * _appid, uint8_t klen, ui crypto_sha256_update(shasum, 32); crypto_sha256_final(shasum); - printf1(TAG_WALLET,"shasum: "); dump_hex1(TAG_WALLET, shasum, 32); + /*printf1(TAG_WALLET,"shasum: "); dump_hex1(TAG_WALLET, shasum, 32);*/ if (memcmp(shasum, chksum, 4) != 0) { diff --git a/web/js/wallet.js b/web/js/wallet.js index bbd9d72..d9e9bbd 100644 --- a/web/js/wallet.js +++ b/web/js/wallet.js @@ -1076,7 +1076,7 @@ async function run_tests() { p = await dev.set_pin(pin); TEST(p.status == "CTAP2_ERR_NOT_ALLOWED", 'set_pin is locked out'); - p = await dev.set_pin(pin,pin2); + p = await dev.change_pin(pin,pin2); TEST(p.status == "CTAP2_ERR_NOT_ALLOWED", 'change_pin is locked out'); p = await dev.get_rng(); @@ -1100,6 +1100,8 @@ async function run_tests() { TEST(p.status == 'CTAP2_ERR_NO_CREDENTIALS'); TEST(tries > 2 && is_pin_set == false, 'Device is no longer locked after reset and pin and key are gone'); + + TEST(p.count >= count, 'Counter did not reset'); } async function test_rng(){