mirror of
https://github.com/polhenarejos/pico-fido.git
synced 2024-09-20 03:10:10 +00:00
Compare commits
3 Commits
902a988350
...
f234b0dc26
Author | SHA1 | Date | |
---|---|---|---|
|
f234b0dc26 | ||
|
8ba9116454 | ||
|
5a31405244 |
@ -1 +1 @@
|
||||
Subproject commit 7a88a2b8e74780e3d5f5a48fb5d5705fbff2d940
|
||||
Subproject commit ac2a6c10521367a850668e427afce087251ed1d1
|
@ -20,6 +20,8 @@
|
||||
|
||||
from fido2.client import CtapError
|
||||
from fido2.cose import ES256, ES384, ES512
|
||||
import fido2.features
|
||||
fido2.features.webauthn_json_mapping.enabled = False
|
||||
from utils import ES256K
|
||||
import pytest
|
||||
|
||||
|
@ -69,12 +69,12 @@ def test_hmac_secret_entropy(device, MCHmacSecret, hmac, salts
|
||||
|
||||
#print(shannon_entropy(auth.authenticator_data.extensions['hmac-secret']))
|
||||
if len(salts) == 1:
|
||||
assert shannon_entropy(auth.authenticator_data.extensions['hmac-secret']) > 4.6
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output1']) > 4.6
|
||||
assert shannon_entropy(auth.authenticator_data.extensions['hmac-secret']) > 4.5
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output1']) > 4.5
|
||||
if len(salts) == 2:
|
||||
assert shannon_entropy(auth.authenticator_data.extensions['hmac-secret']) > 5.4
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output1']) > 4.6
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output2']) > 4.6
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output1']) > 4.5
|
||||
assert shannon_entropy(ext["hmacGetSecret"]['output2']) > 4.5
|
||||
|
||||
def get_output(device, MCHmacSecret, hmac, salts):
|
||||
hout = {'salt1':salts[0]}
|
||||
|
@ -196,16 +196,13 @@ class TestHID(object):
|
||||
|
||||
device.set_cid(cid2) # send ping on 2nd channel
|
||||
device.send_raw("\x81\x00\x39")
|
||||
time.sleep(0.1)
|
||||
device.send_raw("\x00")
|
||||
|
||||
cmd, r = device.recv_raw() # busy response
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
device.set_cid(cid1) # finish 1st channel ping
|
||||
device.send_raw("\x00")
|
||||
|
||||
device.set_cid(cid2)
|
||||
|
||||
assert cmd == 0xBF
|
||||
assert r[0] == CtapError.ERR.CHANNEL_BUSY
|
||||
|
||||
@ -213,9 +210,11 @@ class TestHID(object):
|
||||
cmd, r = device.recv_raw() # ping response
|
||||
assert cmd == 0x81
|
||||
assert len(r) == 0x39
|
||||
cmd, r = device.recv_raw() # ping response
|
||||
|
||||
def test_cid_0(self, device):
|
||||
device.reset()
|
||||
time.sleep(0.1)
|
||||
device.set_cid(b"\x00\x00\x00\x00")
|
||||
device.send_raw(
|
||||
"\x86\x00\x08\x11\x22\x33\x44\x55\x66\x77\x88", cid="\x00\x00\x00\x00"
|
||||
|
Loading…
Reference in New Issue
Block a user