Skip to content

Commit

Permalink
Improvements based on feedback from @vincenthz
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Mar 20, 2014
1 parent 43bec1f commit 626f1e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mime-mail-ses/Network/Mail/Mime/SES.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ module Network.Mail.Mime.SES

import Control.Exception (Exception, throwIO)
import Control.Monad.IO.Class (MonadIO, liftIO)
import qualified Crypto.Hash.SHA256 as SHA256
import Crypto.MAC.HMAC (hmac)
import Crypto.Hash (Digest, SHA256, hmac,
hmacGetDigest)
import Data.Byteable (toBytes)
import Data.ByteString (ByteString)
import Data.ByteString.Base64 (encode)
import qualified Data.ByteString.Char8 as S8
Expand Down Expand Up @@ -122,4 +123,5 @@ data SESException = SESException
instance Exception SESException

makeSig :: ByteString -> ByteString -> ByteString
makeSig payload key = encode $ hmac SHA256.hash 64 key payload
makeSig payload key =
encode $ toBytes (hmacGetDigest $ hmac key payload :: Digest SHA256)
1 change: 1 addition & 0 deletions mime-mail-ses/mime-mail-ses.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Library
, text
, conduit
, cryptohash >= 0.7.3
, byteable
ghc-options: -Wall

0 comments on commit 626f1e5

Please sign in to comment.