tls 2.1.4 → 2.1.5
raw patch · 4 files changed
+70/−6 lines, 4 filesdep ~async
Dependency ranges changed: async
Files
- CHANGELOG.md +6/−0
- Network/TLS/Extra/Cipher.hs +54/−0
- Network/TLS/Util.hs +9/−4
- tls.cabal +1/−2
CHANGELOG.md view
@@ -1,3 +1,9 @@+## Version 2.1.5++* Removing the dependency on the async package.+* Restore a few DHE_RSA ciphers.+ [#493](https://github.com/haskell-tls/hs-tls/pull/493)+ ## Version 2.1.4 * Exporting defaultValidationCache.
Network/TLS/Extra/Cipher.hs view
@@ -6,8 +6,12 @@ ciphersuite_all_det, ciphersuite_strong, ciphersuite_strong_det,+ ciphersuite_dhe_rsa, -- * individual ciphers+ cipher_DHE_RSA_AES128GCM_SHA256,+ cipher_DHE_RSA_AES256GCM_SHA384,+ cipher_DHE_RSA_CHACHA20POLY1305_SHA256, cipher_ECDHE_RSA_AES128GCM_SHA256, cipher_ECDHE_RSA_AES256GCM_SHA384, cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256,@@ -270,6 +274,17 @@ [cipher_TLS13_AES128CCM_SHA256] ] +-- | DHE-RSA cipher suite. This only includes ciphers bound specifically to+-- DHE-RSA so TLS 1.3 ciphers must be added separately.+--+-- @since 2.1.5+ciphersuite_dhe_rsa :: [Cipher]+ciphersuite_dhe_rsa =+ [ cipher_DHE_RSA_AES256GCM_SHA384+ , cipher_DHE_RSA_CHACHA20POLY1305_SHA256+ , cipher_DHE_RSA_AES128GCM_SHA256+ ]+ ---------------------------------------------------------------- bulk_aes128ccm :: Bulk@@ -375,6 +390,33 @@ -- https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4 ----------------------------------------------------------------+-- RFC 5288++cipher_DHE_RSA_AES128GCM_SHA256 :: Cipher+cipher_DHE_RSA_AES128GCM_SHA256 =+ Cipher+ { cipherID = 0x009E+ , cipherName = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"+ , cipherBulk = bulk_aes128gcm+ , cipherHash = SHA256+ , cipherPRFHash = Just SHA256+ , cipherKeyExchange = CipherKeyExchange_DHE_RSA+ , cipherMinVer = Just TLS12 -- RFC 5288 Sec 4+ }++cipher_DHE_RSA_AES256GCM_SHA384 :: Cipher+cipher_DHE_RSA_AES256GCM_SHA384 =+ Cipher+ { cipherID = 0x009F+ , cipherName = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"+ , cipherBulk = bulk_aes256gcm+ , cipherHash = SHA384+ , cipherPRFHash = Just SHA384+ , cipherKeyExchange = CipherKeyExchange_DHE_RSA+ , cipherMinVer = Just TLS12+ }++---------------------------------------------------------------- -- RFC 8446 cipher_TLS13_AES128GCM_SHA256 :: Cipher@@ -563,5 +605,17 @@ , cipherHash = SHA256 , cipherPRFHash = Just SHA256 , cipherKeyExchange = CipherKeyExchange_ECDHE_ECDSA+ , cipherMinVer = Just TLS12+ }++cipher_DHE_RSA_CHACHA20POLY1305_SHA256 :: Cipher+cipher_DHE_RSA_CHACHA20POLY1305_SHA256 =+ Cipher+ { cipherID = 0xCCAA+ , cipherName = "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256"+ , cipherBulk = bulk_chacha20poly1305+ , cipherHash = SHA256+ , cipherPRFHash = Just SHA256+ , cipherKeyExchange = CipherKeyExchange_DHE_RSA , cipherMinVer = Just TLS12 }
Network/TLS/Util.hs view
@@ -19,9 +19,9 @@ import qualified Data.ByteString as B import Network.TLS.Imports -import Control.Concurrent.Async import Control.Concurrent.MVar-import Control.Exception (SomeException)+import Control.Exception (SomeAsyncException (..))+import qualified Control.Exception as E sub :: ByteString -> Int -> Int -> Maybe ByteString sub b offset len@@ -69,8 +69,13 @@ fmapEither :: (a -> b) -> Either l a -> Either l b fmapEither f = fmap f -catchException :: IO a -> (SomeException -> IO a) -> IO a-catchException action handler = withAsync action waitCatch >>= either handler return+catchException :: IO a -> (E.SomeException -> IO a) -> IO a+catchException f handler = E.catchJust filterExn f handler+ where+ filterExn :: E.SomeException -> Maybe E.SomeException+ filterExn e = case E.fromException (E.toException e) of+ Just (SomeAsyncException _) -> Nothing+ Nothing -> Just e forEitherM :: Monad m => [a] -> (a -> m (Either l b)) -> m (Either l [b]) forEitherM [] _ = return (pure [])
tls.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: tls-version: 2.1.4+version: 2.1.5 license: BSD3 license-file: LICENSE copyright: Vincent Hanquez <vincent@snarc.org>@@ -114,7 +114,6 @@ base >=4.9 && <5, asn1-encoding >= 0.9 && < 0.10, asn1-types >= 0.3 && < 0.4,- async >= 2.2 && < 2.3, base16-bytestring, bytestring >= 0.10 && < 0.13, cereal >= 0.5.3 && < 0.6,