Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProofs of correctness of the TLS Handshake and corking state machine #565
Conversation
achudnov
and others
added some commits
Apr 4, 2017
jldodds
and others
added some commits
Aug 3, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
achudnov
Aug 8, 2017
Contributor
So, the change I proposed works. Here's the diff. I'll add it to the pull request if you agree.
diff --git a/tests/saw/spec/rfc-handshake.cry b/tests/saw/spec/rfc-handshake.cry
index f53bb68..a9dbfce 100644
--- a/tests/saw/spec/rfc-handshake.cry
+++ b/tests/saw/spec/rfc-handshake.cry
@@ -118,24 +118,18 @@ type Parameters = {keyExchange : KeyExchange
connectionParameters : connection -> Parameters -> Bit
connectionParameters conn params =
conn.server_can_send_ocsp == params.sendCertificateStatus
- /\ ((conn.key_exchange_eph /\ keyExchangeEphemeral params) \/
+ /\ ((conn.key_exchange_eph /\ ~keyExchangeNonEphemeral params /\ params.keyExchange != DH_anon) \/
(~conn.key_exchange_eph /\ keyExchangeNonEphemeral params))
/\ (conn.is_caching_enabled /\ ~conn.resume_from_cache) == params.sessionTicket
/\ (~params.includeSessionTicket) // s2n server does not issue tickets at this time
/\ (~params.renewSessionTicket) // s2n server does not issue tickets at this time
/\ conn.client_auth_flag == params.requestClientCert
-// A predicate that tells whether key-exchange is non-ephemeral (doesn't use
-// Diffie-Hellman key exchange). In this case the key exchange algorithm does not
-// require KeyExchange messages.
+// A predicate that tells whether key-exchange is non-ephemeral and uses server certificate
+// data for exchanging a premaster secret (RFC 5246 7.4.3). In this case the key exchange
+// algorithm does not require KeyExchange messages.
keyExchangeNonEphemeral : Parameters -> Bit
-keyExchangeNonEphemeral params = params.keyExchange == RSA \/ params.keyExchange == DH_DSS \/ params.keyExchange == DH_RSA //
-
-// A predicate that tells whether key-exchange is ephemeral (uses Diffie-Hellman
-// key exchange). In this case the key exchange algorithm does not require
-// KeyExchange messages.
-keyExchangeEphemeral : Parameters -> Bit
-keyExchangeEphemeral params = params.keyExchange == DHE_DSS \/ params.keyExchange == DHE_RSA
+keyExchangeNonEphemeral params = params.keyExchange == RSA \/ params.keyExchange == DH_DSS \/ params.keyExchange == DH_RSA
// Handshake state transition relation per the RFCs. Given handshake parameters
// and a handshake state, return the next state. If there is no valid next state,|
So, the change I proposed works. Here's the diff. I'll add it to the pull request if you agree. diff --git a/tests/saw/spec/rfc-handshake.cry b/tests/saw/spec/rfc-handshake.cry
index f53bb68..a9dbfce 100644
--- a/tests/saw/spec/rfc-handshake.cry
+++ b/tests/saw/spec/rfc-handshake.cry
@@ -118,24 +118,18 @@ type Parameters = {keyExchange : KeyExchange
connectionParameters : connection -> Parameters -> Bit
connectionParameters conn params =
conn.server_can_send_ocsp == params.sendCertificateStatus
- /\ ((conn.key_exchange_eph /\ keyExchangeEphemeral params) \/
+ /\ ((conn.key_exchange_eph /\ ~keyExchangeNonEphemeral params /\ params.keyExchange != DH_anon) \/
(~conn.key_exchange_eph /\ keyExchangeNonEphemeral params))
/\ (conn.is_caching_enabled /\ ~conn.resume_from_cache) == params.sessionTicket
/\ (~params.includeSessionTicket) // s2n server does not issue tickets at this time
/\ (~params.renewSessionTicket) // s2n server does not issue tickets at this time
/\ conn.client_auth_flag == params.requestClientCert
-// A predicate that tells whether key-exchange is non-ephemeral (doesn't use
-// Diffie-Hellman key exchange). In this case the key exchange algorithm does not
-// require KeyExchange messages.
+// A predicate that tells whether key-exchange is non-ephemeral and uses server certificate
+// data for exchanging a premaster secret (RFC 5246 7.4.3). In this case the key exchange
+// algorithm does not require KeyExchange messages.
keyExchangeNonEphemeral : Parameters -> Bit
-keyExchangeNonEphemeral params = params.keyExchange == RSA \/ params.keyExchange == DH_DSS \/ params.keyExchange == DH_RSA //
-
-// A predicate that tells whether key-exchange is ephemeral (uses Diffie-Hellman
-// key exchange). In this case the key exchange algorithm does not require
-// KeyExchange messages.
-keyExchangeEphemeral : Parameters -> Bit
-keyExchangeEphemeral params = params.keyExchange == DHE_DSS \/ params.keyExchange == DHE_RSA
+keyExchangeNonEphemeral params = params.keyExchange == RSA \/ params.keyExchange == DH_DSS \/ params.keyExchange == DH_RSA
// Handshake state transition relation per the RFCs. Given handshake parameters
// and a handshake state, return the next state. If there is no valid next state, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
achudnov
Aug 14, 2017
Contributor
@alexw91, have you had a chance to look at the changes I proposed and whether they address your concerns? Have you had any more thoughts about the pull request?
|
@alexw91, have you had a chance to look at the changes I proposed and whether they address your concerns? Have you had any more thoughts about the pull request? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Yes, it looks good to me. Thanks! :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
achudnov
Aug 16, 2017
Contributor
The changes in 7b9c88d broke the proofs about handshake. We're investigating what could be done about it.
|
The changes in 7b9c88d broke the proofs about handshake. We're investigating what could be done about it. |
achudnov
and others
added some commits
Aug 16, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jldodds
Aug 23, 2017
Contributor
We have fully updated the proofs for the TLS modifications. I also did a somewhat involved travis.yml merge, which probably needs examination before this PR is accepted
|
We have fully updated the proofs for the TLS modifications. I also did a somewhat involved travis.yml merge, which probably needs examination before this PR is accepted |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -0,0 +1,78 @@ | ||
| (* This file has been taken from https://github.com/PrincetonUniversity/VST/blob/master/hmacfcf/HMAC_spec.v *) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexw91
Aug 24, 2017
Member
We may need to get approval to ensure we're following https://github.com/PrincetonUniversity/VST/blob/master/LICENSE
alexw91
Aug 24, 2017
Member
We may need to get approval to ensure we're following https://github.com/PrincetonUniversity/VST/blob/master/LICENSE
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jldodds
Aug 24, 2017
Contributor
I've added the license file to this directory. The Princeton authors are also aware of this inclusion and approve of it, happy to get written approval if necessary.
jldodds
Aug 24, 2017
Contributor
I've added the license file to this directory. The Princeton authors are also aware of this inclusion and approve of it, happy to get written approval if necessary.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexw91
Aug 25, 2017
Member
Please confirm this contribution is under the terms of the BSD 2 clause license. Thanks. :)
alexw91
Aug 25, 2017
•
Member
Please confirm this contribution is under the terms of the BSD 2 clause license. Thanks. :)
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jldodds
Aug 28, 2017
Contributor
Confirmed. I've also updated the licence to contain the appropriate author notice.
jldodds
Aug 28, 2017
Contributor
Confirmed. I've also updated the licence to contain the appropriate author notice.
jldodds
added some commits
Aug 24, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jldodds
Aug 28, 2017
Contributor
From what I can tell, the Travis errors are some external dependency timing out. It is likely these will cause problems the next time any build is run, so it might be worth looking into now.
|
From what I can tell, the Travis errors are some external dependency timing out. It is likely these will cause problems the next time any build is run, so it might be worth looking into now. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexw91
Aug 28, 2017
Member
Yeah, it looks like the ct-verif build is failing here: https://github.com/awslabs/s2n/blob/master/.travis/install_ctverif_dependencies.sh#L29-L30 since http://llvm-apt.ecranbleu.org/apt/trusty/ seems to be down.
|
Yeah, it looks like the ct-verif build is failing here: https://github.com/awslabs/s2n/blob/master/.travis/install_ctverif_dependencies.sh#L29-L30 since http://llvm-apt.ecranbleu.org/apt/trusty/ seems to be down. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Build Passes. Merging. :) |
achudnov commentedAug 7, 2017
This pull request contains:
s2nhandshake state machine with respect to theTLS 1.2handshake model andIETF RFCs 5246,5077and6066.Makefileand Travis CI integration for these new proofss2nHMACA few key files:
saw handshake.saworsaw cork-uncork.sawCryptolspecifications in s2n_handshake_io.crys2n's HMAC implementation.CC: @colmmacc, @smagill, @atomb, @jldodds .