From 89769ecc1878c9975dc1accc227e757b7930c19a Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sun, 31 Mar 2019 23:29:00 -0400 Subject: [PATCH] fix u2f counter for real --- fido2/u2f.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fido2/u2f.c b/fido2/u2f.c index 690287e..677e04a 100644 --- a/fido2/u2f.c +++ b/fido2/u2f.c @@ -247,7 +247,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c } count = ctap_atomic_count(0); - hash[0] = 0x7f; + hash[0] = (count >> 24) & 0xff; 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] = 0x7f; + hash[0] = (count >> 24) & 0xff; hash[1] = (count >> 16) & 0xff; hash[2] = (count >> 8) & 0xff; hash[3] = (count >> 0) & 0xff;