Closed arianvp closed 3 years ago
Decided to completely remove the function in a second commit a276880fce8d80c46b7aa316fc5b88f186c9bd50 . I really think we shouldn't me marshalling and unmarshaling here.
Let me know if you disagree and i'll drop a276880fce8d80c46b7aa316fc5b88f186c9bd50 again.
I think https://github.com/duo-labs/webauthn/pull/83 is a more generic fix?
Marshal
seems to be unstable. Instead useCTAP2Encoding
as per the Webauthn spec.cbor.Marshal doesn't seem to be stable across runs. It produces different keyBytes on subsequent calls with the same input which is extremely confusing if you're inspecting the attestation data directly and comparing it to previous attestations.
Swap out for canonical Marshal as per Webauthn spec which uses a stable ordering of map elements.
Overall I'm confused why this step is made in the first place. We're not doing any error handling. what happens if Unmarshal fails? It will try to marshal
nil
in that case.Why do we not pass the
rawBytes
through untouched to the rest of the code?