tweaks
This commit is contained in:
@@ -186,6 +186,8 @@ int16_t bridge_u2f_to_wallet(uint8_t * _chal, uint8_t * _appid, uint8_t klen, ui
|
|||||||
|
|
||||||
int keysize = sizeof(key);
|
int keysize = sizeof(key);
|
||||||
|
|
||||||
|
memset(lens,0,sizeof(lens));
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < sizeof(sig); i++)
|
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);
|
memmove(chksum, args[0] + lens[0] - 4, 4);
|
||||||
lens[0] -= 4;
|
lens[0] -= 4;
|
||||||
|
|
||||||
printf("chksum: "); dump_hex1(TAG_WALLET, chksum, 4);
|
/*printf("chksum: "); dump_hex1(TAG_WALLET, chksum, 4);*/
|
||||||
|
|
||||||
// perform integrity check
|
// 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_init();
|
||||||
crypto_sha256_update(args[0], lens[0]);
|
crypto_sha256_update(args[0], lens[0]);
|
||||||
crypto_sha256_final(shasum);
|
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_update(shasum, 32);
|
||||||
crypto_sha256_final(shasum);
|
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)
|
if (memcmp(shasum, chksum, 4) != 0)
|
||||||
{
|
{
|
||||||
|
@@ -1076,7 +1076,7 @@ async function run_tests() {
|
|||||||
p = await dev.set_pin(pin);
|
p = await dev.set_pin(pin);
|
||||||
TEST(p.status == "CTAP2_ERR_NOT_ALLOWED", 'set_pin is locked out');
|
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');
|
TEST(p.status == "CTAP2_ERR_NOT_ALLOWED", 'change_pin is locked out');
|
||||||
|
|
||||||
p = await dev.get_rng();
|
p = await dev.get_rng();
|
||||||
@@ -1100,6 +1100,8 @@ async function run_tests() {
|
|||||||
TEST(p.status == 'CTAP2_ERR_NO_CREDENTIALS');
|
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(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(){
|
async function test_rng(){
|
||||||
|
Reference in New Issue
Block a user