jose-jwt 0.9.6 → 0.10.0
raw patch · 7 files changed
+19/−12 lines, 7 filesdep +cryptondep −cryptonite
Dependencies added: crypton
Dependencies removed: cryptonite
Files
- CHANGELOG.md +5/−0
- Jose/Jwa.hs +1/−1
- Jose/Jwe.hs +5/−4
- jose-jwt.cabal +5/−5
- tests/Tests/JweSpec.hs +1/−1
- tests/Tests/JwkSpec.hs +1/−0
- tests/Tests/JwsSpec.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,8 @@+0.10.0+------++* Change to using crypton (see #41).+ 0.9.6 -----
Jose/Jwa.hs view
@@ -1,12 +1,12 @@ {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK prune #-}+{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} module Jose.Jwa ( Alg (..) , JwsAlg (..) , JweAlg (..) , Enc (..)- , encName ) where
Jose/Jwe.hs view
@@ -140,12 +140,13 @@ -> ExceptT JwtError m Jwt doEncode hdr e encryptKey claims = do (cmk, iv) <- lift (generateCmkAndIV e)- let Just (AuthTag sig, ct) = encryptPayload e cmk iv aad claims+ let aad = B64.encode hdr+ (signature, ciphertext) = case encryptPayload e cmk iv aad claims of+ Just (AuthTag sig, ct) -> (sig, ct)+ Nothing -> error "encryptPayload failed! Shouldn't happen with valid key and iv" jweKey <- encryptKey cmk- let jwe = B.intercalate "." $ map B64.encode [hdr, jweKey, BA.convert iv, BA.convert ct, BA.convert sig]+ let jwe = B.intercalate "." $ map B64.encode [hdr, jweKey, BA.convert iv, BA.convert ciphertext, BA.convert signature] return (Jwt jwe)- where- aad = B64.encode hdr -- | Creates a JWE with the content key encoded using RSA. rsaEncode :: MonadRandom m
jose-jwt.cabal view
@@ -1,5 +1,5 @@ Name: jose-jwt-Version: 0.9.6+Version: 0.10.0 Synopsis: JSON Object Signing and Encryption Library Homepage: http://github.com/tekul/jose-jwt Bug-Reports: http://github.com/tekul/jose-jwt/issues@@ -55,7 +55,7 @@ , bytestring >= 0.9 , cereal >= 0.4 , containers >= 0.4- , cryptonite >= 0.19+ , crypton >= 0.32 , memory >= 0.10 , mtl >= 2.1.3.1 , text >= 0.11@@ -76,7 +76,7 @@ , base >= 4.9 && < 5 , aeson , bytestring- , cryptonite+ , crypton , memory , mtl , text@@ -100,7 +100,7 @@ else Build-depends: base >= 4.9 && < 5 , doctest >= 0.9.11- , cryptonite+ , crypton Benchmark bench-jwt Default-Language: Haskell2010@@ -112,6 +112,6 @@ , base >= 4.9 && < 5 , bytestring , criterion- , cryptonite+ , crypton Ghc-Options: -Wall -fno-warn-missing-signatures
tests/Tests/JweSpec.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}-{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-orphans -fno-warn-incomplete-uni-patterns #-} module Tests.JweSpec where
tests/Tests/JwkSpec.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings, CPP #-}+{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} module Tests.JwkSpec where
tests/Tests/JwsSpec.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}-{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-incomplete-uni-patterns #-} module Tests.JwsSpec where