Skip to content

Commit

Permalink
Merge pull request #12 from obsidiansystems/dn-fix-none-encoding
Browse files Browse the repository at this point in the history
Fix the encoding and decoding of none attestation format
  • Loading branch information
fumieval authored Feb 5, 2021
2 parents c124fe7 + aa6842f commit 174b015
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 174b015

Please sign in to comment.