Skip to content

Commit 1c6048f

Browse files
committed
chore: update aws-c-common dependency for CBMC proofs
CBMC proofs should use the same version of aws-c-common that customers will use in their deployments. Stubs that had since been removed from aws-c-common have now been moved into this repository.
1 parent cfe17ec commit 1c6048f

File tree

181 files changed

+423
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+423
-391
lines changed

verification/cbmc/aws-c-common

Submodule aws-c-common updated 896 files

verification/cbmc/include/make_common_data_structures.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <aws/cryptosdk/private/header.h>
2222
#include <aws/cryptosdk/private/hkdf.h>
2323
#include <proof_helpers/make_common_data_structures.h>
24-
#include <proof_helpers/proof_allocators.h>
2524
#include <proof_helpers/utils.h>
2625
#include <stdint.h>
2726
#include <stdlib.h>

verification/cbmc/include/proof_allocators.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

verification/cbmc/proofs/aws_cryptosdk_aes_gcm_decrypt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
2626

2727
CBMCFLAGS +=
2828

29+
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/allocator.c
2930
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/byte_buf.c
3031
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/common.c
3132
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/error.c
@@ -38,7 +39,6 @@ PROJECT_SOURCES += $(SRCDIR)/source/cipher_openssl.c
3839
PROJECT_SOURCES += $(SRCDIR)/source/hkdf.c
3940

4041
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/make_common_data_structures.c
41-
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/proof_allocators.c
4242
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/utils.c
4343
PROOF_SOURCES += $(COMMON_PROOF_STUB)/memcpy_override_havoc.c
4444
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)

verification/cbmc/proofs/aws_cryptosdk_aes_gcm_encrypt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
2626

2727
CBMCFLAGS +=
2828

29+
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/allocator.c
2930
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/byte_buf.c
3031
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/common.c
3132
PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/error.c
@@ -38,7 +39,6 @@ PROJECT_SOURCES += $(SRCDIR)/source/cipher_openssl.c
3839
PROJECT_SOURCES += $(SRCDIR)/source/hkdf.c
3940

4041
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/make_common_data_structures.c
41-
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/proof_allocators.c
4242
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/utils.c
4343
PROOF_SOURCES += $(COMMON_PROOF_STUB)/memcpy_override_havoc.c
4444
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)

verification/cbmc/proofs/aws_cryptosdk_cmm_base_init/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ PROJECT_SOURCES += $(CBMC_ROOT)/aws-c-common/source/math.c
3737
PROJECT_SOURCES += $(SRCDIR)/source/materials.c
3838

3939
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/make_common_data_structures.c
40-
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/proof_allocators.c
4140
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/utils.c
4241
PROOF_SOURCES += $(COMMON_PROOF_STUB)/error.c
4342
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)

verification/cbmc/proofs/aws_cryptosdk_cmm_base_init/aws_cryptosdk_cmm_base_init_harness.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <aws/cryptosdk/materials.h>
2020
#include <make_common_data_structures.h>
2121
#include <proof_helpers/make_common_data_structures.h>
22-
#include <proof_helpers/proof_allocators.h>
2322
#include <proof_helpers/utils.h>
2423

