Commit 41945cd
committed
Use libwebauthn for JSON response serialization
This commit migrates from custom JSON response serialization to
libwebauthn's WebAuthnIDLResponse::to_inner_model() for both
create credential (MakeCredential) and get credential (GetAssertion)
responses.
Changes:
- Use libwebauthn's to_inner_model() to serialize responses, then
modify the result to add transport and authenticator_attachment
information that is known at the credential service level
- Remove create_credential_request_try_into_ctap2's client_data_json
return value (now extracted from the request by libwebauthn)
- Remove get_credential_request_try_into_ctap2's client_data_json
return value
- Update gateway.rs to clone the request for response serialization
- Remove unused modules: cbor.rs, cose.rs, serde/mod.rs
- Simplify webauthn.rs to just re-exports from libwebauthn
This removes ~800 lines of custom serialization code including:
- CreatePublicKeyCredentialResponse and GetPublicKeyCredentialResponse
- AttestationStatement enum and create_attestation_object function
- All the extension output types (CredentialPropertiesOutput, etc.)
- Custom CBOR writer for attestation object serialization
- COSE key type helpers
The response serialization now uses libwebauthn's implementation which:
- Handles attestation object CBOR encoding
- Handles all extension output serialization
- Handles base64url encoding of binary fields
- Produces WebAuthn Level 3 compliant JSON responses1 parent bbd0150 commit 41945cd
7 files changed
Lines changed: 50 additions & 838 deletions
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
263 | | - | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
| 310 | + | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
324 | 326 | | |
325 | 327 | | |
326 | 328 | | |
327 | | - | |
| 329 | + | |
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
| |||
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
451 | | - | |
452 | | - | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
0 commit comments