|
11 | 11 | parse_authentication_credential_json, |
12 | 12 | parse_registration_credential_json, |
13 | 13 | ) |
14 | | -from webauthn.helpers.exceptions import ( |
15 | | - InvalidAuthenticationResponse, |
16 | | - InvalidAuthenticatorDataStructure, |
17 | | - InvalidRegistrationResponse, |
18 | | - UnsupportedPublicKeyType, |
19 | | -) |
| 14 | +from webauthn.helpers.exceptions import WebAuthnException |
20 | 15 | from webauthn.helpers.options_to_json import options_to_json |
21 | 16 | from webauthn.helpers.structs import ( |
22 | 17 | AttestationConveyancePreference, |
@@ -128,11 +123,7 @@ def verify_registration_response(response, challenge, *, rp_id, origin): |
128 | 123 | expected_origin=origin, |
129 | 124 | require_user_verification=False, |
130 | 125 | ) |
131 | | - except ( |
132 | | - InvalidAuthenticatorDataStructure, |
133 | | - InvalidRegistrationResponse, |
134 | | - UnsupportedPublicKeyType, |
135 | | - ) as e: |
| 126 | + except WebAuthnException as e: |
136 | 127 | raise RegistrationRejectedError(str(e)) |
137 | 128 |
|
138 | 129 |
|
@@ -163,7 +154,7 @@ def verify_assertion_response(assertion, *, challenge, user, origin, rp_id): |
163 | 154 | credential_current_sign_count=current_sign_count, |
164 | 155 | require_user_verification=False, |
165 | 156 | ) |
166 | | - except InvalidAuthenticationResponse: |
| 157 | + except WebAuthnException: |
167 | 158 | pass |
168 | 159 |
|
169 | 160 | # If we exit the loop, then we've failed to verify the assertion against |
|
0 commit comments