packages feed

quic 0.1.12 → 0.1.13

raw patch · 9 files changed

+41/−13 lines, 9 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Network.QUIC.Internal: [outputQ1] :: Connection -> OutputQ1
+ Network.QUIC.Internal: putOutput1 :: Connection -> Output -> IO ()
+ Network.QUIC.Internal: sendFrames1 :: Connection -> EncryptionLevel -> [Frame] -> IO ()
+ Network.QUIC.Internal: takeOutput1STM :: Connection -> STM Output
+ Network.QUIC.Internal: type OutputQ1 = TBQueue Output
- Network.QUIC.Internal: Connection :: ConnState -> DebugLogger -> QLogger -> Hooks -> ~Send -> ~Recv -> RecvQ -> ~IORef UDPSocket -> IORef (IO ()) -> ThreadId -> Rate -> IORef RoleInfo -> IORef VersionInfo -> VersionInfo -> Parameters -> IORef CIDDB -> IORef Parameters -> TVar CIDDB -> InputQ -> CryptoQ -> OutputQ -> MigrationQ -> Shared -> IORef Int -> IORef (IO ()) -> IORef PacketNumber -> IORef StreamTable -> TVar Concurrency -> TVar Concurrency -> IORef Concurrency -> IORef Concurrency -> TVar TxFlow -> IORef RxFlow -> TVar MigrationState -> IORef Microseconds -> TVar Int -> TVar Int -> TVar Bool -> Array EncryptionLevel (TVar [ReceivedPacket]) -> IOArray EncryptionLevel Cipher -> IOArray EncryptionLevel Coder -> IOArray Bool Coder1RTT -> IOArray EncryptionLevel Protector -> IORef (Bool, PacketNumber) -> IORef Negotiated -> IORef AuthCIDs -> IORef AuthCIDs -> IORef (IO ()) -> Buffer -> SizedBuffer -> Buffer -> LDCC -> Connection
+ Network.QUIC.Internal: Connection :: ConnState -> DebugLogger -> QLogger -> Hooks -> ~Send -> ~Recv -> RecvQ -> ~IORef UDPSocket -> IORef (IO ()) -> ThreadId -> Rate -> IORef RoleInfo -> IORef VersionInfo -> VersionInfo -> Parameters -> IORef CIDDB -> IORef Parameters -> TVar CIDDB -> InputQ -> CryptoQ -> OutputQ -> OutputQ1 -> MigrationQ -> Shared -> IORef Int -> IORef (IO ()) -> IORef PacketNumber -> IORef StreamTable -> TVar Concurrency -> TVar Concurrency -> IORef Concurrency -> IORef Concurrency -> TVar TxFlow -> IORef RxFlow -> TVar MigrationState -> IORef Microseconds -> TVar Int -> TVar Int -> TVar Bool -> Array EncryptionLevel (TVar [ReceivedPacket]) -> IOArray EncryptionLevel Cipher -> IOArray EncryptionLevel Coder -> IOArray Bool Coder1RTT -> IOArray EncryptionLevel Protector -> IORef (Bool, PacketNumber) -> IORef Negotiated -> IORef AuthCIDs -> IORef AuthCIDs -> IORef (IO ()) -> Buffer -> SizedBuffer -> Buffer -> LDCC -> Connection
- Network.QUIC.Internal: SendChallenge :: [PathData] -> MigrationState
+ Network.QUIC.Internal: SendChallenge :: PathData -> MigrationState

Files

