-
Notifications
You must be signed in to change notification settings - Fork 56
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
Update harness for aws_cryptosdk_enc_ctx_clone #611
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7707cba
Make c-common a submodule for verification, and update the CBMC makef…
danielsn 4b96898
Update c-common to latest, and update the makefile to match
danielsn cf4e7d8
fixed keyring_trace_add_record_buf and keyring_on_encrypt
danielsn 90c4f6a
push c-common again, and fix makefile for aws_gcm_decypt
danielsn f03a664
Merge remote-tracking branch 'upstream/master' into update-c-common
tegansb 57e7799
Merge remote-tracking branch 'upstream/master' into update-c-common
tegansb 575610f
Update enc_ctx_clone harness and Makefile, additional assumptions, ne…
tegansb e32a09e
Merge branch 'cbmc-flags-upgrade' of https://github.com/aws/aws-encry…
tegansb d8c5b1c
Updated harness to use malloc
tegansb d169da6
update time in Makefile and remove unneeded assumptions
tegansb 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,24 @@ | |
#include <proof_helpers/proof_allocators.h> | ||
#include <proof_helpers/utils.h> | ||
|
||
void make_hash_table_with_no_backing_store(struct aws_hash_table *map, size_t max_table_entries); | ||
|
||
/** | ||
* The actual proof | ||
*/ | ||
void aws_cryptosdk_enc_ctx_clone_harness() { | ||
struct aws_hash_table dest; | ||
make_hash_table_with_no_backing_store(&dest, MAX_NUM_ELEMS); | ||
__CPROVER_assume(aws_hash_table_is_valid(&dest)); | ||
/* Nondet Input */ | ||
struct aws_hash_table *dest = malloc(sizeof(*dest)); | ||
struct aws_hash_table *src = malloc(sizeof(*src)); | ||
|
||
/* Assumptions */ | ||
ensure_allocated_hash_table(dest, MAX_TABLE_SIZE); | ||
__CPROVER_assume(aws_hash_table_is_valid(dest)); | ||
__CPROVER_assume(dest->p_impl != NULL); | ||
__CPROVER_assume(dest->p_impl->entry_count <= MAX_TABLE_SIZE); | ||
ensure_hash_table_has_valid_destroy_functions(dest); | ||
|
||
struct aws_hash_table src; | ||
make_hash_table_with_no_backing_store(&src, MAX_NUM_ELEMS); | ||
__CPROVER_assume(aws_hash_table_is_valid(&src)); | ||
ensure_allocated_hash_table(src, MAX_TABLE_SIZE); | ||
__CPROVER_assume(aws_hash_table_is_valid(src)); | ||
__CPROVER_assume(src->p_impl != NULL); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? Can it be valid with a null impl? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, not needed! It's removed now |
||
__CPROVER_assume(src->p_impl->entry_count <= MAX_TABLE_SIZE); | ||
ensure_hash_table_has_valid_destroy_functions(src); | ||
|
||
int rval = aws_cryptosdk_enc_ctx_clone(can_fail_allocator(), &dest, &src); | ||
/* Operation under verification */ | ||
int rval = aws_cryptosdk_enc_ctx_clone(can_fail_allocator(), dest, src); | ||
danielsn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
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 assume this changes the time? Why was this necessary?
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.
Before, there was both a MAX_NUM_ELEMS and a MAX_TABLE_SIZE, so I just stuck with MAX_TABLE_SIZE (which was always 2). I've just run it locally, and setting MAX_TABLE_SIZE to 4 is fine. The proof isn't horribly slow so 4 would be fine.
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.
Is the time comment still correct?