2524
void aws_cryptosdk_cmm_base_init_harness() {

verification/cbmc/proofs/aws_cryptosdk_cmm_decrypt_materials/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ PROJECT_SOURCES += $(SRCDIR)/source/edk.c
5252
PROJECT_SOURCES += $(SRCDIR)/source/keyring_trace.c
5353
PROJECT_SOURCES += $(SRCDIR)/source/materials.c
5454

55+
PROOF_SOURCES += $(CBMC_ROOT)/aws-c-common/source/allocator.c
5556
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/make_common_data_structures.c
56-
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/proof_allocators.c
5757
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/utils.c
5858
PROOF_SOURCES += $(COMMON_PROOF_STUB)/aws_hash_table_no_slots_override.c
5959
PROOF_SOURCES += $(COMMON_PROOF_STUB)/aws_string_destroy_override.c

verification/cbmc/proofs/aws_cryptosdk_cmm_decrypt_materials/aws_cryptosdk_cmm_decrypt_materials_harness.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <make_common_data_structures.h>
2424
#include <proof_helpers/cryptosdk/make_common_data_structures.h>
2525
#include <proof_helpers/make_common_data_structures.h>
26-
#include <proof_helpers/proof_allocators.h>
2726
#include <proof_helpers/utils.h>
2827

2928
// Stub this until https://github.com/diffblue/cbmc/issues/5344 is fixed
@@ -52,7 +51,7 @@ int decrypt_materials(
5251
assert(AWS_OBJECT_PTR_IS_WRITABLE(output));
5352
assert(aws_cryptosdk_dec_request_is_valid(request));
5453

55-
struct aws_cryptosdk_dec_materials *materials = can_fail_malloc(sizeof(*materials));
54+
struct aws_cryptosdk_dec_materials *materials = malloc(sizeof(*materials));
5655
if (materials == NULL) {
5756
*output = NULL;
5857
return AWS_OP_ERR;
@@ -92,15 +91,15 @@ void aws_cryptosdk_cmm_decrypt_materials_harness() {
9291
.decrypt_materials = nondet_bool() ? decrypt_materials : NULL };
9392
__CPROVER_assume(aws_cryptosdk_cmm_vtable_is_valid(&vtable));
9493

95-
struct aws_cryptosdk_cmm *cmm = can_fail_malloc(sizeof(*cmm));
94+
struct aws_cryptosdk_cmm *cmm = malloc(sizeof(*cmm));
9695
__CPROVER_assume(cmm);
9796
cmm->vtable = &vtable;
9897
__CPROVER_assume(aws_cryptosdk_cmm_base_is_valid(cmm));
9998

100-
struct aws_cryptosdk_dec_request *request = can_fail_malloc(sizeof(*request));
99+
struct aws_cryptosdk_dec_request *request = malloc(sizeof(*request));
101100
__CPROVER_assume(request);
102-
request->alloc = can_fail_allocator();
103-
request->enc_ctx = can_fail_malloc(sizeof(*request->enc_ctx));
101+
request->alloc = aws_default_allocator();
102+
request->enc_ctx = malloc(sizeof(*request->enc_ctx));
104103
__CPROVER_assume(request->enc_ctx);
105104
ensure_allocated_hash_table(request->enc_ctx, MAX_NUM_ITEMS);
106105

@@ -120,7 +119,7 @@ void aws_cryptosdk_cmm_decrypt_materials_harness() {
120119
*/
121120
__CPROVER_assume(aws_cryptosdk_dec_request_is_valid(request));
122121

123-
struct aws_cryptosdk_dec_materials **output = can_fail_malloc(sizeof(*output));
122+
struct aws_cryptosdk_dec_materials **output = malloc(sizeof(*output));
124123
__CPROVER_assume(output);
125124

126125
// Run the function under test.

verification/cbmc/proofs/aws_cryptosdk_cmm_generate_enc_materials/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ PROJECT_SOURCES += $(SRCDIR)/source/edk.c
5151
PROJECT_SOURCES += $(SRCDIR)/source/keyring_trace.c
5252
PROJECT_SOURCES += $(SRCDIR)/source/materials.c
5353

54+
PROOF_SOURCES += $(CBMC_ROOT)/aws-c-common/source/allocator.c
5455
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/make_common_data_structures.c
55-
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/proof_allocators.c
5656
PROOF_SOURCES += $(COMMON_PROOF_SOURCE)/utils.c
5757
PROOF_SOURCES += $(COMMON_PROOF_STUB)/aws_hash_table_no_slots_override.c
5858
PROOF_SOURCES += $(COMMON_PROOF_STUB)/aws_string_destroy_override.c

0 commit comments

Comments
 (0)