quic 0.2.13 → 0.2.14
raw patch · 6 files changed
+30/−12 lines, 6 filesdep ~tls
Dependency ranges changed: tls
Files
- ChangeLog.md +7/−0
- Network/QUIC/Config.hs +2/−2
- Network/QUIC/Server/Reader.hs +10/−7
- Network/QUIC/Types/CID.hs +8/−0
- quic.cabal +2/−2
- util/Common.hs +1/−1
ChangeLog.md view
@@ -1,8 +1,15 @@ # ChangeLog +## 0.2.14++* Supporting SSLKEYLOGFILE.+* Supporting zer-length CID in the server side.+ [#78](https://github.com/kazu-yamamoto/quic/pull/78)+ ## 0.2.13 * Necessary transport parameters are now stored in ResumptionInfo.+ [#76](https://github.com/kazu-yamamoto/quic/pull/76) ## 0.2.12
Network/QUIC/Config.hs view
@@ -116,7 +116,7 @@ , ccCiphers = supportedCiphers defaultSupported , ccGroups = supportedGroups defaultSupported , ccParameters = defaultParameters- , ccKeyLog = \_ -> return ()+ , ccKeyLog = defaultKeyLogger , ccQLog = Nothing , ccCredentials = mempty , ccHooks = defaultHooks@@ -176,7 +176,7 @@ , scCiphers = supportedCiphers defaultSupported , scGroups = supportedGroups defaultSupported , scParameters = defaultParameters- , scKeyLog = \_ -> return ()+ , scKeyLog = defaultKeyLogger , scQLog = Nothing , scCredentials = mempty , scHooks = defaultHooks
Network/QUIC/Server/Reader.hs view
@@ -111,11 +111,12 @@ newRecvQDict :: IO RecvQDict newRecvQDict = RecvQDict <$> LRUCache.newLRUCacheRef recvQDictSize -lookupRecvQDict :: RecvQDict -> CID -> IO (RecvQ, Bool)-lookupRecvQDict (RecvQDict ref) dcid = LRUCache.cached ref dcid newRecvQ+-- Looking up and insert a new RecvQ if not exist.+lookupInsertRecvQDict :: RecvQDict -> CID -> IO (RecvQ, Bool)+lookupInsertRecvQDict (RecvQDict ref) dcid = LRUCache.cached ref dcid newRecvQ -lookupRecvQDict' :: RecvQDict -> CID -> IO (Maybe RecvQ)-lookupRecvQDict' (RecvQDict ref) dcid = LRUCache.cached' ref dcid+lookupRecvQDict :: RecvQDict -> CID -> IO (Maybe RecvQ)+lookupRecvQDict (RecvQDict ref) dcid = LRUCache.cached' ref dcid ---------------------------------------------------------------- @@ -262,7 +263,8 @@ where myVersions = scVersions pushToAcceptQ myAuthCIDs peerAuthCIDs addrValid = do- (q, exist) <- lookupRecvQDict srcTable sCID+ let key = nonZeroLengthCID sCID peersa+ (q, exist) <- lookupInsertRecvQDict srcTable key writeRecvQ q $ mkReceivedPacket cpkt tim siz lvl unless exist $ do let reg = registerConnectionDict dstTable@@ -355,12 +357,13 @@ _ _ _mysock- _peersa+ peersa _ _ tim (cpkt@(CryptPacket (RTT0 _ _dCID sCID) _), lvl, siz) = do- mq <- lookupRecvQDict' srcTable sCID+ let key = nonZeroLengthCID sCID peersa+ mq <- lookupRecvQDict srcTable key case mq of Just q -> writeRecvQ q $ mkReceivedPacket cpkt tim siz lvl Nothing -> return ()
Network/QUIC/Types/CID.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-} module Network.QUIC.Types.CID ( CID (..),@@ -8,6 +9,7 @@ toCID, makeCID, unpackCID,+ nonZeroLengthCID, StatelessResetToken (..), fromStatelessResetToken, makeGenStatelessReset,@@ -23,8 +25,10 @@ import Codec.Serialise import Crypto.Hash import Crypto.KDF.HKDF+import qualified Data.ByteString.Char8 as C8 import qualified Data.ByteString.Short as Short import GHC.Generics+import Network.Socket (SockAddr) import System.Random (getStdRandom, uniformByteString) import Network.QUIC.Imports@@ -57,6 +61,10 @@ unpackCID (CID sbs) = (sbs, len) where len = fromIntegral $ Short.length sbs++nonZeroLengthCID :: CID -> SockAddr -> CID+nonZeroLengthCID (CID "") sa = toCID $ C8.pack $ show sa+nonZeroLengthCID x _ = x -- 16 bytes newtype StatelessResetToken = StatelessResetToken Bytes deriving (Eq, Ord)
quic.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: quic-version: 0.2.13+version: 0.2.14 license: BSD3 license-file: LICENSE maintainer: kazu@iij.ad.jp@@ -148,7 +148,7 @@ random >=1.3 && <1.4, serialise, stm >=2.5 && <2.6,- tls >=2.1.6 && <2.2,+ tls >=2.1.10 && <2.2, unix-time >=0.4.12 && <0.5 if os(linux)
util/Common.hs view
@@ -41,7 +41,7 @@ (s', r) -> s' : split c (drop 1 r) getLogger :: Maybe FilePath -> (String -> IO ())-getLogger Nothing = \_ -> return ()+getLogger Nothing = defaultKeyLogger getLogger (Just file) = \msg -> appendFile file (msg ++ "\n") makeProtos :: Version -> (ByteString, ByteString)