ChangeLog.md view
@@ -1,3 +1,11 @@+## 0.1.13++- Garding the path_request attack.++## 0.1.12++- Fixing build.+ ## 0.1.11  - Rescuing GHC 8.10, 9.0 and 9.2.
Network/QUIC/Connection/Migration.hs view
@@ -273,21 +273,21 @@ validatePath :: Connection -> Maybe CIDInfo -> IO () validatePath conn Nothing = do     pdat <- newPathData-    setChallenges conn [pdat]+    setChallenges conn pdat     putOutput conn $ OutControl RTT1Level [PathChallenge pdat] $ return ()     waitResponse conn validatePath conn (Just (CIDInfo retiredSeqNum _ _)) = do     pdat <- newPathData-    setChallenges conn [pdat]+    setChallenges conn pdat     putOutput conn $         OutControl RTT1Level [PathChallenge pdat, RetireConnectionID retiredSeqNum] $             return ()     waitResponse conn     retirePeerCID conn retiredSeqNum -setChallenges :: Connection -> [PathData] -> IO ()-setChallenges Connection{..} pdats =-    atomically $ writeTVar migrationState $ SendChallenge pdats+setChallenges :: Connection -> PathData -> IO ()+setChallenges Connection{..} pdat =+    atomically $ writeTVar migrationState $ SendChallenge pdat  setMigrationStarted :: Connection -> IO () setMigrationStarted Connection{..} =@@ -311,6 +311,6 @@ checkResponse Connection{..} pdat = do     state <- readTVarIO migrationState     case state of-        SendChallenge pdats-            | pdat `elem` pdats -> atomically $ writeTVar migrationState RecvResponse+        SendChallenge pdat'+            | pdat == pdat' -> atomically $ writeTVar migrationState RecvResponse         _ -> return ()
Network/QUIC/Connection/Misc.hs view
@@ -26,6 +26,7 @@     readMinIdleTimeout,     setMinIdleTimeout,     sendFrames,+    sendFrames1,     closeConnection,     abortConnection, ) where@@ -174,6 +175,9 @@  sendFrames :: Connection -> EncryptionLevel -> [Frame] -> IO () sendFrames conn lvl frames = putOutput conn $ OutControl lvl frames $ return ()++sendFrames1 :: Connection -> EncryptionLevel -> [Frame] -> IO ()+sendFrames1 conn lvl frames = putOutput1 conn $ OutControl lvl frames $ return ()  -- | Closing a connection with/without a transport error. --   Internal threads should use this.
Network/QUIC/Connection/Queue.hs view
@@ -3,6 +3,7 @@ import UnliftIO.STM  import Network.QUIC.Connection.Types+import Network.QUIC.Imports import Network.QUIC.Stream import Network.QUIC.Types @@ -29,6 +30,15 @@  putOutput :: Connection -> Output -> IO () putOutput conn out = atomically $ writeTQueue (outputQ conn) out++putOutput1 :: Connection -> Output -> IO ()+putOutput1 conn out = atomically $ do+    ok <- isEmptyTBQueue (outputQ1 conn)+    -- unless ok, the frames are intentionally dropped.+    when ok $ writeTBQueue (outputQ1 conn) out++takeOutput1STM :: Connection -> STM Output+takeOutput1STM conn = readTBQueue (outputQ1 conn)  ---------------------------------------------------------------- 
Network/QUIC/Connection/Types.hs view
@@ -100,7 +100,7 @@ data MigrationState     = NonMigration     | MigrationStarted-    | SendChallenge [PathData]+    | SendChallenge PathData     | RecvResponse     deriving (Eq, Show) @@ -218,6 +218,7 @@       inputQ :: InputQ     , cryptoQ :: CryptoQ     , outputQ :: OutputQ+    , outputQ1 :: OutputQ1     , migrationQ :: MigrationQ     , shared :: Shared     , delayedAckCount :: IORef Int@@ -318,6 +319,7 @@         <*> newTQueueIO         <*> newTQueueIO         <*> return outQ+        <*> newTBQueueIO 1         <*> newTQueueIO         <*> newShared         <*> newIORef 0@@ -416,6 +418,7 @@ type InputQ = TQueue Input type CryptoQ = TQueue Crypto type OutputQ = TQueue Output+type OutputQ1 = TBQueue Output type MigrationQ = TQueue ReceivedPacket  ----------------------------------------------------------------
Network/QUIC/Receiver.hs view
@@ -381,7 +381,7 @@                 unregister <- getUnregister conn                 unregister cid processFrame conn RTT1Level (PathChallenge dat) =-    sendFrames conn RTT1Level [PathResponse dat]+    sendFrames1 conn RTT1Level [PathResponse dat] processFrame conn RTT1Level (PathResponse dat) =     -- RTT0Level falls intentionally     checkResponse conn dat
Network/QUIC/Sender.hs view
@@ -229,6 +229,7 @@         atomically             ( (SwPing <$> takePingSTM (connLDCC conn))                 `orElse` (SwOut <$> takeOutputSTM conn)+                `orElse` (SwOut <$> takeOutput1STM conn)                 `orElse` (SwStrm <$> takeSendStreamQSTM conn)             )     case x of
Network/QUIC/Types/Frame.hs view
@@ -107,7 +107,9 @@ inFlight _                    = True  rateControled :: Frame -> Bool-rateControled ResetStream{} = True-rateControled StopSending{} = True-rateControled _             = False+rateControled ResetStream{}   = True+rateControled StopSending{}   = True+rateControled PathChallenge{} = True+rateControled PathResponse{}  = True+rateControled _               = False {- FOURMOLU_ENABLE -}
quic.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               quic-version:            0.1.12+version:            0.1.13 license:            BSD3 license-file:       LICENSE maintainer:         kazu@iij.ad.jp