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

Adopt CBMC 6.1 and cbmc-viewer 3.9 #4661

Merged
merged 54 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2830362
Remove local vsnprintf() function here, since it causes CBMC 6.0.0 to…
rod-chapman Jun 24, 2024
4e5a743
Add s2n_calculate_stacktrace() function to all proofs, and remove --o…
rod-chapman Jun 24, 2024
13beb9a
Do NOT remove abort() function - CBMC 6.0.0 objects to its absence, s…
rod-chapman Jun 24, 2024
5ca69b0
Add CONTRACT_ASSUME and CONTRACT_ASSERT macros
rod-chapman Jun 24, 2024
b06b855
Change __CPROVER_assume to CONTRACT_ASSUME throughout here.
rod-chapman Jun 24, 2024
1502b48
Add dummy stub function to avoid missing function body on macOS/Darwi…
rod-chapman Jun 24, 2024
ed73009
Add missing source file
rod-chapman Jun 25, 2024
fc0c256
Adjust Makefiles to address missing functions reported by CBMC 6
rod-chapman Jun 25, 2024
bad1efc
Rename static/global flag to avoid name clash with same in s2n_libcry…
rod-chapman Jun 25, 2024
1f9460c
Do not remove function that is needed to avoid warning from CBMC 6
rod-chapman Jun 25, 2024
4d14445
Add stub for madvise.c
rod-chapman Jun 25, 2024
536b8b7
Add stub units required by CBMC 6.0.0
rod-chapman Jun 26, 2024
9c8c961
Restore local stub of vsnprintf() for now. Works on Linux, fails on m…
rod-chapman Jun 26, 2024
47526fd
Add missing sources and stubs for CBMC 6.0.0
rod-chapman Jun 26, 2024
bf26198
Add one missing stub
rod-chapman Jun 26, 2024
f8950e7
Add one stub needed for verification on Linux
rod-chapman Jun 26, 2024
62c96ac
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jun 26, 2024
384cb51
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 15, 2024
8d9feb8
Increase CBMC_OBJECT_BITS to 10 for CBMC 6.0.1
rod-chapman Jul 15, 2024
a37e2b4
Remove cbmc_utils.c from PROOF_SOURCES for now - missing functions TBD
rod-chapman Jul 15, 2024
177d2dd
Add required sources to Makefile, and correct double-free bug in harn…
rod-chapman Jul 16, 2024
71cdb71
Add support for download and install of Z3 in CI to support CBMC 6.1.…
rod-chapman Jul 16, 2024
fef7f76
If vsnprintf is defined as macro (as on macOS), then undef that symbo…
rod-chapman Jul 17, 2024
89cfe5a
Add resources and actions to build Bitwuzla
rod-chapman Jul 17, 2024
046de30
Corrections following dry-run of this script on an Ubuntu 20.04 insta…
rod-chapman Jul 17, 2024
ee2cedb
Use sudo to install cbmc-viewer so it is on PATH automatically
rod-chapman Jul 17, 2024
dd1c266
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 17, 2024
1355770
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 18, 2024
20dff74
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 19, 2024
34c3d91
Correct UNWINDSET for this proof to avoid warning from CBMC
rod-chapman Jul 23, 2024
2e13921
Add COVERFLAGS=--no-standard-checks to restore performance of coverag…
rod-chapman Jul 23, 2024
0a66c40
Upgrade to CBMC 6.1.0 for CI runs
rod-chapman Jul 23, 2024
265fabc
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 23, 2024
0ded2bd
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 24, 2024
17a7cc2
Correct 2 typos spotted in review by @backphan
rod-chapman Jul 24, 2024
b34ef83
Address two review comments from @beckphan
rod-chapman Jul 24, 2024
229ceba
Correct to use /* comment style not //
rod-chapman Jul 24, 2024
5286eb8
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 25, 2024
b8dbfb1
Attempt to correct PATH setting code for Z3
rod-chapman Jul 25, 2024
921cb97
Run clang-format on this file to correct layout
rod-chapman Jul 25, 2024
3f62624
Correct syntax for shell commands when adding Z3 to PATH
rod-chapman Jul 25, 2024
1de1f3e
Correction for new Rust clippy lint
rod-chapman Jul 25, 2024
4187f61
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 29, 2024
701e7ab
Correction to command that removes z3.zip file.
rod-chapman Jul 29, 2024
6808602
Try again to correct command to remove z3.zip
rod-chapman Jul 29, 2024
87bb1ef
Correct commands to add bitwuzla to PATH
rod-chapman Jul 29, 2024
1b8b350
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 30, 2024
398f64e
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Jul 31, 2024
b694f05
Remove undef of vsnprintf here. Proof of this unit on macOS will be r…
rod-chapman Jul 31, 2024
660d4fb
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Aug 1, 2024
e4b76a3
Merge branch 'main' into cbmc_6_minimal
lrstewart Aug 1, 2024
edfa9f7
Merge branch 'aws:main' into cbmc_6_minimal
rod-chapman Aug 2, 2024
850d50c
Add missing stubs to satisfy CBMC 6.1 for these proofs
rod-chapman Aug 2, 2024
8b0b1f0
Add one more stub function to satisfy CBMC 6.1 on EC2/Linux
rod-chapman Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 52 additions & 5 deletions .github/workflows/proof_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# CBMC starter kit 2.9
# CBMC starter kit 2.10
name: Run CBMC proofs
on:
push:
Expand Down Expand Up @@ -38,11 +38,11 @@ jobs:
- name: Parse config file
run: |
CONFIG_FILE='.github/workflows/proof_ci_resources/config.yaml'
for setting in cadical-tag cbmc-version cbmc-viewer-version kissat-tag litani-version proofs-dir run-cbmc-proofs-command; do
for setting in cadical-tag cbmc-version cbmc-viewer-version kissat-tag litani-version z3-version bitwuzla-version proofs-dir run-cbmc-proofs-command; do
VAR=$(echo $setting | tr "[:lower:]" "[:upper:]" | tr - _)
echo "${VAR}"=$(yq .$setting $CONFIG_FILE) >> $GITHUB_ENV
done
- name: Ensure CBMC, CBMC viewer, Litani versions have been specified
- name: Ensure CBMC, CBMC viewer, Litani, Z3, Bitwuzla versions have been specified
shell: bash
run: |
should_exit=false
Expand All @@ -58,6 +58,22 @@ jobs:
echo "You must specify a Litani version (e.g. 'latest' or '1.27.0')"
should_exit=true
fi
if [ "${{ env.Z3_VERSION }}" == "" ]; then
echo "You must specify a Z3 version (e.g. '4.13.0')"
should_exit=true
fi
if [ "${{ env.Z3_VERSION }}" == "latest" ]; then
echo "Z3 latest not supported at this time. You must specify an exact Z3 version (e.g. '4.13.0')"
should_exit=true
fi
if [ "${{ env.BITWUZLA_VERSION }}" == "" ]; then
echo "You must specify a Bitwuzla version (e.g. '0.5.0')"
should_exit=true
fi
if [ "${{ env.BITWUZLA_VERSION }}" == "latest" ]; then
echo "Bitwuzla latest not supported at this time. You must specify an exact version (e.g. '0.5.0')"
should_exit=true
fi
if [[ "$should_exit" == true ]]; then exit 1; fi
- name: Install latest CBMC
if: ${{ env.CBMC_VERSION == 'latest' }}
Expand All @@ -84,15 +100,15 @@ jobs:
run: |
CBMC_VIEWER_REL="https://api.github.com/repos/model-checking/cbmc-viewer/releases/latest"
CBMC_VIEWER_VERSION=$(curl -s $CBMC_VIEWER_REL --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq -r .name | sed 's/viewer-//')
pip3 install cbmc-viewer==$CBMC_VIEWER_VERSION
sudo pip3 install cbmc-viewer==$CBMC_VIEWER_VERSION
- name: Install CBMC viewer ${{ env.CBMC_VIEWER_VERSION }}
if: ${{ env.CBMC_VIEWER_VERSION != 'latest' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --yes \
build-essential universal-ctags
pip3 install cbmc-viewer==${{ env.CBMC_VIEWER_VERSION }}
sudo pip3 install cbmc-viewer==${{ env.CBMC_VIEWER_VERSION }}
- name: Install latest Litani
if: ${{ env.LITANI_VERSION == 'latest' }}
shell: bash
Expand All @@ -114,6 +130,37 @@ jobs:
sudo apt-get update
sudo apt-get install --no-install-recommends --yes ./litani.deb
rm ./litani.deb
- name: Install Z3 ${{ env.Z3_VERSION }}
if: ${{ env.Z3_VERSION != 'latest' }}
rod-chapman marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run: |
curl -o z3.zip -L \
https://github.com/Z3Prover/z3/releases/download/z3-${{ env.Z3_VERSION }}/z3-${{ env.Z3_VERSION }}-x64-glibc-2.31.zip
sudo apt-get install --no-install-recommends --yes unzip
unzip z3.zip
cd z3-${{ env.Z3_VERSION }}-x64-glibc-2.31/bin \
&& echo "Adding $(pwd) to PATH for Z3" \
&& echo "$(pwd)" >> $GITHUB_PATH
rm ../../z3.zip
- name: Build and Install Bitwuzla ${{ env.BITWUZLA_VERSION }}
if: ${{ env.BITWUZLA_VERSION != 'latest' }}
rod-chapman marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run: |
echo "Installing Bitwuzla dependencies"
sudo apt-get update
sudo apt-get install --no-install-recommends --yes libgmp-dev cmake
sudo pip3 install meson
echo "Building Bitwuzla"
BITWUZLA_TAG_NAME=${{ env.BITWUZLA_VERSION }}
git clone https://github.com/bitwuzla/bitwuzla.git \
&& cd bitwuzla \
&& git checkout $BITWUZLA_TAG_NAME \
&& ./configure.py \
&& cd build \
&& ninja;
cd src/main \
&& echo "Adding $(pwd) to PATH for Bitwuzla" \
&& echo "$(pwd)" >> $GITHUB_PATH
- name: Install ${{ env.KISSAT_TAG }} kissat
if: ${{ env.KISSAT_TAG != '' }}
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/proof_ci_resources/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cadical-tag: latest
cbmc-version: "5.95.1"
cbmc-version: "6.1.0"
cbmc-viewer-version: latest
kissat-tag: latest
litani-version: latest
z3-version: "4.13.0"
bitwuzla-version: "0.5.0"
proofs-dir: tests/cbmc/proofs
run-cbmc-proofs-command: ./run-cbmc-proofs.py
1 change: 0 additions & 1 deletion tests/cbmc/proofs/Makefile-project-defines
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ CHECKFLAGS += --pointer-primitive-check

# We override abort() to be assert(0)
PROOF_SOURCES += $(PROOF_STUB)/abort_override_assert_false.c
REMOVE_FUNCTION_BODY += abort

# Useful for setting unwind limits to one more than some value.
addone = $(shell echo $$(( $(1) + 1)))
7 changes: 6 additions & 1 deletion tests/cbmc/proofs/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ CBMC_FLAG_FLUSH ?= --flush

CBMCFLAGS += $(CBMC_FLAG_FLUSH)

# CBMC 6.0.0 enables all standard checks by default, which can make coverage analysis
# very slow. See https://github.com/diffblue/cbmc/issues/8389
# For now, we disable these checks when generating coverage info.
COVERFLAGS ?= --no-standard-checks
rod-chapman marked this conversation as resolved.
Show resolved Hide resolved
lrstewart marked this conversation as resolved.
Show resolved Hide resolved

# CBMC flags used for property checking

CHECKFLAGS += $(CBMC_FLAG_BOUNDS_CHECK)
Expand Down Expand Up @@ -382,6 +387,7 @@ PROJECT_SOURCES ?=
# PROOF_SOURCES is the list of proof source files to compile, including
# the proof harness, and including any function stubs being used.
PROOF_SOURCES ?=
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c

# The number of seconds that CBMC should be allowed to run for before
# being forcefully terminated. Currently, this is set to be less than
Expand Down Expand Up @@ -492,7 +498,6 @@ COMMA :=,
# Set C compiler defines

CBMCFLAGS += --object-bits $(CBMC_OBJECT_BITS)
COMPILE_FLAGS += --object-bits $(CBMC_OBJECT_BITS)

DEFINES += -DCBMC=1
DEFINES += -DCBMC_OBJECT_BITS=$(CBMC_OBJECT_BITS)
Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_array_new/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/memset_havoc.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/munlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c
PROOF_SOURCES += $(PROOF_STUB)/posix_memalign_override.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/munlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c
PROOF_SOURCES += $(PROOF_STUB)/posix_memalign_override.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/bn_override.c
PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c
PROOF_SOURCES += $(PROOF_STUB)/posix_memalign_override.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_ensure.c

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/stuffer/s2n_stuffer.c
Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_dh_generate_ephemeral_key/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

UNWINDSET +=

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_dh_p_g_Ys_to_dh_params/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ PROJECT_SOURCES += $(SRCDIR)/utils/s2n_blob.c
PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_result.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

UNWINDSET +=

Expand Down
2 changes: 2 additions & 0 deletions tests/cbmc/proofs/s2n_dh_params_check/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ HARNESS_FILE = $(HARNESS_ENTRY).c

PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
PROOF_SOURCES += $(OPENSSL_SOURCE)/dh_override.c
PROOF_SOURCES += $(OPENSSL_SOURCE)/bn_override.c
PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

UNWINDSET +=

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_dh_params_copy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

UNWINDSET +=

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_dh_params_free/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_dhe.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

UNWINDSET +=

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_free/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_blob.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_result.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_mem_c_s2n_mem_cleanup_impl

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_free_object/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_blob.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_result.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_mem_c_s2n_mem_cleanup_impl

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_free_or_wipe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_blob.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_result.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_mem_c_s2n_mem_cleanup_impl

Expand Down
1 change: 0 additions & 1 deletion tests/cbmc/proofs/s2n_hash_free/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_init
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_new
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_hash_allow_md5_for_fips
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_allow_md5_for_fips

UNWINDSET +=
Expand Down
1 change: 0 additions & 1 deletion tests/cbmc/proofs/s2n_hash_update/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

# We abstract these functions because manual inspection demonstrates they are unreachable.
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_digest
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_hash_digest_size
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_digest

UNWINDSET +=
Expand Down
3 changes: 1 addition & 2 deletions tests/cbmc/proofs/s2n_hmac_free/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ PROOF_SOURCES += $(OPENSSL_SOURCE)/bn_override.c
PROOF_SOURCES += $(OPENSSL_SOURCE)/ec_override.c
PROOF_SOURCES += $(OPENSSL_SOURCE)/evp_override.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)

Expand All @@ -37,8 +38,6 @@ REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_init
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_new
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_hash_allow_md5_for_fips
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_allow_md5_for_fips

UNWINDSET +=

Expand Down
4 changes: 2 additions & 2 deletions tests/cbmc/proofs/s2n_hmac_free/s2n_hmac_free_harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void s2n_hmac_free_harness()
assert(state->inner_just_key.hash_impl->free != NULL);
assert(state->outer.hash_impl->free != NULL);
assert(state->outer_just_key.hash_impl->free != NULL);

if (s2n_is_in_fips_mode()) {
assert(state->inner.digest.high_level.evp.ctx == NULL);
assert(state->inner.digest.high_level.evp_md5_secondary.ctx == NULL);
Expand Down Expand Up @@ -93,7 +93,7 @@ void s2n_hmac_free_harness()
*/
free_rc_keys_from_hash_state(&saved_inner_hash_state);
free_rc_keys_from_hash_state(&saved_inner_just_key_hash_state);
free_rc_keys_from_hash_state(&saved_inner_hash_state);
free_rc_keys_from_hash_state(&saved_outer_hash_state);
free_rc_keys_from_hash_state(&saved_outer_just_key_hash_state);
}
/* 3. free our heap-allocated `state` since `s2n_hash_free` only `free`s the contents. */
Expand Down
10 changes: 4 additions & 6 deletions tests/cbmc/proofs/s2n_hmac_init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ PROOF_UID = s2n_hmac_init
HARNESS_ENTRY = $(PROOF_UID)_harness
HARNESS_FILE = $(HARNESS_ENTRY).c

