packages feed

peyotls 0.1.6.7 → 0.1.6.8

raw patch · 5 files changed

+18/−21 lines, 5 filesdep ~peyotls-codecPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: peyotls-codec

API changes (from Hackage documentation)

Files

peyotls.cabal view
@@ -2,7 +2,7 @@ cabal-version:	>= 1.8  name:		peyotls-version:	0.1.6.7+version:	0.1.6.8 stability:	Experimental author:		Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer:	Yoshikuni Jujo <PAF01143@nifty.ne.jp>@@ -281,7 +281,7 @@ source-repository	this     type:	git     location:	git://github.com/YoshikuniJujo/peyotls.git-    tag:	peyotls-0.1.6.7+    tag:	peyotls-0.1.6.8  library     hs-source-dirs:	src@@ -305,7 +305,7 @@         cryptohash == 0.11.*,         crypto-pubkey == 0.2.*, crypto-pubkey-types == 0.4.*,         cipher-aes == 0.2.*,-        bytable == 0.1.*, handle-like == 0.1.*, peyotls-codec == 0.1.*,+        bytable == 0.1.*, handle-like == 0.1.*, peyotls-codec == 0.2.*,         stm == 2.4.*, transformers-base == 0.4.*, monad-control == 0.3.*     ghc-options:	-Wall     extensions:		PatternGuards, DoAndIfThenElse
src/Network/PeyoTLS/Base.hs view
@@ -15,7 +15,7 @@ 		readHandshake, writeHandshake, 		CCSpec(..), 	Handshake(HHelloReq),-	ClHello(..), SvHello(..), SssnId(..), Extension(..), isRnInfo, emptyRnInfo,+	ClHello(..), SvHello(..), PrtVrsn(..), SssnId(..), Extension(..), isRnInfo, emptyRnInfo, 		CipherSuite(..), KeyEx(..), BulkEnc(..), 		CmpMtd(..), HashAlg(..), SignAlg(..), 		getCipherSuite, setCipherSuite,@@ -61,7 +61,7 @@  import Network.PeyoTLS.Codec ( 	Handshake(..), HandshakeItem(..),-	ClHello(..), SvHello(..), SssnId(..),+	ClHello(..), SvHello(..), PrtVrsn(..), SssnId(..), 		CipherSuite(..), KeyEx(..), BulkEnc(..), 		CmpMtd(..), Extension(..), isRnInfo, emptyRnInfo, 	SvKeyEx(..), SvKeyExDhe(..), SvKeyExEcdhe(..),
src/Network/PeyoTLS/Client/Body.hs view
@@ -55,7 +55,7 @@ 	ValidateHandle(..), handshakeValidate, validateAlert, 	HandleBase, CertSecretKey(..), 		readHandshake, writeHandshake, CCSpec(..),-	ClHello(..), SvHello(..), SssnId(..), isRnInfo,+	ClHello(..), SvHello(..), PrtVrsn(..), SssnId(..), isRnInfo, 		CipherSuite(..), KeyEx(..), BulkEnc(..), 		CmpMtd(..), HashAlg(..), SignAlg(..), 		setCipherSuite,@@ -167,7 +167,7 @@ clientHello cscl = do 	cr <- withRandom $ cprgGenerate 32 	((>>) <$> writeHandshake <*> debug "low")-		. ClHello (3, 3) cr (SssnId "") cscl [CmpMtdNull]+		. ClHello (PrtVrsn 3 3) cr (SssnId "") cscl [CmpMtdNull] 		. Just . (: []) =<< makeClRenego 	return cr @@ -188,7 +188,7 @@ serverHello = do 	SvHello v sr _sid cs@(CipherSuite ke _) cm e <- readHandshake 	case v of-		(3, 3) -> return ()+		PrtVrsn 3 3 -> return () 		_ -> throw ALFtl ADProtoVer $ 			modNm ++ ".serverHello: only TLS 1.2" 	case cm of
src/Network/PeyoTLS/Run/State.hs view
@@ -6,7 +6,7 @@ 		getRSn, getWSn, rstRSn, rstWSn, sccRSn, sccWSn, 		getClFinished, setClFinished, getSvFinished, setSvFinished, 	ContType(..), getRBuf, getWBuf, getAdBuf, setRBuf, setWBuf, setAdBuf,-	ProtocolVersion,+	PrtVrsn, 	CipherSuite(..), BulkEnc(..), RW(..), 		getCipherSuite, setCipherSuite, flushCipherSuite, 	Keys(..), getKeys, setKeys,@@ -27,8 +27,8 @@ import qualified Crypto.PubKey.ECC.ECDSA as ECDSA  import Network.PeyoTLS.CertSecretKey (CertSecretKey(..), isRsaKey, isEcdsaKey)-import Network.PeyoTLS.Codec (CipherSuite(..), KeyEx(KE_NULL), BulkEnc(..))-import Network.PeyoTLS.Codec.ContentTypes (ContType(..), ProtocolVersion)+import Network.PeyoTLS.Codec (+	CipherSuite(..), KeyEx(KE_NULL), BulkEnc(..), ContType(..), PrtVrsn)  modNm :: String modNm = "Network.PeyoTLS.State"
src/Network/PeyoTLS/Server/Body.hs view
@@ -29,7 +29,6 @@ import "monads-tf" Control.Monad.Error.Class (strMsg) import Data.Maybe (fromJust) import Data.List (find)-import Data.Word (Word8) import Data.Function import Data.HandleLike (HandleLike(..)) import System.IO (Handle)@@ -58,7 +57,7 @@ 	HandleBase, CertSecretKey(..), isRsaKey, isEcdsaKey, 		readHandshake, writeHandshake, CCSpec(..), 	Handshake(HHelloReq),-	ClHello(..), SvHello(..), SssnId(..), Extension(..),+	ClHello(..), SvHello(..), PrtVrsn(..), SssnId(..), Extension(..), 		isRnInfo, emptyRnInfo, 		CipherSuite(..), KeyEx(..), BulkEnc(..), 		CmpMtd(..), HashAlg(..), SignAlg(..),@@ -88,10 +87,8 @@ 	hlClose = adClose . tlsHandleS 	hlFlush = wFlush . tlsHandleS -type Version = (Word8, Word8)--version :: Version-version = (3, 3)+version :: PrtVrsn+version = PrtVrsn 3 3  moduleName :: String moduleName = "Network.PeyoTLS.Server"@@ -204,7 +201,7 @@ 		"43db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"  clientHello :: (HandleLike h, CPRG g) => [CipherSuite] ->-	HandshakeM h g (KeyEx, BulkEnc, BS.ByteString, Version)+	HandshakeM h g (KeyEx, BulkEnc, BS.ByteString, PrtVrsn) clientHello cssv = do 	ClHello cv cr _sid cscl cms me <- readHandshake 	checkRnInfo cscl me@@ -250,13 +247,13 @@ 			moduleName ++ ".serverHello: cert files not match" 	return sr -rsaKeyExchange :: (ValidateHandle h, CPRG g) => RSA.PrivateKey -> Version ->+rsaKeyExchange :: (ValidateHandle h, CPRG g) => RSA.PrivateKey -> PrtVrsn -> 	(BS.ByteString, BS.ByteString) -> Maybe X509.CertificateStore -> 	HandshakeM h g (Maybe X509.PubKey)-rsaKeyExchange sk (vj, vn) rs mcs = const `liftM` reqAndCert mcs `ap` do+rsaKeyExchange sk vjvn@(PrtVrsn vj vn) rs mcs = const `liftM` reqAndCert mcs `ap` do 	Epms epms <- readHandshake 	makeKeys Server rs =<< mkpms epms `catchError` const-		((BS.cons vj . BS.cons vn) `liftM` withRandom (cprgGenerate 46))+		((B.encode vjvn `BS.append`) `liftM` withRandom (cprgGenerate 46)) 	where mkpms epms = do 		pms <- either (E.throwError . strMsg . show) return =<< 			withRandom (\g -> RSA.decryptSafer g sk epms)