Skip to content

Commit

Permalink
Fix the encoding and decoding of none attestation format
Browse files Browse the repository at this point in the history
  • Loading branch information
dfordivam committed Feb 4, 2021
1 parent c124fe7 commit aa6842f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WebAuthn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ decodeAttestation = do
"packed" -> AF_Packed <$> Packed.decode stmtTerm
"tpm" -> AF_TPM <$> TPM.decode stmtTerm
"android-safetynet" -> AF_AndroidSafetyNet <$> Android.decode stmtTerm
"none" -> pure AF_None
_ -> fail $ "decodeAttestation: Unsupported format: " ++ show fmt
CBOR.TBytes adRaw <- maybe (fail "authData") pure $ Map.lookup "authData" m
return (AttestationObject fmt stmt adRaw)
Expand All @@ -135,7 +136,7 @@ encodeAttestation attestationObject = CBOR.encodeMapLen 3
AF_TPM _ -> CBOR.encodeString "tpm"
AF_AndroidKey -> CBOR.encodeString "android-key"
AF_AndroidSafetyNet _ -> CBOR.encodeString "android-safetynet"
AF_None -> CBOR.encodeString ""
AF_None -> CBOR.encodeString "none"

-- | 7.1. Registering a New Credential
registerCredential :: MonadIO m => PublicKeyCredentialCreationOptions
Expand Down

0 comments on commit aa6842f

Please sign in to comment.