CBMC_OBJECT_BITS ?= 10

PROOF_SOURCES += $(OPENSSL_SOURCE)/evp_override.c
PROOF_SOURCES += $(OPENSSL_SOURCE)/md5_override.c
PROOF_SOURCES += $(OPENSSL_SOURCE)/sha_override.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_is_in_fips_mode.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_libcrypto_is_awslc.c
PROOF_SOURCES += $(PROOF_STUB)/darwin_check_fd_set_overflow.c
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)

PROJECT_SOURCES += $(SRCDIR)/crypto/s2n_hash.c
Expand All @@ -35,15 +39,9 @@ PROJECT_SOURCES += $(SRCDIR)/utils/s2n_result.c
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_new
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_free
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_digest
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_update
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_free
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_new
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_reset
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_digest
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_update
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_allow_md5_for_fips
REMOVE_FUNCTION_BODY += s2n_hash_allow_md5_for_fips

# The upper bound limit for these loops is me maximum possible value for xor_pad_size field
# in struct s2n_hmac_state (128) plus one. See definition for struct s2n_hmac_state
Expand Down
1 change: 0 additions & 1 deletion tests/cbmc/proofs/s2n_hmac_update/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

# We abstract these functions because manual inspection demonstrates they are unreachable.
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_evp_hash_digest
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_hash_digest_size
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_hash_c_s2n_low_level_hash_digest

