packages feed

tls-extra 0.1.9 → 0.2.0

raw patch · 5 files changed

+16/−10 lines, 5 filesdep +cprng-aesdep ~tls

Dependencies added: cprng-aes

Dependency ranges changed: tls

Files

Examples/CheckCiphers.hs view
@@ -4,6 +4,8 @@ import Network.TLS.Cipher import Network.TLS +import qualified Crypto.Random.AESCtr as RNG+ import qualified Data.ByteString as B import Data.Word import Data.Char@@ -89,7 +91,7 @@ 	connect sock (SockAddrInet pn (head $ hostAddresses he)) 	handle <- socketToHandle sock ReadWriteMode -	(Right rng) <- makeSRandomGen+	rng <- RNG.makeSystem 	let params = defaultParams { pCiphers = map fakeCipher ciphers } 	ctx <- client params rng handle 	sendPacket ctx $ Handshake $ clienthello ciphers
Examples/RetrieveCertificate.hs view
@@ -10,13 +10,15 @@ import Control.Monad import Prelude hiding (catch) +import qualified Crypto.Random.AESCtr as RNG+ import Text.Printf  import System.Console.CmdArgs  openConnection s p = do 	ref <- newIORef Nothing-	(Right rng) <- makeSRandomGen+	rng <- RNG.makeSystem 	let params = defaultParams 		{ pCiphers           = ciphersuite_all 		, onCertificatesRecv = \l -> do
Examples/Stunnel.hs view
@@ -19,6 +19,7 @@ import qualified Data.Certificate.KeyRSA as KeyRSA import qualified Crypto.Cipher.RSA as RSA +import qualified Crypto.Random.AESCtr as RNG import Network.TLS import Network.TLS.Extra @@ -62,9 +63,6 @@ 				return False 	return () -getRandomGen :: IO SRandomGen-getRandomGen = makeSRandomGen >>= either (fail . show) (return . id)- tlsserver srchandle dsthandle = do 	hSetBuffering dsthandle NoBuffering @@ -79,7 +77,7 @@ 	putStrLn "end"  clientProcess certs handle dsthandle _ = do-	rng <- getRandomGen+	rng <- RNG.makeSystem  	let serverstate = defaultParams 		{ pAllowedVersions = [SSL3,TLS10,TLS11]@@ -224,7 +222,7 @@ 			(StunnelSocket srcsocket) <- listenAddressDescription srcaddr 			forever $ do 				(s, _) <- accept srcsocket-				rng    <- getRandomGen+				rng    <- RNG.makeSystem 				srch   <- socketToHandle s ReadWriteMode  				(StunnelSocket dst)  <- connectAddressDescription dstaddr
Network/TLS/Extra/Connection.hs view
@@ -9,6 +9,7 @@ 	( connectionClient 	) where +import Crypto.Random import Control.Applicative ((<$>)) import Control.Exception import Data.Char@@ -21,7 +22,7 @@  -- | open a TCP client connection to a destination and port description (number or name) -- -connectionClient :: String -> String -> TLSParams -> SRandomGen -> IO TLSCtx+connectionClient :: CryptoRandomGen g => String -> String -> TLSParams -> g -> IO TLSCtx connectionClient s p params rng = do 	pn <- if and $ map isDigit $ p 		then return $ fromIntegral $ (read p :: Int)
tls-extra.cabal view
@@ -1,5 +1,5 @@ Name:                tls-extra-Version:             0.1.9+Version:             0.2.0 Description:    a set of extra definitions, default values and helpers for tls. License:             BSD3@@ -28,7 +28,7 @@  Library   Build-Depends:     base > 3 && < 5-                   , tls >= 0.5 && < 0.6+                   , tls >= 0.6 && < 0.7                    , mtl                    , network >= 2.3                    , cryptohash >= 0.6@@ -53,6 +53,7 @@   if flag(executable)     Build-Depends:   network                    , cmdargs+                   , cprng-aes     Buildable:       True   else     Buildable:       False@@ -63,6 +64,7 @@   if flag(executable)     Build-Depends:   network                    , cmdargs+                   , cprng-aes     Buildable:       True   else     Buildable:       False@@ -73,6 +75,7 @@   if flag(executable)     Build-Depends:   network                    , cmdargs+                   , cprng-aes     Buildable:       True   else     Buildable:       False