From 50e0b4c4863fe36f8e2cc703019a49c41e630a4c Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 6 Dec 2023 15:58:26 +0900 Subject: [PATCH] fourmolu --- core/Network/TLS/Extra/Cipher.hs | 1 + core/test/Arbitrary.hs | 2 -- core/test/HandshakeSpec.hs | 13 ++++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/Network/TLS/Extra/Cipher.hs b/core/Network/TLS/Extra/Cipher.hs index f6311be03..7b4ea51f1 100644 --- a/core/Network/TLS/Extra/Cipher.hs +++ b/core/Network/TLS/Extra/Cipher.hs @@ -562,6 +562,7 @@ cipher_ECDHE_ECDSA_AES256CCM8_SHA256 = , cipherKeyExchange = CipherKeyExchange_ECDHE_ECDSA , cipherMinVer = Just TLS12 -- RFC 7251 } + ---------------------------------------------------------------- -- RFC 7905 diff --git a/core/test/Arbitrary.hs b/core/test/Arbitrary.hs index c10e133ab..4fb275b6b 100644 --- a/core/test/Arbitrary.hs +++ b/core/test/Arbitrary.hs @@ -197,7 +197,6 @@ arbitraryCredentialsOfEachType' :: Gen [(CertificateChain, PrivKey)] arbitraryCredentialsOfEachType' = do let (pubKey, privKey) = getGlobalRSAPair curveName = defaultECCurve --- (dsaPub, dsaPriv) <- arbitraryDSAPair (ecdsaPub, ecdsaPriv) <- arbitraryECDSAPair curveName (ed25519Pub, ed25519Priv) <- arbitraryEd25519Pair (ed448Pub, ed448Priv) <- arbitraryEd448Pair @@ -207,7 +206,6 @@ arbitraryCredentialsOfEachType' = do return (CertificateChain [cert], priv) ) [ (PubKeyRSA pubKey, PrivKeyRSA privKey) --- , (PubKeyDSA dsaPub, PrivKeyDSA dsaPriv) , (toPubKeyEC curveName ecdsaPub, toPrivKeyEC curveName ecdsaPriv) , (PubKeyEd25519 ed25519Pub, PrivKeyEd25519 ed25519Priv) , (PubKeyEd448 ed448Pub, PrivKeyEd448 ed448Priv) diff --git a/core/test/HandshakeSpec.hs b/core/test/HandshakeSpec.hs index b96e63a47..b8886355b 100644 --- a/core/test/HandshakeSpec.hs +++ b/core/test/HandshakeSpec.hs @@ -36,7 +36,9 @@ spec = do prop "can negotiate group" handshake_groups prop "can negotiate elliptic curve" handshake_ec prop "can fallback for certificate with cipher" handshake_cert_fallback_cipher - prop "can fallback for certificate with hash and signature" handshake_cert_fallback_hs + prop + "can fallback for certificate with hash and signature" + handshake_cert_fallback_hs prop "can handle server key usage" handshake_server_key_usage prop "can handle client key usage" handshake_client_key_usage prop "can authenticate client" handshake_client_auth @@ -291,7 +293,7 @@ instance Arbitrary OC where ] handshake_cert_fallback_cipher :: OC -> IO () -handshake_cert_fallback_cipher (OC clientCiphers serverCiphers)= do +handshake_cert_fallback_cipher (OC clientCiphers serverCiphers) = do let clientVersions = [TLS12] serverVersions = [TLS12] commonCiphers = [cipher_ECDHE_RSA_AES128GCM_SHA256] @@ -329,7 +331,8 @@ handshake_cert_fallback_cipher (OC clientCiphers serverCiphers)= do -- the library, which is useful to test this scenario. SHA-1 could be replaced -- by another algorithm. -data OHS = OHS [HashAndSignatureAlgorithm] [HashAndSignatureAlgorithm] deriving (Show) +data OHS = OHS [HashAndSignatureAlgorithm] [HashAndSignatureAlgorithm] + deriving (Show) instance Arbitrary OHS where arbitrary = OHS <$> sublistOf otherHS <*> sublistOf otherHS @@ -337,7 +340,7 @@ instance Arbitrary OHS where otherHS = [(HashIntrinsic, SignatureEd25519)] handshake_cert_fallback_hs :: OHS -> IO () -handshake_cert_fallback_hs (OHS clientHS serverHS)= do +handshake_cert_fallback_hs (OHS clientHS serverHS) = do tls13 <- generate arbitrary let versions = if tls13 then [TLS13] else [TLS12] ciphers = @@ -477,7 +480,7 @@ handshake_ems (cems, sems) = do then runTLSInitFailure params' else runTLSPipePredicate params' (maybe False p) -newtype CompatEMS = CompatEMS (EMSMode,EMSMode) deriving (Show) +newtype CompatEMS = CompatEMS (EMSMode, EMSMode) deriving (Show) instance Arbitrary CompatEMS where arbitrary = CompatEMS <$> (arbitrary `suchThat` compatible)