Skip to content
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

Add CBMC proof for default_cmm_generate_enc_materials #656

Merged
merged 14 commits into from
Jan 6, 2021

Conversation

adpaco-aws
Copy link
Collaborator

This PR adds a CBMC proof for default_cmm_generate_enc_materials, a function from default_cmm.c,

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@adpaco-aws adpaco-aws force-pushed the default-materials-proof branch 5 times, most recently from 22aa393 to 33b1cd1 Compare December 4, 2020 10:46
@adpaco-aws adpaco-aws marked this pull request as ready for review December 4, 2020 11:31
Copy link
Contributor

@alex-chew alex-chew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending the comment about the aws_cryptosdk_alg_props(alg_id) validity assertion.

@feliperodri feliperodri added the cbmc CBMC proof related work label Dec 7, 2020
Comment on lines 40 to 41
AWS_PRECONDITION(cmm != NULL);
AWS_PRECONDITION(output != NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we check for the validity functions of aws_cryptosdk_cmm and aws_cryptosdk_enc_materials, respectively?

Copy link
Collaborator Author

@adpaco-aws adpaco-aws Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function, output is just a placeholder for encryption materials so we are okay with them not being valid (@alex-chew please correct me if I am wrong). I have added the validator function for it but we can discuss it further.

For aws_cryptosdk_cmm we now have validator function for default_cmm.

Edit: The test suite seems to fail if we add more complex preconditions for output, so I am using the previous version (non-null check).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct that output is an out parameter for the generated encryption materials, and at the start of the function it is typically not the case that **output is a valid encryption materials struct. A stronger precondition that would make sense might be to assert that output is writable for sizeof(*output) bytes.

Comment on lines 21 to 24
# Local vars
MAX_NUM_ITEMS ?= 1
# In OBJ_txt2nid, this value unwinds strcmp(s, "prime256v1")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

PROOF_SOURCES += $(PROOF_SOURCE)/make_common_data_structures.c
PROOF_SOURCES += $(PROOF_STUB)/aws_base64_encode.c

REMOVE_FUNCTION_BODY += aws_base64_encode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Could you add a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was not required. Thanks for catching it!

Comment on lines 23 to 63
int on_encrypt(
struct aws_cryptosdk_keyring *keyring,
struct aws_allocator *request_alloc,
struct aws_byte_buf *unencrypted_data_key,
struct aws_array_list *keyring_trace,
struct aws_array_list *edks,
const struct aws_hash_table *enc_ctx,
enum aws_cryptosdk_alg_id alg) {
/* Check validity for all inputs to avoid memory-safety violations. */
assert(aws_cryptosdk_keyring_is_valid(keyring));
assert(aws_allocator_is_valid(request_alloc));
assert(aws_byte_buf_is_valid(unencrypted_data_key));
assert(aws_cryptosdk_keyring_trace_is_valid(keyring_trace));
assert(aws_cryptosdk_edk_list_is_valid(edks));
assert(aws_cryptosdk_edk_list_elements_are_valid(edks));
assert((enc_ctx == NULL) || aws_hash_table_is_valid(enc_ctx));

if (unencrypted_data_key->buffer == NULL) {
const struct aws_cryptosdk_alg_properties *props = aws_cryptosdk_alg_props(alg);
if (props != NULL) {
__CPROVER_assume(aws_byte_buf_is_bounded(unencrypted_data_key, props->data_key_len));
ensure_byte_buf_has_allocated_buffer_member(unencrypted_data_key);
/*
* This satisfies the post-condition that if this keyring
* generated data key, it must be the right length.
* The nondeterminism increases coverage.
*/
if (nondet_bool()) unencrypted_data_key->len = props->data_key_len;
unencrypted_data_key->allocator = request_alloc;
__CPROVER_assume(aws_byte_buf_is_valid(unencrypted_data_key));
}
} else {
/*
* If the buffer is not NULL, the byte buffer must not have been modified;
* however, this allocation modifies the buffer and increases coverage.
*/
if (nondet_bool()) ensure_byte_buf_has_allocated_buffer_member(unencrypted_data_key);
}
int ret;
return ret;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function here? Is it a stub? If so, we need to move it to the stub folder and add proper header documentation, which must say "why" we may need this stub.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember other proofs might do the same, do you think we could just use one on_encrypt implementation across them all?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I have put this function into the stubs folder.


void default_cmm_generate_enc_materials_harness() {
/* Nondet input required to init cmm */
struct aws_cryptosdk_keyring *keyring = malloc(sizeof(*keyring));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allocator should contain this initial allocation.

void default_cmm_generate_enc_materials_harness() {
/* Nondet input required to init cmm */
struct aws_cryptosdk_keyring *keyring = malloc(sizeof(*keyring));
const struct aws_cryptosdk_keyring_vt vtable = { .vt_size = sizeof(struct aws_cryptosdk_keyring_vt),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we have a non-deterministic number here? Does this assumption maps into an assertion into the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have it now.

__CPROVER_assume(keyring->vtable != NULL);

/* Nondet input */
struct aws_cryptosdk_cmm *cmm = aws_cryptosdk_default_cmm_new(can_fail_allocator(), keyring);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you calling aws_cryptosdk_default_cmm_new to initialize cmm? This should only be done by allocators and validity functions. Any extra requirements should be add as an assumption and mapped as an assertion into the codebase.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created a new allocator function for default_cmm (which is an extension of cmm). We are not using this function anymore.

Comment on lines 80 to 48
struct aws_cryptosdk_enc_materials **output = malloc(sizeof(*output));
struct aws_cryptosdk_enc_request *request = malloc(sizeof(*request));

/* Assumptions */
__CPROVER_assume(cmm != NULL);

__CPROVER_assume(output != NULL);

__CPROVER_assume(request != NULL);
request->alloc = can_fail_allocator();
__CPROVER_assume(aws_allocator_is_valid(request->alloc));
request->enc_ctx = malloc(sizeof(*request->enc_ctx));
__CPROVER_assume(request->enc_ctx != NULL);
ensure_allocated_hash_table(request->enc_ctx, MAX_NUM_ITEMS);
__CPROVER_assume(aws_cryptosdk_enc_request_is_valid(request));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the allocators functions for aws_cryptosdk_enc_materials and aws_cryptosdk_enc_request?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added them.

@feliperodri
Copy link
Collaborator

/cbmc run checks

Copy link
Collaborator Author

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I had this PR almost updated but I wanted to inspect some stuff in detail. We have a new solution which includes as much feedback from you when possible.

Comment on lines 40 to 41
AWS_PRECONDITION(cmm != NULL);
AWS_PRECONDITION(output != NULL);
Copy link
Collaborator Author

@adpaco-aws adpaco-aws Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function, output is just a placeholder for encryption materials so we are okay with them not being valid (@alex-chew please correct me if I am wrong). I have added the validator function for it but we can discuss it further.

For aws_cryptosdk_cmm we now have validator function for default_cmm.

Edit: The test suite seems to fail if we add more complex preconditions for output, so I am using the previous version (non-null check).

Comment on lines 21 to 24
# Local vars
MAX_NUM_ITEMS ?= 1
# In OBJ_txt2nid, this value unwinds strcmp(s, "prime256v1")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

PROOF_SOURCES += $(PROOF_SOURCE)/make_common_data_structures.c
PROOF_SOURCES += $(PROOF_STUB)/aws_base64_encode.c

REMOVE_FUNCTION_BODY += aws_base64_encode
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was not required. Thanks for catching it!

Comment on lines 23 to 63
int on_encrypt(
struct aws_cryptosdk_keyring *keyring,
struct aws_allocator *request_alloc,
struct aws_byte_buf *unencrypted_data_key,
struct aws_array_list *keyring_trace,
struct aws_array_list *edks,
const struct aws_hash_table *enc_ctx,
enum aws_cryptosdk_alg_id alg) {
/* Check validity for all inputs to avoid memory-safety violations. */
assert(aws_cryptosdk_keyring_is_valid(keyring));
assert(aws_allocator_is_valid(request_alloc));
assert(aws_byte_buf_is_valid(unencrypted_data_key));
assert(aws_cryptosdk_keyring_trace_is_valid(keyring_trace));
assert(aws_cryptosdk_edk_list_is_valid(edks));
assert(aws_cryptosdk_edk_list_elements_are_valid(edks));
assert((enc_ctx == NULL) || aws_hash_table_is_valid(enc_ctx));

if (unencrypted_data_key->buffer == NULL) {
const struct aws_cryptosdk_alg_properties *props = aws_cryptosdk_alg_props(alg);
if (props != NULL) {
__CPROVER_assume(aws_byte_buf_is_bounded(unencrypted_data_key, props->data_key_len));
ensure_byte_buf_has_allocated_buffer_member(unencrypted_data_key);
/*
* This satisfies the post-condition that if this keyring
* generated data key, it must be the right length.
* The nondeterminism increases coverage.
*/
if (nondet_bool()) unencrypted_data_key->len = props->data_key_len;
unencrypted_data_key->allocator = request_alloc;
__CPROVER_assume(aws_byte_buf_is_valid(unencrypted_data_key));
}
} else {
/*
* If the buffer is not NULL, the byte buffer must not have been modified;
* however, this allocation modifies the buffer and increases coverage.
*/
if (nondet_bool()) ensure_byte_buf_has_allocated_buffer_member(unencrypted_data_key);
}
int ret;
return ret;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I have put this function into the stubs folder.

void default_cmm_generate_enc_materials_harness() {
/* Nondet input required to init cmm */
struct aws_cryptosdk_keyring *keyring = malloc(sizeof(*keyring));
const struct aws_cryptosdk_keyring_vt vtable = { .vt_size = sizeof(struct aws_cryptosdk_keyring_vt),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have it now.

__CPROVER_assume(keyring->vtable != NULL);

/* Nondet input */
struct aws_cryptosdk_cmm *cmm = aws_cryptosdk_default_cmm_new(can_fail_allocator(), keyring);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created a new allocator function for default_cmm (which is an extension of cmm). We are not using this function anymore.

Comment on lines 80 to 48
struct aws_cryptosdk_enc_materials **output = malloc(sizeof(*output));
struct aws_cryptosdk_enc_request *request = malloc(sizeof(*request));

/* Assumptions */
__CPROVER_assume(cmm != NULL);

__CPROVER_assume(output != NULL);

__CPROVER_assume(request != NULL);
request->alloc = can_fail_allocator();
__CPROVER_assume(aws_allocator_is_valid(request->alloc));
request->enc_ctx = malloc(sizeof(*request->enc_ctx));
__CPROVER_assume(request->enc_ctx != NULL);
ensure_allocated_hash_table(request->enc_ctx, MAX_NUM_ITEMS);
__CPROVER_assume(aws_cryptosdk_enc_request_is_valid(request));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added them.

@adpaco-aws
Copy link
Collaborator Author

@alex-chew I have tried the first one in here

If the call fails, you can verify:

request->requested_alg is a valid algorithm ID or zero
output is unchanged

assert(!request->requested_alg || aws_cryptosdk_algorithm_is_known(request->requested_alg);

and

assert(request->requested_alg == DEFAULT_ALG_UNSET ||
           aws_cryptosdk_algorithm_is_known(request->requested_alg));

(in case you meant DEFAULT_ALG_UNSET as zero). But none of them work for me. Can you please elaborate?

Also, I am not sure how to check that output remains unchanged. Do we have templates for this? @feliperodri @tegansb

@adpaco-aws adpaco-aws force-pushed the default-materials-proof branch 3 times, most recently from f34515e to 656eadd Compare December 16, 2020 12:33
@alex-chew
Copy link
Contributor

@alex-chew I have tried the first one in here

If the call fails, you can verify:
request->requested_alg is a valid algorithm ID or zero
output is unchanged

assert(!request->requested_alg || aws_cryptosdk_algorithm_is_known(request->requested_alg);

and

assert(request->requested_alg == DEFAULT_ALG_UNSET ||
           aws_cryptosdk_algorithm_is_known(request->requested_alg));

(in case you meant DEFAULT_ALG_UNSET as zero). But none of them work for me. Can you please elaborate?

Oops, that's my bad. If the call fails, it should be the case that request->requested_alg is valid or unchanged (not zero). Sorry for the confusion. In retrospect, however, I'm not sure this is worth verifying.

Also, I am not sure how to check that output remains unchanged. Do we have templates for this? @feliperodri @tegansb

You can save its value prior to calling the function under verification and check that its value is unchanged by the call. e.g. https://github.com/aws/aws-encryption-sdk-c/blob/master/verification/cbmc/proofs/aws_cryptosdk_priv_hdr_parse_alg_id/aws_cryptosdk_priv_hdr_parse_alg_id_harness.c

@adpaco-aws
Copy link
Collaborator Author

adpaco-aws commented Dec 21, 2020

@alex-chew Ok, I have removed the assert in case of failure.

I have also added code to check that output remains unchanged at the top level (i.e., it performs a cast of the struct and compares the values as an array, but does not check for changes on structures being pointed to by its members). The main reason to leave it as it is performance, since doing these checks would be time-consuming and the structures are not really used in the function under verification (remember that output is just a placeholder in this function).

@@ -180,3 +185,10 @@ int aws_cryptosdk_default_cmm_set_alg_id(struct aws_cryptosdk_cmm *cmm, enum aws
self->default_alg = alg_id;
return AWS_OP_SUCCESS;
}

bool aws_cryptosdk_default_cmm_is_valid(const struct aws_cryptosdk_cmm *cmm) {
AWS_PRECONDITION(cmm != NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should return false in case cmm is NULL, not fail on an assertion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I am happy you saw this because I had my doubts about it.

__CPROVER_assume(cmm != NULL);
__CPROVER_assume(aws_cryptosdk_default_cmm_is_valid(cmm));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wouldn't need it if aws_cryptosdk_default_cmm_is_valid returned false in case cmm is NULL.

Copy link
Collaborator Author

@adpaco-aws adpaco-aws Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed non-null assumption, thanks!

Comment on lines 49 to 48
__CPROVER_assume(request != NULL);
__CPROVER_assume(aws_allocator_is_valid(request->alloc));
__CPROVER_assume(request->enc_ctx != NULL);
__CPROVER_assume(aws_cryptosdk_enc_request_is_valid(request));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd to me too. Why the first three assumptions are not part of the validity check for aws_cryptosdk_enc_request?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably from my early days of proof-writing. The assumptions were not needed so I removed them.

struct aws_cryptosdk_cmm base;
struct aws_allocator *alloc;
struct aws_cryptosdk_keyring *kr;
// Invariant: this is either DEFAULT_ALG_UNSET or is a valid algorithm ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid cpp comments.

/* Invariant: this is either DEFAULT_ALG_UNSET or is a valid algorithm ID. */

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from the source code, so I fixed it in both places.

Comment on lines +294 to +415
/* Assumptions required to init cmm */
ensure_cryptosdk_keyring_has_allocated_members(keyring, vtable);
__CPROVER_assume(aws_cryptosdk_keyring_is_valid(keyring));
__CPROVER_assume(keyring->vtable != NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a GitHub issue to investigate a way to move these assumptions to the validity function and not to the allocator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened one here: #675

struct default_cmm *self = NULL;
if (cmm) {
self = (struct default_cmm *)cmm;
self->alloc = can_fail_allocator();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be NULL? We should be as nondet as possible here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I missed that one. It can be NULL now.

Comment on lines 72 to 73
int ret;
return ret;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return nondet_int();

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as well.

Copy link
Contributor

@alex-chew alex-chew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending CI fixes.

Copy link
Collaborator

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few more questions, but no blockers.

Comment on lines +189 to +195
bool aws_cryptosdk_default_cmm_is_valid(const struct aws_cryptosdk_cmm *cmm) {
if (cmm == NULL) return false;

struct default_cmm *self = (struct default_cmm *)cmm;
return aws_cryptosdk_cmm_base_is_valid(&self->base) && aws_allocator_is_valid(self->alloc) &&
aws_cryptosdk_keyring_is_valid(self->kr);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this function wasn't written like...

bool default_cmm_is_valid(const struct default_cmm *cmm) {
    return (cmm != NULL) &&
           aws_cryptosdk_cmm_base_is_valid(&cmm->base) &&
           aws_allocator_is_valid(cmm->alloc) &&
           aws_cryptosdk_keyring_is_valid(cmm->kr);
}

Shouldn't we validate both structures separately (i.e., on validity function for each data structure)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, extensions of aws_cryptosdk_cmm are always handled like this in the source code: The type is used as a parameter/return type and the struct is cast before doing any operations on it. This way, we are following API guidelines.

I am not sure what you mean by "validate both structures separately". We have aws_cryptosdk_cmm_base_is_valid for validating aws_cryptosdk_cmm structs and this one to validate default_cmm structs.

Comment on lines +422 to +428
if (cmm) {
self = (struct default_cmm *)cmm;
self->alloc = nondet_bool() ? NULL : can_fail_allocator();
self->kr = keyring;
}
return (struct aws_cryptosdk_cmm *)self;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

* limitations under the License.
*/

#include <stdlib.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need that include?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this was not required.

@adpaco-aws adpaco-aws merged commit 7aaad97 into aws:master Jan 6, 2021
alex-chew pushed a commit that referenced this pull request Jan 15, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
robin-aws pushed a commit to robin-aws/aws-encryption-sdk-c that referenced this pull request Apr 26, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
robin-aws pushed a commit to robin-aws/aws-encryption-sdk-c that referenced this pull request Apr 29, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
robin-aws pushed a commit to robin-aws/aws-encryption-sdk-c that referenced this pull request May 4, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
robin-aws pushed a commit to robin-aws/aws-encryption-sdk-c that referenced this pull request May 4, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
robin-aws pushed a commit that referenced this pull request May 5, 2021
* Add proof files for default_cmm_generate_enc_materials

* Move on_encrypt function to its own file

* Add validator and allocator functions
Change variable name and add comment for it on Makefile
Merge changes from 'master'

* Add and edit allocators for materials and cmm

* Add missing file to Makefile (algorithm_is_known)

* Remove unnecessary assumptions

* Edit preconditions and postconditions

* Fix style checks

* Restore simpler precondition

* Check that output remains unchanged (top-level check only)
Do intial allocation as usual and pass output by reference
Remove request_alg assertion in case of failure

* Fix style issues

* Use C-style comments and add space

* Remove unneeded assumptions and use nondet values
Replace precondition by false case in enc_request validator

* Remove copyright year on Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cbmc CBMC proof related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants