peyotls 0.1.0.0 → 0.1.1.0
raw patch · 7 files changed
+22/−21 lines, 7 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Setup.hs +1/−2
- examples/secretServer.hs +6/−6
- peyotls.cabal +2/−2
- src/Network/PeyoTLS/Base.hs +4/−5
- src/Network/PeyoTLS/Client.hs +2/−2
- src/Network/PeyoTLS/Run/Handle.hs +5/−2
- src/Network/PeyoTLS/Run/State.hs +2/−2
Setup.hs view
@@ -1,2 +1,1 @@-import Distribution.Simple-main = defaultMain+import Distribution.Simple; main = defaultMain
examples/secretServer.hs view
@@ -31,7 +31,7 @@ g <- hlGetLine p doUntil BS.null (hlGetLine p) >>= liftIO . mapM_ BSC.putStrLn liftIO $ BSC.putStrLn g- liftIO $ print $ "secret" `BS.isInfixOf` g+ liftIO . print $ "secret" `BS.isInfixOf` g if "secret" `BS.isInfixOf` g then do setCertificateStore p $ Just ca renegotiate p@@ -40,11 +40,11 @@ "Transfer-Encoding: chunked\r\n", "Content-Type: text/plain\r\n\r\n", "6\r\nSecret0\r\n\r\n" ]- else do hlPut p $ BS.concat [- "HTTP/1.1 200 OK\r\n",- "Transfer-Encoding: chunked\r\n",- "Content-Type: text/plain\r\n\r\n",- "5\r\nHello0\r\n\r\n" ]+ else hlPut p $ BS.concat [+ "HTTP/1.1 200 OK\r\n",+ "Transfer-Encoding: chunked\r\n",+ "Content-Type: text/plain\r\n\r\n",+ "5\r\nHello0\r\n\r\n" ] hlClose p doUntil :: Monad m => (a -> Bool) -> m a -> m [a]
peyotls.cabal view
@@ -2,7 +2,7 @@ cabal-version: >= 1.8 name: peyotls-version: 0.1.0.0+version: 0.1.1.0 stability: Experimental author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer: Yoshikuni Jujo <PAF01143@nifty.ne.jp>@@ -283,7 +283,7 @@ source-repository this type: git location: git://github.com/YoshikuniJujo/peyotls.git- tag: peyotls-0.1.0.0+ tag: peyotls-0.1.1.0 library hs-source-dirs: src
src/Network/PeyoTLS/Base.hs view
@@ -114,11 +114,10 @@ _ -> throw ALFtl ADUnexMsg $ modNm ++ ".readHandshake: uk ccs" writeHandshake:: (HandleLike h, CPRG g, HandshakeItem hi) => hi -> HandshakeM h g ()-writeHandshake hi = do- case hs of- HHelloReq -> hsPut bs- HCCSpec -> ccsPut . (\[w] -> w) $ BS.unpack bs- _ -> hsPut bs >> updateHash bs+writeHandshake hi = case hs of+ HHelloReq -> hsPut bs+ HCCSpec -> ccsPut . (\[w] -> w) $ BS.unpack bs+ _ -> hsPut bs >> updateHash bs where hs = toHandshake hi bs = B.encode hs
src/Network/PeyoTLS/Client.hs view
@@ -260,9 +260,9 @@ finishHandshake crt = do hs <- handshakeHash case fst <$> crt of- Just (RsaKey sk) -> writeHandshake $+ Just (RsaKey sk) -> writeHandshake . DigitSigned (cssAlgorithm sk) $ csSign sk hs- Just (EcdsaKey sk) -> writeHandshake $+ Just (EcdsaKey sk) -> writeHandshake . DigitSigned (cssAlgorithm sk) $ csSign sk hs _ -> return () writeHandshake CCSpec
src/Network/PeyoTLS/Run/Handle.hs view
@@ -21,7 +21,7 @@ import Control.Monad (when, unless, liftM, ap) import "monads-tf" Control.Monad.State (lift, get, put) import Data.Word (Word8, Word16)-import Data.HandleLike (HandleLike(..))+import Data.HandleLike (HandleLike(..), DebugHandle(..)) import System.IO (Handle) import "crypto-random" Crypto.Random (CPRG) @@ -78,7 +78,7 @@ else do (ct', b') <- getCont h unless (ct' == ct) . M.throw M.ALFtl M.ADUnk $ modNm ++ ".tRead: content type confliction\n"- when (BS.null b') $ M.throw M.ALFtl M.ADUnk $+ when (BS.null b') . M.throw M.ALFtl M.ADUnk $ modNm ++ ".tRead: no data available\n" M.setRBuf (pid h) (ct', b') (b `BS.append`) `liftM` tRead h n'@@ -278,6 +278,9 @@ ca = X509.ValidationCache (\_ _ _ -> return X509.ValidationCacheUnknown) (\_ _ _ -> return ())++instance ValidateHandle h => ValidateHandle (DebugHandle h) where+ validate (DebugHandle h _) = validate h debugCipherSuite :: HandleLike h => HandleBase h g -> String -> M.TlsM h g () debugCipherSuite h a = do
src/Network/PeyoTLS/Run/State.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, TupleSections, PackageImports #-}+{-# LANGUAGE OverloadedStrings, TupleSections #-} module Network.PeyoTLS.Run.State ( TlsState, initState, PartnerId, newPartner,@@ -49,7 +49,7 @@ modState f i s = s { states = (i, f $ getState i s) : states s } setState :: (a -> Modify (State1 g)) -> PartnerId -> a -> Modify (TlsState h g)-setState f i x s = modState (f x) i s+setState f i x = modState (f x) i data State1 g = State1 { settings :: Settings,