-
Notifications
You must be signed in to change notification settings - Fork 74
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 of checkDataType function #293
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
0bbf408
Add CBMC-proofs infrastructure
Bujain 95529f8
Add CBMC-proofs infrastructure (#242)
Bujain 21ee448
Added value to not update the submodule
Bujain 4b189aa
Added Include paths and preprocessor defines
Bujain ae17c09
Added template define file
Bujain 4a2ed43
Updated to ignore the output files on git push
Bujain 6c5d6f5
Added words
Bujain b4a774c
Updated Project Name
Bujain db409b7
Updated source directory path
Bujain 402e6b8
Merge branch 'cbmc-proof' into cbmc_infra
AniruddhaKanhere 92b5b00
Update ci.yml
AniruddhaKanhere 62ddec4
Add checks on the branch
AniruddhaKanhere 67ad6b0
Updated Submodule update value
Bujain 1f5668f
Merge branch 'cbmc_infra' of https://github.com/Bujain/ota-for-aws-io…
Bujain 3bda16a
Added litani submodule update
Bujain 2c7f2ee
Update Project name
Bujain e88c8c0
Added new line in the end of the file
Bujain d274f81
Remove whitespace
AniruddhaKanhere a085b6a
Addition to CBMC infrastructure (#243)
Bujain fcb1efe
Added CBMC proof of setDataInterface function (#245)
Bujain f561a6c
Added template inside proof directory
Bujain 6122c14
Merge pull request #2 from aws/main
Bujain e684033
Added CBMC proof of OTA_HTTP_strerror function (#252)
Bujain 08fa29e
Add CBMC proofs for RequestdataBlock_Http function (#248)
Bujain 5a72e20
Added CBMC proofs for OTA_MQTT_strerror function (#247)
Bujain d470ee5
Added CBMC proofs for setControlInterface function (#246)
Bujain 4a2b21d
removed extra line
Bujain 08b6b5c
Merge branch 'cbmc_infra' of https://github.com/Bujain/ota-for-aws-io…
Bujain b331892
Uncrustified'
Bujain 8f4d71e
CBMC Proof of initFileTransfer_Http function (#249)
Bujain 98cfba1
CBMC proof of decodeFileBlock_Http function (#250)
Bujain 194fca7
Added CBMC proof of CleanupData_Http function (#251)
Bujain 3bc7195
Added CBMC proof for stringBuilderUInt32Hex function (#253)
Bujain 71ce0bf
Added CBMC proof of stringBuilderUInt32Decimal function (#254)
Bujain f42bbba
Updated source directory
Bujain 7228b93
Merge pull request #7 from aws/cbmc-proof
Bujain 4e24408
Add spellings
Bujain c544dba
Update doxygen in cbmc-proof branch (#275)
Bujain 8778e86
Merge branch 'aws:main' into cbmc_infra
Bujain 1b443e3
Merge pull request #11 from aws/cbmc-proof
Bujain b10eaf1
Add CBMC proof of checkDataType function
Bujain 667bcb8
Resolve conflicts
Bujain 094d06e
add words
Bujain cd3c2d9
Merge branch 'main' into checkDataType
Bujain 23a3835
Fix spell check errors
Bujain 92afbdd
Merge branch 'checkDataType' of https://github.com/Bujain/ota-for-aws…
Bujain 8c01a98
Fix spell check error
Bujain 632b2de
Removed unused variables
Bujain b3b01fb
Add return value check
Bujain 2854e0c
Merge branch 'main' into checkDataType
Bujain e805e06
uncrustified
Bujain ab9451d
Merge branch 'checkDataType' of https://github.com/Bujain/ota-for-aws…
Bujain 9b519d6
Merge branch 'main' into checkDataType
Bujain 245ac12
Add check for return value
Bujain 0d0efbf
Merge branch 'checkDataType' of https://github.com/Bujain/ota-for-aws…
Bujain 3927400
Uncrustified
Bujain 837e9d1
Merge branch 'main' into checkDataType
Bujain 74a5c64
remove optional variables
Bujain 55375df
Merge branch 'checkDataType' of https://github.com/Bujain/ota-for-aws…
Bujain 851523c
Merge branch 'main' into checkDataType
Bujain 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
HARNESS_ENTRY = checkDataType_harness | ||
HARNESS_FILE = $(HARNESS_ENTRY) | ||
|
||
# This should be a unique identifier for this proof, and will appear on the | ||
# Litani dashboard. It can be human-readable and contain spaces if you wish. | ||
PROOF_UID = checkDataType | ||
|
||
INCLUDES += -I$(SRCDIR)/source/dependency/3rdparty/tinycbor/src/ | ||
|
||
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE).c | ||
PROJECT_SOURCES += $(SRCDIR)/source/ota_cbor.c | ||
|
||
# If this proof is found to consume huge amounts of RAM, you can set the | ||
# EXPENSIVE variable. With new enough versions of the proof tools, this will | ||
# restrict the number of EXPENSIVE CBMC jobs running at once. See the | ||
# documentation in Makefile.common under the "Job Pools" heading for details. | ||
# EXPENSIVE = true | ||
|
||
include ../Makefile.common |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
checkDataType proof | ||
============== | ||
|
||
This directory contains a memory safety proof for checkDataType. | ||
|
||
To run the proof. | ||
------------- | ||
|
||
* Add `cbmc`, `goto-cc`, `goto-instrument`, `goto-analyzer`, and `cbmc-viewer` | ||
to your path. | ||
* Run `make`. | ||
* Open html/index.html in a web browser. | ||
|
||
To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles. | ||
------------- | ||
|
||
* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof. | ||
* Use Makefile.arpa as the starting point for your proof Makefile by: | ||
1. Modifying Makefile.arpa (if required). | ||
2. Including Makefile.arpa into the existing proof Makefile (add `sinclude Makefile.arpa` at the bottom of the Makefile, right before `include ../Makefile.common`). |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file marks this directory as containing a CBMC proof. | ||
# This file is required by the run-cbmc-proofs.py to differentiate between a proof directory from a normal directory. |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ "expected-missing-functions": | ||
[ | ||
], | ||
"proof-name": "checkDataType", | ||
"proof-root": "test/cbmc/proofs" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* AWS IoT Over-the-air Update v3.1.0 | ||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
* this software and associated documentation files (the "Software"), to deal in | ||
* the Software without restriction, including without limitation the rights to | ||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
* the Software, and to permit persons to whom the Software is furnished to do so, | ||
* subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
/** | ||
* @file checkDataType_harness.c | ||
* @brief Implements the proof harness for checkDataType function. | ||
*/ | ||
/* Include headers for cbor parsing. */ | ||
#include "cbor.h" | ||
#include "ota_cbor_private.h" | ||
|
||
CborError __CPROVER_file_local_ota_cbor_c_checkDataType( CborType expectedType, | ||
CborValue * cborValue ); | ||
|
||
|
||
void checkDataType_harness() | ||
{ | ||
CborType expectedType; | ||
CborValue cborvalue; | ||
CborError cborResult; | ||
|
||
cborResult = __CPROVER_file_local_ota_cbor_c_checkDataType( expectedType, &cborvalue ); | ||
|
||
__CPROVER_assert( cborResult == CborNoError || cborResult == CborErrorIllegalType, | ||
"Invalid cborResult value: Expected either CborNoError or CborErrorIllegalType." ); | ||
} |
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
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.
Should this file have the same header and license as the other proofs?
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.
The copyright license needs to be updated in all the proofs with the updated version. There has been discussion going on. I will need to run a script in the main repo to update all the licenses in all the proofs.