-
Notifications
You must be signed in to change notification settings - Fork 707
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
Proofs of correctness of the TLS Handshake and corking state machine #565
Merged
Merged
Changes from 110 commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
9c4e980
Change compiler flags to generate debug information in
achudnov 619f4ba
First version of the cork/uncork correctness proof.
achudnov 6d0e4a9
Preliminary integration of cork/uncork proofs
achudnov 329f0b8
Temporarily disable optimizations when generating bitcodes for
achudnov 047ae67
remove the cork-uncork proof&build scripts from top-level. They've be…
achudnov a900030
Cleaning up and adding comments to the cork/uncork model programs
achudnov 8e6e963
Better name for the low-level model spec function. Documentation for
achudnov e64b4a8
More comments in the proof script
achudnov e329e15
Finish documenting the correctness property
achudnov 6ae5161
Relax precondition, change the low-level spec to match the
achudnov 1bc11c9
Added a proof with an expected failure that can serve as a negative
achudnov 4e856ba
Draft of the handshake spec based on RFC 5246 and relation the the s2n
achudnov 709250d
Fixed a typo and added more comments
achudnov 7d7600b
Amended the state relation
achudnov ca0fd4c
Simulation relation property between a s2n-level and rfc-level
achudnov 9b00504
Added the session ticket state machine per RFC 5077
achudnov cd1c1d4
Added handshake state machine simulation proof (WIP) to the saw-scrip…
achudnov 0484223
Make the prover output more information
achudnov 9503aad
Split the states to have a more precise state machine
achudnov 3173efc
Added a predicate to tell if a connection value is valid
achudnov db15e72
Refactoring of the handshake state machine simulation relation encoding
achudnov f72afcc
Added state machine transitions for OCSP per RFC 6066
achudnov bdc3b8a
Reformulate the correspondence property to deal with existentially
achudnov 9ed124c
Fix the correspondence to make the proof go through
achudnov aac8111
Use abc instead of z3.
achudnov be0571e
Refactored the RFC spec to be more readable
achudnov 8b8706b
Additional comments
achudnov 3c9244f
WIP porting cork-uncork proof to Crucible.
achudnov 24cb883
Change bitcode build process to avoid instructions problematic for Cr…
achudnov 0ad9452
Further build fixes to make the bitcode load in SAW
achudnov 510b489
Split out the low-level specifications for s2n_handshake_io.c in a
achudnov f1f36c2
Working proof of correspondence between s2n_advance_message and its
achudnov 1d8647d
Connected the low-level correspondence proof to the cork-uncork and
achudnov accfa4f
Advice SAW to use Yices for code correspondence proofs
achudnov a1fb113
Extra comments in the proof script
achudnov 435e8de
added a spec for set_handshake_type
jldodds b1f2579
typechecking, but not yet run proof for extended handshake proof
jldodds 1fb3e07
Resolve merge conflict with ghost corking state.
achudnov 928c134
working proof of set_handshake_type
jldodds 1c45912
makefile cleanup
jldodds 488d225
Extended the high-level specification with transition predicates.
achudnov 2690b15
makefile work
jldodds 3dee208
patch for ccs failure, not working due to modified code in amazon repo
jldodds cde3190
Merge branch 'master' into handshake-verification
jldodds 44d99bc
removed code update that has now been replaced with ghost code
jldodds bdda52e
Generating traces of message types for the low-level model of the S2N
achudnov b8717fd
Adapt the low-level correspondence SAW proof script to the new
achudnov 98e0eae
WIP new simulation relation and proof for the handshake state machines
achudnov cd95c8e
Refactoring the simulation relation
achudnov f8f2f02
Normalization of message sequences after APPLICATION_DATA to help with
achudnov beb7030
Remove the corking state tracking instrumentation from socket
achudnov 5b38745
Proposed fix for the handshake state machine in OCSP cases
achudnov d658713
Fix the high-low relation
achudnov 1c63c11
WIP debugging low-level correspondence proof for handshake
achudnov 0b925e5
More debug messages
achudnov b8a8207
brought proofs up to date with Amazon code
jldodds 25a8832
merging the updated proofs for the tip of upstream
achudnov e24a912
Update the relation between 'connection' and 'Parameters' to reflect
achudnov 2209830
Comment
achudnov 866be8a
New state machine bug: missing SM branch for CLIENT_AUTH | OCSP | FUL…
achudnov 911823f
Fix for the second state machine bug.
achudnov 7472cec
Update the cork-uncork proof script
achudnov f948bf9
failure test now working
jldodds c51cb0c
ignore ll files in the bitcode directory
jldodds 2f2cd9a
bring formatting in line with the formatting in the rest of the code
achudnov f57cfcc
Merge branch 'handshake-verification' of github.com:galoisInc/s2n int…
achudnov abd661e
Formatting (stray TAB).
achudnov eb05841
make the cork-uncork failure test pass
jldodds dbd3919
Merge branch 'handshake-verification' of github.com:GaloisInc/s2n int…
jldodds 726f73a
WIP porting handshake proofs to use struct field names instead of ind…
achudnov 5faf4f6
Merge branch 'master' into handshake-verification
achudnov a960b26
Field 3 of s2n_config should be ocsp_status
glguy 8230acb
Merge branch 'field-names' into handshake-verification
achudnov 598d516
clean up the proof script
achudnov 786a2fd
increased the sequence length in the cork/uncork proof to 16
achudnov cdc844a
Richer formulation of the cork/uncork property.
achudnov 61e931f
Debugging
achudnov 851b4df
Merge branch 'feature/fips' of github.com:awslabs/s2n into merge-fips
jldodds a2a6373
Tighter cork/uncork spec and proof
achudnov 93af2f4
Removing debug info
achudnov 2925cb1
Renamed spec/s2n_advance_message.cry to spec/s2n_handshake_io.cry
achudnov 0914799
Merge branch 'master' of github.com:galoisInc/s2n
achudnov bb434aa
another failure test case
jldodds 5d8af77
Merge branch 'master' of github.com:awslabs/s2n into merge-master
jldodds 30bb208
Merge branch 'master' into merge-fips
jldodds 7c35292
Merge branch 'master' into merge-master
jldodds f5187b2
add back g option to makefile
jldodds b448da3
removed a negative test case that has been invalidated by
jldodds 881e9df
fixed negative test cases
jldodds 9ab2ba9
is g option causing travis problems
jldodds fe0b849
coq verification of cryptol HMAC equivalent to Appel's HMAC spec
sliverdragon37 8701eaa
print clang version on travis
jldodds 34a9e14
try latest clang for md5
jldodds 83537f8
put new clang on path
jldodds 4ee05fb
print clang version after updating path
jldodds e0ecd34
try it with apt
jldodds b2237a4
typo
jldodds 96ef9ee
another typo
jldodds 90cc42e
fix the build
jldodds a6fbeb7
Merge remote-tracking branch 'origin/hmac_coq_verif'
jldodds 2445b59
Merge branch 'merge-master'
jldodds 1e6908e
Formatting and better comments for the TLS Handshake and corking
achudnov 663f832
Merge branch 'master' of github.com:galoisInc/s2n
achudnov 9d21607
Simplify the RFC-derived handshake specification: remove the
achudnov 71e4ed6
Merge branch 'master' of https://github.com/awslabs/s2n
achudnov 937a4b2
WIP adapting low-level spec to the changes in the code
achudnov 2f9c90b
quick fix for recent update to s2n
jldodds 91487eb
full proofs for updated handshake
jldodds b429c23
Merge branch 'master' of github.com:awslabs/s2n
jldodds 56b2bc2
add saw tests back in to travis
jldodds e91b146
added FCF license
jldodds f6e65a6
added more information to the cryptol semantics hmac directory
jldodds 3df1870
make README markdown
jldodds 76b364a
readme fix
jldodds d81a9e4
updated fcf licencse
jldodds 32d3c58
added back an allowed failure
jldodds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.bc | ||
*.bc | ||
*.ll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
include ../../../s2n.mk | ||
|
||
BCS=$(wildcard *.bc) | ||
|
||
all_llvm.bc : $(BCS) | ||
$(LLVMLINK) -o $@ $+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Entry point for the corking correctness proof. | ||
import "spec/cork-uncork.cry"; | ||
include "s2n_handshake_io.saw"; | ||
|
||
//prove correspondence of the C code and the low-level model | ||
s2n_handshake_io_lowlevel; | ||
print "Verified that the low-level specification corresponds to the C code"; | ||
//prove correspondence of the high-level and low-level models | ||
prove_print abc {{ highLevelSimulatesLowLevel `{16} }}; | ||
print "Verified the low-level->high-level cork-uncork simulation"; | ||
//prove no-double-uncork property for server mode | ||
prove_print abc {{ noDoubleCorkUncork }}; | ||
print "Verified that double uncorking or corking cannot occur in server mode"; | ||
//(for the record) evidence that a double uncork can occur in client mode | ||
print "Expecting failure when proving low-high simulation without the server mode assumption"; | ||
sat abc {{ ~highLevelDoesNotSimulateLowLevel `{16} }}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/tls/s2n_handshake_io.c b/tls/s2n_handshake_io.c | ||
index fd9eb0d..51f4c53 100644 | ||
--- a/tls/s2n_handshake_io.c | ||
+++ b/tls/s2n_handshake_io.c | ||
@@ -242,6 +242,7 @@ static int s2n_advance_message(struct s2n_connection *conn) | ||
if (s2n_connection_is_managed_corked(conn)) { | ||
/* Set TCP_CORK/NOPUSH */ | ||
GUARD(s2n_socket_write_cork(conn)); | ||
+ GUARD(s2n_socket_write_cork(conn)); | ||
} | ||
|
||
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/tls/s2n_handshake_io.c b/tls/s2n_handshake_io.c | ||
index fd9eb0d..11734ac 100644 | ||
--- a/tls/s2n_handshake_io.c | ||
+++ b/tls/s2n_handshake_io.c | ||
@@ -242,6 +242,7 @@ static int s2n_advance_message(struct s2n_connection *conn) | ||
if (s2n_connection_is_managed_corked(conn)) { | ||
/* Set TCP_CORK/NOPUSH */ | ||
GUARD(s2n_socket_write_cork(conn)); | ||
+ GUARD(s2n_socket_write_uncork(conn)); | ||
} | ||
|
||
return 0; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Binary files s2n/.git/index and s2n2/.git/index differ | ||
diff -p1 -Nur s2n/tls/s2n_handshake_io.c s2n2/tls/s2n_handshake_io.c | ||
--- s2n/tls/s2n_handshake_io.c 2017-07-14 15:29:09.806626239 -0700 | ||
+++ s2n2/tls/s2n_handshake_io.c 2017-07-19 11:17:13.347220835 -0700 | ||
@@ -106,3 +106,3 @@ static message_type_t handshakes[64][16] | ||
CLIENT_HELLO, | ||
- SERVER_HELLO, SERVER_CERT, SERVER_HELLO_DONE, | ||
+ SERVER_HELLO, CLIENT_CHANGE_CIPHER_SPEC, SERVER_CERT, SERVER_HELLO_DONE, | ||
CLIENT_KEY, CLIENT_CHANGE_CIPHER_SPEC, CLIENT_FINISHED, |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should have been removed from the allowed_failures list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed and fixed. I got mixed up with the line in exclude on the merge.
As an additional note, I've switched over all of our runs to including the exact configuration rather than putting them on the matrix and then excluding the configurations I don't want. This should work for that configuration as well, to save a few lines of Travis configuration.