Skip to content

Commit 72b2631

Browse files
committed
update cbmc
1 parent 4f510b3 commit 72b2631

File tree

31 files changed

+15726
-54
lines changed

31 files changed

+15726
-54
lines changed

tests/cbmc/include/cbmc_proof/cbmc_utils.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@ struct rc_keys_from_evp_pkey_ctx {
4747
int pkey_eckey_refs;
4848
};
4949

50-
/**
51-
* In the `rc_keys_from_hash_state`, we store two `rc_keys_from_evp_pkey_ctx` objects:
52-
* one for the `evp` field and another for `evp_md5_secondary` field.
53-
*/
5450
struct rc_keys_from_hash_state {
5551
struct rc_keys_from_evp_pkey_ctx evp;
56-
struct rc_keys_from_evp_pkey_ctx evp_md5;
5752
};
5853

5954
/**

tests/cbmc/proofs/s2n_hash_const_time_get_currently_in_hash_block/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
2222
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
2323
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2424
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
25-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
25+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2626

2727
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
2828

tests/cbmc/proofs/s2n_hash_copy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/ec_override.c
2525
PROOF_SOURCES += $(OPENSSL_SOURCE)/evp_override.c
2626
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2727
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
28-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
28+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2929

3030
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
3131
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_ensure.c

tests/cbmc/proofs/s2n_hash_digest/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/md5_override.c
2727
PROOF_SOURCES += $(OPENSSL_SOURCE)/sha_override.c
2828
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2929
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
30-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
30+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
3131

3232
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
3333
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

tests/cbmc/proofs/s2n_hash_free/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/ec_override.c
2424
PROOF_SOURCES += $(OPENSSL_SOURCE)/evp_override.c
2525
PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
2626
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
27-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
27+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2828
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
2929

3030
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c

tests/cbmc/proofs/s2n_hash_free/s2n_hash_free_harness.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
#include "crypto/s2n_fips.h"
16+
#include "crypto/s2n_evp_signing.h"
1717
#include "crypto/s2n_hash.h"
1818

1919
#include <cbmc_proof/make_common_datastructures.h>
@@ -35,9 +35,8 @@ void s2n_hash_free_harness()
3535
assert(s2n_hash_free(state) == S2N_SUCCESS);
3636
if (state != NULL) {
3737
assert(state->hash_impl->free != NULL);
38-
if (s2n_is_in_fips_mode()) {
38+
if (s2n_evp_signing_supported()) {
3939
assert(state->digest.high_level.evp.ctx == NULL);
40-
assert(state->digest.high_level.evp_md5_secondary.ctx == NULL);
4140
assert_rc_decrement_on_hash_state(&saved_hash_state);
4241
} else {
4342
assert_rc_unchanged_on_hash_state(&saved_hash_state);
@@ -47,11 +46,10 @@ void s2n_hash_free_harness()
4746

4847
/* Cleanup after expected error cases, for memory leak check. */
4948
if (state != NULL) {
50-
/* 1. `free` leftover EVP_MD_CTX objects if `s2n_is_in_fips_mode`,
49+
/* 1. `free` leftover EVP_MD_CTX objects if `s2n_evp_signing_supported`,
5150
since `s2n_hash_free` is a NO-OP in that case. */
52-
if (!s2n_is_in_fips_mode()) {
51+
if (!s2n_evp_signing_supported()) {
5352
S2N_EVP_MD_CTX_FREE(state->digest.high_level.evp.ctx);
54-
S2N_EVP_MD_CTX_FREE(state->digest.high_level.evp_md5_secondary.ctx);
5553
}
5654

5755
/* 2. `free` leftover reference-counted keys (i.e. those with non-zero ref-count),

tests/cbmc/proofs/s2n_hash_get_currently_in_hash_total/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
2222
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
2323
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2424
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
25-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
25+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2626

2727
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
2828

tests/cbmc/proofs/s2n_hash_init/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/md5_override.c
2424
PROOF_SOURCES += $(OPENSSL_SOURCE)/sha_override.c
2525
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2626
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
27-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
27+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2828
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
2929

3030
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c

tests/cbmc/proofs/s2n_hash_new/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
2222
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
2323
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
2424
PROOF_SOURCES += $(OPENSSL_SOURCE)/evp_override.c
25-
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
25+
PROOF_SOURCES += $(PROOF_STUB)/s2n_evp_signing_supported.c
2626

2727
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
2828

0 commit comments

Comments
 (0)