commsec 0.2.2 → 0.2.3
raw patch · 3 files changed
+10/−8 lines, 3 filesdep ~cipher-aes128dep ~crypto-api
Dependency ranges changed: cipher-aes128, crypto-api
Files
- Network/CommSec.hs +3/−1
- Network/CommSec/Package.hs +3/−3
- commsec.cabal +4/−4
Network/CommSec.hs view
@@ -13,6 +13,8 @@ -- * Establishing a connection from a public identity (PKI) -- , acceptId -- , connectId+ -- * Utility+ , expandSecret ) where import Crypto.Classes (buildKey)@@ -89,7 +91,7 @@ (b, res) <- B.createAndTrim' sz $ \ptPtr -> do resSz <- recvPtrOfSz get put conn ptPtr sz case resSz of- Left err -> if err `elem` retryOn then return (0,0,Err)+ Left err -> if err `elem` retryOn then print err >> return (0,0,Err) else throw err Right s -> if s > sz
Network/CommSec/Package.hs view
@@ -100,18 +100,18 @@ -- communicate with an identically initialized in context. newOutContext :: ByteString -> OutContext newOutContext bs- | B.length bs < 24 = error $ "Not enough entropy: " ++ show (B.length bs)+ | B.length bs < 20 = error $ "Not enough entropy: " ++ show (B.length bs) | otherwise = let aesCtr = 1 saltOut = unsafePerformIO $ B.unsafeUseAsCString bs $ peekBE32 . castPtr outKey = fromMaybe (error "Could not build a key") $ buildKey $ B.drop (sizeOf saltOut) bs in Out {..} --- | Given at least 24 bytes of entropy, produce an in context that can+-- | Given at least 20 bytes of entropy, produce an in context that can -- communicate with an identically initialized out context. newInContext :: ByteString -> SequenceMode -> InContext newInContext bs md- | B.length bs < 24 = error $ "Not enough entropy: " ++ show (B.length bs)+ | B.length bs < 20 = error $ "Not enough entropy: " ++ show (B.length bs) | otherwise = let bitWindow = zeroWindow seqVal = 0
commsec.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: commsec-version: 0.2.2+version: 0.2.3 synopsis: Provide communications security using symmetric ephemeral keys- description: This package provides confidentiallity,+description: This package provides confidentiallity, integrity and replay detection. Users must provide ephemeral keys for one time use (reuse will compromise the security guarentees).@@ -24,7 +24,7 @@ exposed-modules: Network.CommSec, Network.CommSec.Package, Network.CommSec.BitWindow, Network.CommSec.Types -- other-modules: Network.CommSec.BitWindow, Network.CommSec.Types build-depends: base >4.5 && < 5,- cipher-aes128 >= 0.2,+ cipher-aes128 >= 0.2.5, bytestring,- crypto-api,+ crypto-api >= 0.12, network >= 2.4.1