Skip to content

Commit

Permalink
Force Fido2Client to accept any RP ID, incl. 'solo-sign-hash:...'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenwdv committed Oct 25, 2021
1 parent 6f2f63d commit a0a1686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion solo/devices/solo_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def find_device(self, dev=None, solo_serial=None):
self.ctap2 = None

try:
self.client = Fido2Client(dev, self.origin)
# Accept any RP ID, including e.g. 'solo-sign-hash:...'
self.client = Fido2Client(dev, self.origin, verify=lambda _rp_id, _origin: True)
except CtapError:
print("Not using FIDO2 interface.")
self.client = None
Expand Down
4 changes: 2 additions & 2 deletions solo/hmac_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def make_credential(

rp = PublicKeyCredentialRpEntity(host, "Example RP")
client.host = host
client.origin = f"https://{client.host}"
client.origin = client.host if ":" in client.host else f"https://{client.host}"
client.user_id = user_id
user = fido2.webauthn.PublicKeyCredentialUserEntity(user_id, "A. User")
challenge = secrets.token_bytes(32)
Expand Down Expand Up @@ -89,7 +89,7 @@ def simple_secret(

# rp = {"id": host, "name": "Example RP"}
client.host = host
client.origin = f"https://{client.host}"
client.origin = client.host if ":" in client.host else f"https://{client.host}"
client.user_id = user_id
# user = {"id": user_id, "name": "A. User"}
credential_id = binascii.a2b_hex(credential_id)
Expand Down

0 comments on commit a0a1686

Please sign in to comment.