Skip to content

Commit

Permalink
Fix typo in JWK error messages.
Browse files Browse the repository at this point in the history
Add missing space in error message for key / key-material mismatch errors.
  • Loading branch information
nghamilton authored and frasertweedale committed Jan 11, 2019
1 parent e65c472 commit 71274bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Crypto/JOSE/JWA/JWK.hs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ sign JWA.JWS.HS384 (OctKeyMaterial k) = signOct SHA384 k
sign JWA.JWS.HS512 (OctKeyMaterial k) = signOct SHA512 k
sign JWA.JWS.EdDSA (OKPKeyMaterial k) = signEdDSA k
sign h k = \_ -> throwing _AlgorithmMismatch
(show h <> "cannot be used with " <> showKeyType k <> " key")
(show h <> " cannot be used with " <> showKeyType k <> " key")

verify
:: (MonadError e m, AsError e)
Expand All @@ -656,7 +656,7 @@ verify JWA.JWS.HS384 (OctKeyMaterial k) = \m s -> BA.constEq s <$> signOct SHA38
verify JWA.JWS.HS512 (OctKeyMaterial k) = \m s -> BA.constEq s <$> signOct SHA512 k m
verify JWA.JWS.EdDSA (OKPKeyMaterial k) = verifyEdDSA k
verify h k = \_ _ -> throwing _AlgorithmMismatch
(show h <> "cannot be used with " <> showKeyType k <> " key")
(show h <> " cannot be used with " <> showKeyType k <> " key")

instance Arbitrary KeyMaterial where
arbitrary = oneof
Expand Down

0 comments on commit 71274bf

Please sign in to comment.