Skip to content

Commit

Permalink
adding a test case for downgrade protection.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Nov 13, 2018
1 parent 935bc06 commit d6f37ec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/Tests/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ prop_handshake_keyupdate = do
params <- pick arbitraryPairParams
runTLSPipeSimpleKeyUpdate params

prop_handshake13_downgrade :: PropertyM IO ()
prop_handshake13_downgrade = do
(cparam,sparam) <- pick arbitraryPairParams13
let debug' = (serverDebug sparam) { debugVersion = Just TLS12 }
sparam' = sparam { serverDebug = debug' }
runTLSInitFailure (cparam,sparam')

prop_handshake13_full :: PropertyM IO ()
prop_handshake13_full = do
(cli, srv) <- pick arbitraryPairParams13
Expand Down Expand Up @@ -644,6 +651,7 @@ main = defaultMain $ testGroup "tls"
, testProperty "Initiation" (monadicIO prop_handshake_initiate)
, testProperty "Initiation 1.3" (monadicIO prop_handshake13_initiate)
, testProperty "Key update 1.3" (monadicIO prop_handshake_keyupdate)
, testProperty "Downgrade protection" (monadicIO prop_handshake13_downgrade)
, testProperty "Hash and signatures" (monadicIO prop_handshake_hashsignatures)
, testProperty "Cipher suites" (monadicIO prop_handshake_ciphersuites)
, testProperty "Groups" (monadicIO prop_handshake_groups)
Expand Down

0 comments on commit d6f37ec

Please sign in to comment.