UNWINDSET +=
Expand Down
3 changes: 2 additions & 1 deletion tests/cbmc/proofs/s2n_mem_cleanup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ PROOF_SOURCES += $(PROOF_STUB)/sysconf.c

PROJECT_SOURCES += $(SRCDIR)/utils/s2n_blob.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_mem_c_s2n_mem_cleanup_impl
REMOVE_FUNCTION_BODY +=

UNWINDSET +=

Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_mem_init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c

PROJECT_SOURCES += $(SRCDIR)/utils/s2n_mem.c
PROJECT_SOURCES += $(SRCDIR)/utils/s2n_safety.c

# We abstract this function because manual inspection demonstrates it is unreachable.
REMOVE_FUNCTION_BODY += __CPROVER_file_local_s2n_mem_c_s2n_mem_cleanup_impl
Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_stuffer_alloc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/munlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c
PROOF_SOURCES += $(PROOF_STUB)/posix_memalign_override.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
Expand Down
2 changes: 2 additions & 0 deletions tests/cbmc/proofs/s2n_stuffer_alloc_ro_from_string/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ HARNESS_FILE = $(HARNESS_ENTRY).c
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE)
PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c

PROJECT_SOURCES += $(SRCDIR)/stuffer/s2n_stuffer.c
PROJECT_SOURCES += $(SRCDIR)/stuffer/s2n_stuffer_text.c
Expand Down
1 change: 1 addition & 0 deletions tests/cbmc/proofs/s2n_stuffer_copy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PROOF_SOURCES += $(PROOF_SOURCE)/cbmc_utils.c
PROOF_SOURCES += $(PROOF_SOURCE)/make_common_datastructures.c
PROOF_SOURCES += $(PROOF_STUB)/mlock.c
PROOF_SOURCES += $(PROOF_STUB)/munlock.c
PROOF_SOURCES += $(PROOF_STUB)/madvise.c
PROOF_SOURCES += $(PROOF_STUB)/posix_memalign_override.c
PROOF_SOURCES += $(PROOF_STUB)/s2n_calculate_stacktrace.c
PROOF_SOURCES += $(PROOF_STUB)/sysconf.c
Expand Down
Loading
Loading