Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing Extra.Cipher is not necessary anymore #471

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions tls/Network/TLS/Extra/Cipher.hs
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,12 @@ sortDeterministic = concatMap f
-- hardware-acceleration support. If this dynamic runtime behavior is not
-- desired, use 'ciphersuite_default_det' instead.
ciphersuite_default :: [Cipher]
ciphersuite_default = sortOptimized sets_default
ciphersuite_default = ciphersuite_strong

-- | Same as 'ciphersuite_default', but using deterministic preference not
-- influenced by the CPU.
ciphersuite_default_det :: [Cipher]
ciphersuite_default_det = sortDeterministic sets_default

sets_default :: [CipherSet]
sets_default =
[ -- First the PFS + GCM + SHA2 ciphers
SetAead
[cipher_ECDHE_ECDSA_AES128GCM_SHA256, cipher_ECDHE_ECDSA_AES256GCM_SHA384]
[cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256]
[cipher_ECDHE_ECDSA_AES128CCM_SHA256, cipher_ECDHE_ECDSA_AES256CCM_SHA256]
, SetAead
[cipher_ECDHE_RSA_AES128GCM_SHA256, cipher_ECDHE_RSA_AES256GCM_SHA384]
[cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256]
[]
, -- TLS13 (listed at the end but version is negotiated first)
SetAead
[cipher_TLS13_AES128GCM_SHA256, cipher_TLS13_AES256GCM_SHA384]
[cipher_TLS13_CHACHA20POLY1305_SHA256]
[cipher_TLS13_AES128CCM_SHA256]
]
ciphersuite_default_det = ciphersuite_strong_det

----------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion tls/Network/TLS/Parameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Network.TLS.Compression
import Network.TLS.Credentials
import Network.TLS.Crypto
import Network.TLS.Extension
import Network.TLS.Extra.Cipher
import Network.TLS.Imports
import Network.TLS.Measurement
import Network.TLS.RNG (Seed)
Expand Down Expand Up @@ -331,7 +332,7 @@ defaultSupported :: Supported
defaultSupported =
Supported
{ supportedVersions = [TLS13, TLS12]
, supportedCiphers = []
, supportedCiphers = ciphersuite_default
, supportedCompressions = [nullCompression]
, supportedHashSignatures = Struct.supportedSignatureSchemes
, supportedSecureRenegotiation = True
Expand Down
4 changes: 1 addition & 3 deletions tls/util/tls-client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Data.X509.CertificateStore
import Network.Run.TCP
import Network.Socket
import Network.TLS
import Network.TLS.Extra.Cipher
import System.Console.GetOpt
import System.Environment
import System.Exit
Expand Down Expand Up @@ -293,8 +292,7 @@ getClientParams vers serverName port groups sm mstore keyLog =
}
supported =
def
{ supportedCiphers = ciphersuite_strong
, supportedVersions = vers
{ supportedVersions = vers
, supportedGroups = groups
}
hooks =
Expand Down
4 changes: 1 addition & 3 deletions tls/util/tls-server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Data.IORef
import qualified Data.Map.Strict as M
import Network.Run.TCP
import Network.TLS
import Network.TLS.Extra.Cipher
import System.Console.GetOpt
import System.Environment (getArgs)
import System.Exit
Expand Down Expand Up @@ -133,8 +132,7 @@ getServerParams creds sm keyLog =
}
supported =
def
{ supportedCiphers = ciphersuite_strong
, supportedGroups = [X25519, X448, P256, P521]
{ supportedGroups = [X25519, X448, P256, P521]
}
hooks = def{onALPNClientSuggest = Just chooseALPN}
debug = def{debugKeyLogger = keyLog}
Expand Down
Loading