packages feed

tls 2.1.7 → 2.1.8

raw patch · 10 files changed

+26/−21 lines, 10 files

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Change log for "tls" +## Version 2.1.8++* Moving `Limit` to `Shared` to maintain backward compatibility+  of `TLSParams` class.+* Deprecating 2.1.7.+ ## Version 2.1.7  * Introducing `Limit` parameter.
Network/TLS.hs view
@@ -50,7 +50,6 @@     clientHooks,     clientSupported,     clientDebug,-    clientLimit,     clientUseEarlyData,      -- ** Server parameters@@ -63,7 +62,6 @@     serverShared,     serverSupported,     serverDebug,-    serverLimit,     serverEarlyDataSize,     serverTicketLifetime, @@ -75,6 +73,7 @@     sharedCAStore,     sharedValidationCache,     sharedHelloExtensions,+    sharedLimit,      -- ** Client hooks     ClientHooks,
Network/TLS/Context.hs view
@@ -118,7 +118,6 @@         ( clientSupported cparams         , clientShared cparams         , clientDebug cparams-        , clientLimit cparams         )     getTLSRole _ = ClientRole     doHandshake = handshakeClient@@ -131,7 +130,6 @@         ( serverSupported sparams         , serverShared sparams         , serverDebug sparams-        , serverLimit sparams         )     getTLSRole _ = ServerRole     doHandshake = handshakeServer@@ -150,7 +148,7 @@ contextNew backend params = liftIO $ do     initializeBackend backend -    let (supported, shared, debug, limit) = getTLSCommonParams params+    let (supported, shared, debug) = getTLSCommonParams params      seed <- case debugSeed debug of         Nothing -> do@@ -192,7 +190,6 @@                 { ctxBackend = getBackend backend                 , ctxShared = shared                 , ctxSupported = supported-                , ctxLimit = limit                 , ctxTLSState = tlsstate                 , ctxMyRecordLimit = mylimref                 , ctxPeerRecordLimit = peerlimref
Network/TLS/Context/Internal.hs view
@@ -117,7 +117,6 @@     -- ^ return the backend object associated with this context     , ctxSupported :: Supported     , ctxShared :: Shared-    , ctxLimit :: Limit     , ctxTLSState :: MVar TLSState     , ctxMeasurement :: IORef Measurement     , ctxEOF_ :: IORef Bool
Network/TLS/Handshake/Client/ClientHello.hs view
@@ -89,7 +89,7 @@     let cipherIds = map (CipherId . cipherID) ciphers         compIds = map compressionID compressions         mkClientHello exts = ClientHello ver crand compIds $ CH clientSession cipherIds exts-    setMyRecordLimit ctx $ limitRecordSize $ clientLimit cparams+    setMyRecordLimit ctx $ limitRecordSize $ sharedLimit $ clientShared cparams     extensions0 <- catMaybes <$> getExtensions     let extensions1 = sharedHelloExtensions (clientShared cparams) ++ extensions0     extensions <- adjustExtentions extensions1 $ mkClientHello extensions1@@ -183,7 +183,7 @@      compCertExt = return $ Just $ toExtensionRaw (CompressCertificate [CCA_Zlib]) -    recordSizeLimitExt = case limitRecordSize $ clientLimit cparams of+    recordSizeLimitExt = case limitRecordSize $ sharedLimit $ clientShared cparams of         Nothing -> return Nothing         Just siz -> return $ Just $ toExtensionRaw $ RecordSizeLimit $ fromIntegral siz 
Network/TLS/Handshake/Client/ServerHello.hs view
@@ -149,7 +149,7 @@         then do             -- Session is dummy in TLS 1.3.             usingState_ ctx $ setSession serverSession-            processRecordSizeLimit ctx shExts True+            processRecordSizeLimit cparams ctx shExts True             enableMyRecordLimit ctx             enablePeerRecordLimit ctx             updateContext13 ctx cipherAlg@@ -162,7 +162,7 @@             usingState_ ctx $ do                 setSession serverSession                 setTLS12SessionResuming $ isJust resumingSession-            processRecordSizeLimit ctx shExts False+            processRecordSizeLimit cparams ctx shExts False             updateContext12 ctx shExts resumingSession processServerHello _ _ p = unexpected (show p) (Just "server hello") @@ -219,9 +219,9 @@ ----------------------------------------------------------------  processRecordSizeLimit-    :: Context -> [ExtensionRaw] -> Bool -> IO ()-processRecordSizeLimit ctx shExts tls13 = do-    let mmylim = limitRecordSize $ ctxLimit ctx+    :: ClientParams -> Context -> [ExtensionRaw] -> Bool -> IO ()+processRecordSizeLimit cparams ctx shExts tls13 = do+    let mmylim = limitRecordSize $ sharedLimit $ clientShared cparams     case mmylim of         Nothing -> return ()         Just mylim -> do
Network/TLS/Handshake/Server/Common.hs view
@@ -185,7 +185,7 @@ processRecordSizeLimit     :: Context -> [ExtensionRaw] -> Bool -> IO (Maybe ExtensionRaw) processRecordSizeLimit ctx chExts tls13 = do-    let mmylim = limitRecordSize $ ctxLimit ctx+    let mmylim = limitRecordSize $ sharedLimit $ ctxShared ctx     setMyRecordLimit ctx mmylim     case mmylim of         Nothing -> return Nothing
Network/TLS/IO.hs view
@@ -27,6 +27,7 @@ import Network.TLS.IO.Decode import Network.TLS.IO.Encode import Network.TLS.Imports+import Network.TLS.Parameters import Network.TLS.Record import Network.TLS.State import Network.TLS.Struct@@ -87,7 +88,7 @@ recvPacket12 :: Context -> IO (Either TLSError Packet) recvPacket12 ctx@Context{ctxRecordLayer = recordLayer} = loop 0   where-    lim = limitHandshakeFragment $ ctxLimit ctx+    lim = limitHandshakeFragment $ sharedLimit $ ctxShared ctx     loop count         | count > lim = do             let err = Error_Packet "too many handshake fragment"@@ -140,7 +141,7 @@ recvPacket13 :: Context -> IO (Either TLSError Packet13) recvPacket13 ctx@Context{ctxRecordLayer = recordLayer} = loop 0   where-    lim = limitHandshakeFragment $ ctxLimit ctx+    lim = limitHandshakeFragment $ sharedLimit $ ctxShared ctx     loop count         | count > lim =             return $ Left $ Error_Packet "too many handshake fragment"
Network/TLS/Parameters.hs view
@@ -46,7 +46,7 @@ import Network.TLS.Types (HostName) import Network.TLS.X509 -type CommonParams = (Supported, Shared, DebugParams, Limit)+type CommonParams = (Supported, Shared, DebugParams)  -- | All settings should not be used in production data DebugParams = DebugParams@@ -142,7 +142,6 @@     -- is automatically re-sent.     --     -- Default: 'False'-    , clientLimit :: Limit     }     deriving (Show) @@ -160,7 +159,6 @@         , clientSupported = def         , clientDebug = defaultDebugParams         , clientUseEarlyData = False-        , clientLimit = defaultLimit         }  data ServerParams = ServerParams@@ -418,6 +416,10 @@     -- based on the TLS version.     --     -- Default: @[]@+    , sharedLimit :: Limit+    -- ^ Limitation parameters.+    --+    -- @since 2.1.8     }  instance Show Shared where@@ -433,6 +435,7 @@         , sharedCAStore = mempty         , sharedValidationCache = def         , sharedHelloExtensions = []+        , sharedLimit = defaultLimit         }  -- | Group usage callback possible return values.
tls.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               tls-version:            2.1.7+version:            2.1.8 license:            BSD3 license-file:       LICENSE copyright:          Vincent Hanquez <vincent@snarc.org>