use 0x7f as upper counter byte

pull/136/head 2.0.0
Conor Patrick 2019-03-04 02:36:47 -05:00
rodzic 4982b13f64
commit 195dc2a8ae
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -247,7 +247,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c
}
count = ctap_atomic_count(0);
hash[0] = (count >> 24) & 0xff;
hash[0] = 0x7f;
hash[1] = (count >> 16) & 0xff;
hash[2] = (count >> 8) & 0xff;
hash[3] = (count >> 0) & 0xff;
@ -264,7 +264,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c
crypto_ecc256_sign(hash, 32, sig);
u2f_response_writeback(&up,1);
hash[0] = (count >> 24) & 0xff;
hash[0] = 0x7f;
hash[1] = (count >> 16) & 0xff;
hash[2] = (count >> 8) & 0xff;
hash[3] = (count >> 0) & 0xff;

Wyświetl plik

@ -448,7 +448,7 @@ class Tester:
if lastc:
assert (auth.counter - lastc) < 10
lastc = auth.counter
if lastc > 0x100000:
if lastc > 0x80000000:
print("WARNING: counter is unusually high: %04x" % lastc)
assert 0