Skip to content

Commit

Permalink
Revert flipped credential id checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ljodal committed Aug 7, 2023
1 parent ecf3446 commit 8d87b2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webauthn/authentication/verify_authentication_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from cryptography.exceptions import InvalidSignature

from webauthn.helpers import (
base64url_to_bytes,
bytes_to_base64url,
decode_credential_public_key,
decoded_public_key_to_cryptography,
parse_authenticator_data,
Expand Down Expand Up @@ -69,7 +69,7 @@ def verify_authentication_response(
"""

# FIDO-specific check
if credential.raw_id != base64url_to_bytes(credential.id):
if bytes_to_base64url(credential.raw_id) != credential.id:
raise InvalidAuthenticationResponse("id and raw_id were not equivalent")

# FIDO-specific check
Expand Down
4 changes: 2 additions & 2 deletions webauthn/registration/verify_registration_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from webauthn.helpers import (
aaguid_to_string,
base64url_to_bytes,
bytes_to_base64url,
decode_credential_public_key,
parse_attestation_object,
parse_client_data_json,
Expand Down Expand Up @@ -95,7 +95,7 @@ def verify_registration_response(
verified = False

# FIDO-specific check
if credential.raw_id != base64url_to_bytes(credential.id):
if bytes_to_base64url(credential.raw_id) != credential.id:
raise InvalidRegistrationResponse("id and raw_id were not equivalent")

# FIDO-specific check
Expand Down

0 comments on commit 8d87b2f

Please sign in to comment.