Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-tls for openSUSE:Factory checked in at 2026-12-03 13:57:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-tls (Old) and /work/SRC/openSUSE:Factory/.ghc-tls.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-tls" Thu Dec 3 13:57:25 2026 rev:50 rq:1402537 version:2.6.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-tls/ghc-tls.changes 2026-12-02 17:04:41.969811221 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-tls.new.1340718/ghc-tls.changes 2026-12-03 14:00:05.806320844 +0100 @@ -1,0 +2,13 @@ +Wed Dec 2 02:22:41 UTC 2026 - Peter Simons <[email protected]> + +- Update tls to version 2.6.5. + ## Version 2.6.5 + + * Throw a late alert of client authentication failure on the next receive. + [#703](https://github.com/haskell-tls/hs-tls/pull/703) + * Send TLS 1.3 ChangeCipherSpec of the client in one write with the next message. + [#704](https://github.com/haskell-tls/hs-tls/pull/704) + * Export VerifyData, which getFinished and getPeerFinished return. + [#705](https://github.com/haskell-tls/hs-tls/pull/705) + +------------------------------------------------------------------- Old: ---- tls-2.6.4.tar.gz New: ---- tls-2.6.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-tls.spec ++++++ --- /var/tmp/diff_new_pack.oaGbnQ/_old 2026-12-03 14:00:06.931368594 +0100 +++ /var/tmp/diff_new_pack.oaGbnQ/_new 2026-12-03 14:00:06.934368722 +0100 @@ -20,7 +20,7 @@ %bcond_with ghc_prof %bcond_with tests Name: ghc-%pkg_name -Version: 2.6.4 +Version: 2.6.5 Release: 0 %global pkgver %pkg_name-%{version} Summary: TLS protocol native implementation ++++++ tls-2.6.4.tar.gz -> tls-2.6.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/CHANGELOG.md new/tls-2.6.5/CHANGELOG.md --- old/tls-2.6.4/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,14 @@ # Change log for "tls" +## Version 2.6.5 + +* Throw a late alert of client authentication failure on the next receive. + [#703](https://github.com/haskell-tls/hs-tls/pull/703) +* Send TLS 1.3 ChangeCipherSpec of the client in one write with the next message. + [#704](https://github.com/haskell-tls/hs-tls/pull/704) +* Export VerifyData, which getFinished and getPeerFinished return. + [#705](https://github.com/haskell-tls/hs-tls/pull/705) + ## Version 2.6.4 * An interrupted receive breaks the receive side and wakes PHA waiters. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Context.hs new/tls-2.6.5/Network/TLS/Context.hs --- old/tls-2.6.4/Network/TLS/Context.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Context.hs 2001-09-09 03:46:40.000000000 +0200 @@ -269,13 +269,13 @@ contextHookSetLogging context loggingCallbacks = contextModifyHooks context (\hooks -> hooks{hookLogging = loggingCallbacks}) -{-# DEPRECATED getFinished "Use getTLSUnique instead" #-} +{-# DEPRECATED getFinished "Use getTLSUnique (TLS 1.2) or getTLSExporter (TLS 1.3) for channel binding" #-} -- | Getting TLS Finished sent to peer. getFinished :: Context -> IO (Maybe VerifyData) getFinished ctx = usingState_ ctx getMyVerifyData -{-# DEPRECATED getPeerFinished "Use getTLSUnique instead" #-} +{-# DEPRECATED getPeerFinished "Use getTLSUnique (TLS 1.2) or getTLSExporter (TLS 1.3) for channel binding" #-} -- | Getting TLS Finished received from peer. getPeerFinished :: Context -> IO (Maybe VerifyData) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Core.hs new/tls-2.6.5/Network/TLS/Core.hs --- old/tls-2.6.4/Network/TLS/Core.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Core.hs 2001-09-09 03:46:40.000000000 +0200 @@ -453,7 +453,7 @@ recvData ctx = liftIO $ do tls13 <- tls13orLater ctx withReadLock ctx $ do - checkValid ctx + checkValidOrPending ctx -- We protect with a read lock both reception and processing of the -- packet, because don't want another thread to receive a new packet -- before this one has been fully processed. @@ -476,11 +476,21 @@ tls13 <- tls13orLater ctx (giveUp', given) <- recording giveUp fmap join $ withReadLockGivingUp ctx giveUp $ do - checkValid ctx + checkValidOrPending ctx withRxGiveUp ctx (GiveUp giveUp' giveUp') $ (Right <$> if tls13 then recvData13 ctx else recvData12 ctx) `E.catch` \GaveUp -> given >>= maybe (E.throwIO GaveUp) (return . Left) +-- | 'checkValid', except that an error of the receive in the thread of +-- 'waitAuthFailure', such as an alert which also set EOF, is left for +-- 'recvData13' to throw. +checkValidOrPending :: Context -> IO () +checkValidOrPending ctx = do + pending <- tls13stPendingRecv <$> getTLS13State ctx + case pending of + PendingRecvError _ -> return () + _ -> checkValid ctx + recvData12 :: Context -> IO ByteString recvData12 ctx = do pending <- atomicModifyIORef' (ctxPendingAppData ctx) $ \xs -> ([], reverse xs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Handshake/Client/ClientHello.hs new/tls-2.6.5/Network/TLS/Handshake/Client/ClientHello.hs --- old/tls-2.6.4/Network/TLS/Handshake/Client/ClientHello.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Handshake/Client/ClientHello.hs 2001-09-09 03:46:40.000000000 +0200 @@ -9,6 +9,7 @@ ) where import qualified Control.Exception as E +import Control.Monad.IO.Class (liftIO) import Crypto.HPKE hiding (CipherText, PlainText) import Data.ByteArray (convert) import qualified Data.ByteArray as BA @@ -167,10 +168,15 @@ -- encodeUpdateTranscriptHash12 usingHState ctx $ setClientHello ch0 [] return ch0 - sendPacket12 ctx $ Handshake [ClientHello ch] [] - mEarlySecInfo <- case rtt0info of - Nothing -> return Nothing - Just info -> Just <$> getEarlySecretInfo info + -- One write with ChangeCipherSpec: a second one could wait for the + -- server's delayed ACK of the first. + mEarlySecInfo <- runPacketFlight ctx $ do + -- After HelloRetryRequest, it precedes the second ClientHello. + when (hrr && not (ctxQUICMode ctx)) $ sendChangeCipherSpec13 ctx + loadPacket12 ctx $ Handshake [ClientHello ch] [] + case rtt0info of + Nothing -> return Nothing + Just info -> Just <$> getEarlySecretInfo info unless hrr $ contextSync ctx $ SendClientHello mEarlySecInfo let sentExtensions = map (\(ExtensionRaw i _) -> i) extensions modifyTLS13State ctx $ \st -> st{tls13stSentExtensions = sentExtensions} @@ -383,12 +389,13 @@ usedHash = cHash choice -- Early data is protected with the first PSK. earlySecret : _ <- usingHState ctx getTLS13EarlySecrets - earlyKey <- calculateEarlySecret ctx choice (Right earlySecret) + earlyKey <- liftIO $ calculateEarlySecret ctx choice (Right earlySecret) let clientEarlySecret = pairClient earlyKey unless (ctxQUICMode ctx) $ do - runPacketFlight ctx $ sendChangeCipherSpec13 ctx - setTxRecordState ctx usedHash usedCipher clientEarlySecret - setEstablished ctx EarlyDataSending + sendChangeCipherSpec13 ctx + liftIO $ do + setTxRecordState ctx usedHash usedCipher clientEarlySecret + setEstablished ctx EarlyDataSending -- We set RTT0Sent even in quicMode usingHState ctx $ setTLS13RTT0Status RTT0Sent return $ EarlySecretInfo usedCipher clientEarlySecret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Handshake/Client/TLS13.hs new/tls-2.6.5/Network/TLS/Handshake/Client/TLS13.hs --- old/tls-2.6.4/Network/TLS/Handshake/Client/TLS13.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Handshake/Client/TLS13.hs 2001-09-09 03:46:40.000000000 +0200 @@ -327,14 +327,17 @@ -> IO () sendClientSecondFlight13' cparams ctx choice hkey rtt0accepted eexts = do hChSf <- transcriptHash ctx "CH..SF" - unless (ctxQUICMode ctx) $ - runPacketFlight ctx $ - sendChangeCipherSpec13 ctx - when (rtt0accepted && not (ctxQUICMode ctx)) $ - sendPacket13 ctx (Handshake13 [EndOfEarlyData13] []) + mcc <- clientChain cparams ctx let clientHandshakeSecret = triClient hkey - setTxRecordState ctx usedHash usedCipher clientHandshakeSecret - sendClientFlight13 cparams ctx usedHash clientHandshakeSecret + -- One write: a second one could wait for the server's delayed ACK of + -- the first, longer than the client waits for an alert of failure. + runPacketFlight ctx $ do + unless (ctxQUICMode ctx) $ do + sendChangeCipherSpec13 ctx + when rtt0accepted $ + loadPacket13 ctx (Handshake13 [EndOfEarlyData13] []) + liftIO $ setTxRecordState ctx usedHash usedCipher clientHandshakeSecret + loadClientFlight13 ctx usedHash clientHandshakeSecret mcc appKey <- switchToApplicationSecret hChSf let applicationSecret = triBase appKey setResumptionSecret applicationSecret @@ -375,20 +378,31 @@ sendClientFlight13 :: ClientParams -> Context -> Hash -> ClientTrafficSecret a -> IO () -sendClientFlight13 cparams ctx usedHash (ClientTrafficSecret baseKey) = do +sendClientFlight13 cparams ctx usedHash secret = do mcc <- clientChain cparams ctx - runPacketFlight ctx $ do - case mcc of - Nothing -> return () - Just cc -> do - reqtoken <- usingHState ctx getCertReqToken - certComp <- usingHState ctx getTLS13CertComp - loadClientData13 cc reqtoken certComp - rawFinished <- makeFinished ctx usedHash baseKey - loadPacket13 ctx $ Handshake13 [rawFinished] [] + runPacketFlight ctx $ loadClientFlight13 ctx usedHash secret mcc + +-- | Certificate, CertificateVerify if any, and Finished. +loadClientFlight13 + :: Monoid b + => Context + -> Hash + -> ClientTrafficSecret a + -> Maybe CertificateChain + -> PacketFlightM b () +loadClientFlight13 ctx usedHash (ClientTrafficSecret baseKey) mcc = do + case mcc of + Nothing -> return () + Just cc -> do + reqtoken <- usingHState ctx getCertReqToken + certComp <- usingHState ctx getTLS13CertComp + loadClientData13 cc reqtoken certComp + rawFinished <- makeFinished ctx usedHash baseKey + loadPacket13 ctx $ Handshake13 [rawFinished] [] when (isJust mcc) $ - modifyTLS13State ctx $ - \st -> st{tls13stSentClientCert = True} + liftIO $ + modifyTLS13State ctx $ + \st -> st{tls13stSentClientCert = True} where loadClientData13 chain (Just token) certComp = do let (CertificateChain certs) = chain diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Handshake/Client.hs new/tls-2.6.5/Network/TLS/Handshake/Client.hs --- old/tls-2.6.4/Network/TLS/Handshake/Client.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Handshake/Client.hs 2001-09-09 03:46:40.000000000 +0200 @@ -18,7 +18,6 @@ import Network.TLS.Handshake.Common13 import Network.TLS.Handshake.State import Network.TLS.Handshake.State13 -import Network.TLS.IO import Network.TLS.Imports import Network.TLS.Measurement import Network.TLS.Parameters @@ -171,7 +170,6 @@ usingHState ctx $ setTLS13HandshakeMode HelloRetryRequest clearTxRecordState ctx let cparams' = cparams{clientUseEarlyData = False} - runPacketFlight ctx $ sendChangeCipherSpec13 ctx clientSession <- tls13stSession <$> getTLS13State ctx -- RFC 8446 Sec 4.1.2: the second ClientHello MUST be identical -- to the first except for the specific listed changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/IO.hs new/tls-2.6.5/Network/TLS/IO.hs --- old/tls-2.6.4/Network/TLS/IO.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/IO.hs 2001-09-09 03:46:40.000000000 +0200 @@ -13,6 +13,7 @@ -- * Grouping multiple packets in the same flight PacketFlightM, runPacketFlight, + loadPacket12, loadPacket13, ) where @@ -253,6 +254,13 @@ let bss = build [] unless (null bss) $ recordSendBytes recordLayer ctx $ mconcat bss +loadPacket12 :: Monoid b => Context -> Packet -> PacketFlightM b () +loadPacket12 ctx pkt = PacketFlightM $ do + (recordLayer, ref) <- ask + liftIO $ do + bs <- writePacketBytes12 ctx recordLayer pkt + modifyIORef' ref (. (bs :)) + loadPacket13 :: Monoid b => Context -> Packet13 -> PacketFlightM b () loadPacket13 ctx pkt = PacketFlightM $ do (recordLayer, ref) <- ask diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS/Struct.hs new/tls-2.6.5/Network/TLS/Struct.hs --- old/tls-2.6.4/Network/TLS/Struct.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS/Struct.hs 2001-09-09 03:46:40.000000000 +0200 @@ -275,6 +275,9 @@ {-# DEPRECATED FinishedData "use VerifyData" #-} type FinishedData = ByteString +-- | The verify_data of a Finished message. +-- +-- Exported from "Network.TLS" since 2.6.5. newtype VerifyData = VerifyData ByteString deriving (Eq) instance Show VerifyData where show (VerifyData bs) = showBytesHex bs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/Network/TLS.hs new/tls-2.6.5/Network/TLS.hs --- old/tls-2.6.4/Network/TLS.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/Network/TLS.hs 2001-09-09 03:46:40.000000000 +0200 @@ -281,6 +281,7 @@ getTLSServerEndPoint, getFinished, getPeerFinished, + VerifyData (..), -- ** Modifying hooks in context Hooks, @@ -381,6 +382,7 @@ ServerRandom (..), TLSError (..), TLSException (..), + VerifyData (..), signatureSchemesForTLS13, supportedSignatureSchemes, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/test/HandshakeSpec.hs new/tls-2.6.5/test/HandshakeSpec.hs --- old/tls-2.6.4/test/HandshakeSpec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/test/HandshakeSpec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -10,7 +10,7 @@ takeMVar, threadDelay, ) -import Control.Concurrent.Async (concurrently_) +import Control.Concurrent.Async (concurrently_, withAsync) import qualified Control.Exception as E import Control.Monad import Crypto.Cipher.AES (AES128) @@ -180,6 +180,8 @@ it "refuses a custom DH prime outside the bounds of its size" $ handshake_dh_prime_size prop "can receive client authentication failure" handshake_client_auth_fail + it "reports a late TLS 1.3 client authentication failure on receive" $ + handshake13_client_auth_late_fail it "accepts an empty TLS 1.2 client certificate when the hook does" $ handshake_client_auth_empty TLS12 it "accepts an empty TLS 1.3 client certificate when the hook does" $ @@ -485,6 +487,8 @@ [P256] it "rejects a two-byte TLS 1.3 ChangeCipherSpec" $ malformed_ccs_unexpected TLS13 cipher13_AES_128_GCM_SHA256 [X25519] [X25519] + it "sends ChangeCipherSpec of TLS 1.3 with the next message" $ + handshake13_ccs_not_alone it "rejects a two-byte TLS 1.3 ChangeCipherSpec after HelloRetryRequest" $ malformed_ccs_unexpected TLS13 @@ -2000,6 +2004,42 @@ where validateChain _ _ = return (CertificateUsageReject CertificateRejectUnknownCA) +-- The rejection arrives after the client has stopped waiting for it, so +-- the client's handshake succeeds and the next receive gets the alert. +handshake13_client_auth_late_fail :: IO () +handshake13_client_auth_late_fail = do + let cipher = cipher13_AES_128_GCM_SHA256 + (clientParam, serverParam) <- + generate $ + arbitraryPairParamsWithVersionsAndCiphers + ([TLS13], [TLS13]) + ([cipher], [cipher]) + cred <- generate $ arbitraryClientCredential TLS13 + let clientParam' = + clientParam + { clientHooks = + (clientHooks clientParam) + { onCertificateRequest = \_ -> return $ Just cred + } + } + serverParam' = + serverParam + { serverWantClientCert = True + , serverHooks = + (serverHooks serverParam) + { onClientCertificate = \_ -> do + threadDelay 300000 + return (CertificateUsageReject CertificateRejectUnknownCA) + } + } + withPairContext (clientParam', serverParam') $ \(cCtx, sCtx) -> + withAsync (E.try (handshake sCtx) :: IO (Either TLSException ())) $ \_ -> do + timeout 5000000 (handshake cCtx) `shouldReturn` Just () + r <- timeout 5000000 $ E.try $ recvData cCtx + case r of + Just (Left (Terminated _ _ (Error_Protocol _ UnknownCa))) -> return () + _ -> expectationFailure $ "unexpected: " ++ show r + -------------------------------------------------------------- handshake_ems :: (EMSMode, EMSMode) -> IO () @@ -2905,6 +2945,65 @@ runTLS0RTT params2 RTT0 earlyData +-- A ChangeCipherSpec written alone makes the next write wait for the +-- peer's delayed ACK. The client sends it after HelloRetryRequest, with +-- its certificate, and with early data. +handshake13_ccs_not_alone :: IO () +handshake13_ccs_not_alone = do + (cli, srv) <- generate arbitraryPairParams13 + cred <- generate $ arbitraryClientCredential TLS13 + let cliSupported = + defaultSupported + { supportedCiphers = [cipher13_AES_128_GCM_SHA256] + , supportedGroups = [P256, X25519] + } + svrSupported = + defaultSupported + { supportedCiphers = [cipher13_AES_128_GCM_SHA256] + , supportedGroups = [X25519] + , supportedGroupsTLS13 = [[X25519]] + } + params0 = + ( cli + { clientSupported = cliSupported + , clientHooks = + (clientHooks cli){onCertificateRequest = \_ -> return $ Just cred} + } + , srv + { serverSupported = svrSupported + , serverWantClientCert = True + , serverHooks = + (serverHooks srv) + { onClientCertificate = \_ -> return CertificateUsageAccept + } + , serverEarlyDataSize = 2048 + } + ) + sessionRefs <- twoSessionRefs + let params = setPairParamsSessionManagers (twoSessionManagers sessionRefs) params0 + sent1 <- recordingClientSends params $ \(cCtx, sCtx) -> do + concurrently_ (handshake cCtx) (handshake sCtx) + concurrently_ (sendData sCtx "x") (recvDataAssert cCtx "x") + mmode <- (>>= infoTLS13HandshakeMode) <$> contextGetInformation cCtx + mmode `shouldBe` Just HelloRetryRequest + filter (== ccs) sent1 `shouldBe` [] + Just sessionParams <- readClientSessionRef sessionRefs + let (pc, ps) = setPairParamsSessionResuming sessionParams params + sent2 <- recordingClientSends (pc{clientUseEarlyData = True}, ps) $ \(cCtx, sCtx) -> do + concurrently_ + (handshake cCtx >> sendData cCtx "y" >> recvDataAssert cCtx "z") + (handshake sCtx >> recvDataAssert sCtx "y" >> sendData sCtx "z") + mmode <- (>>= infoTLS13HandshakeMode) <$> contextGetInformation cCtx + mmode `shouldBe` Just RTT0 + filter (== ccs) sent2 `shouldBe` [] + where + ccs = B.pack [20, 3, 3, 0, 1, 1] + recordingClientSends params body = do + ref <- newIORef [] + let wrap be = be{backendSend = \bs -> modifyIORef ref (bs :) >> backendSend be bs} + _ <- withPairContextWith (wrap, id) params body + reverse <$> readIORef ref + handshake13_0rtt_alpn :: IO () handshake13_0rtt_alpn = do (cli, srv) <- generate arbitraryPairParams13 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tls-2.6.4/tls.cabal new/tls-2.6.5/tls.cabal --- old/tls-2.6.4/tls.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/tls-2.6.5/tls.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 2.0 name: tls -version: 2.6.4 +version: 2.6.5 license: BSD3 license-file: LICENSE copyright: Vincent Hanquez <[email protected]>
