1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-07-03 10:20:18 +08:00

130 Commits

Author SHA1 Message Date
Oscar Michael Abrina
4f7d1b9f9e
Enable debug logging in unit-test build and fix logging compilation error (#125)
- Update core_mqtt_config.h to specify logging level as LOG_NONE
- Update GA to set logging level as LOG_DEBUG
- Fix compile error in LogDebug of recvExact
2020-12-06 18:09:58 -08:00
Archit Aggarwal
b581fc4172
Bugfix: Fix interrupted network read operation (#120)
### Problem

The `MQTT_ProcessLoop` and `MQTT_ReceiveLoop` read incoming MQTT packet payload over the network by calling the `recvExact` function. The `recvExact` function can be called multiple times to read the expected number of bytes for the MQTT packet but it also implements a timeout functionality of receiving the expected number of payload within the timeout value passed to the function.
This causes problems when the `Transport_Recv` call returns less than requested number of bytes, and there is a timeout (for example, when calling `MQTT_ProcessLoop` with 0ms duration) which causes the function to assume failure instead of reading the remaining payload of the MQTT packet by calling `Transport_Recv` again. Thus, in such cases, the MQTT connection is severed prematurely even though there is a high probability of receiving the remaining bytes of the MQTT packet over the network.

### Solution
Instead of implementing a timeout on the entire duration of receiving the expected number of remaining MQTT packet bytes in `recvExact`, the use of timeout is being changed to be relevant only on the total time of receiving 0 bytes over the network over multiple calls to `Transport_Recv`.
As this modified meaning of the timeout duration is now unrelated to the timeout duration that the `MQTT_ProcessLoop` or `MQTT_ReceiveLoop` functions are called, a new configuration constant for the `recvExact` timeout value, `MQTT_RECV_POLLING_TIMEOUT_MS`, has been added to the library which will carry a default value of 10ms. 

Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-04 19:49:40 -08:00
Kareem Khazem
77e7c0168a
Update litani submodule pointer (#108)
This update ensures that final proof results get posted to GitHub even
when there are proof failures.
2020-12-04 11:35:06 -08:00
SarenaAWS
66a35e4213
Update version v1.0.0 to v1.0.1. (#97) 2020-11-02 12:11:10 -08:00
SarenaAWS
253ab295ff
Remove the memcpy function body in MQTT_Connect and MQTT_SerializeConnect proofs. (#96)
* Add missing function body removal for memcpy to MQTT_Connect and MQTT_SerializeConnect proofs.
2020-11-02 00:32:24 -08:00
SarenaAWS
93c15bdab8
Move transport_interface.h from portable/ to interface/ (#91)
* Move transport_interface.h to interface/ folder.

* Replace all paths to portable with interface.
2020-10-28 14:53:06 -07:00
Muneeb Ahmed
7a8a3accfc
Fix unit tests and increase coverage (#92)
* Fix typo from #74

* Move error test to happy path due to #83
2020-10-28 14:41:27 -07:00
Mark R. Tuttle
2b8c758020 Use kissat for property checking. 2020-10-23 13:33:38 -04:00
Mark R. Tuttle
e28d320141 Run CBMC proofs with kissat. 2020-10-23 13:33:38 -04:00
Mark R. Tuttle
14e6720c29 Remove CBMC prepare.py from .gitignore. 2020-10-23 13:33:38 -04:00
Mark R. Tuttle
4520348451 Remove CBMC prepare.py needed only for legacy CI. 2020-10-23 13:33:38 -04:00
Mark R. Tuttle
9a133c8bfd Update CBMC proof files from starter kit. 2020-10-23 13:33:38 -04:00
Mark R. Tuttle
42e1785ddc Update CBMC litani and starter kit submodules. 2020-10-23 13:33:38 -04:00
Oscar Michael Abrina
7f0478d13a
Remove const qualifier from send/recv in transport interface (#86)
This follows changes from FreeRTOS/FreeRTOS@398abba. The const qualifier is removed from send/recv because there are transport implementations that require a member of the network context to be modified such as in the case of mbedtls.
2020-10-21 11:12:28 -07:00
Nicholas Rodgers
421d65d74e Update contents of wellspring.txt 2020-10-05 19:19:10 +01:00
Nicholas Rodgers
88fcf3acc6 Change cbmc-batch.yaml to wellspring.txt 2020-10-05 19:19:10 +01:00
Archit Aggarwal
42889f7465
Fix submodule cloning logic for BUILD_CLONE_SUBMODULES CMake config (#76) 2020-09-28 18:51:36 -07:00
SarenaAWS
494684fe1a
Remove unused include directory from the CMakeLists. (#72)
Removed MQTT_INCLUDE_PRIVATE_DIRS from the CMake config files 
because there are no header files in there and files in that directory are 
not referenced in any #include in any library source, tests, or demos.
2020-09-25 11:00:49 -07:00
Muneeb Ahmed
788a64a45e
Fix build warnings and unit test improvements (#74)
* Create a structure to hold parameters for expectProcessLoopCalls
2020-09-25 10:37:25 -07:00
Kareem Khazem
24c4a5fd92 Change proof and harness names to starter kit
This commit updates the template starter kit and modifies the proofs and
Makefiles so that they conform to the latest standard. In particular,
this PR introduces the PROOF_UID variable to give each proof a unique
name.
2020-09-22 02:43:38 +01:00
Kareem Khazem
fd8778575b Highlight differences to 'normal' proof run script
This commit adds some comments that explain how the run-cbmc-proofs.py
script diverges from similar scripts that we use for other projects. The
comments begin with "# PROJECT SPECIFIC".
2020-09-22 02:43:38 +01:00
Kareem Khazem
a8c8bb1d19 Make CBMC use Kissat as the backend
This commit makes Litani run make with the EXTERNAL_SAT_SOLVER variable
set. The template Makefile uses the value of this variable to determine
which external SAT solver CBMC should call out to. We're using Kissat
because the default SAT solver takes too long on two of the proofs,
MQTT_SerializeConnect and MQTT_Connect.
2020-09-22 02:43:38 +01:00
Kareem Khazem
7a4c4c0960 Add script for running all proofs in parallel 2020-09-22 02:43:38 +01:00
Kareem Khazem
49912f3c2a Give each proof a different HARNESS_ENTRY 2020-09-22 02:43:38 +01:00
Kareem Khazem
3820656539 Add Makefile definitions for litani 2020-09-22 02:43:38 +01:00
Kareem Khazem
a0679de032 Use Litani-compatible starter kit 2020-09-22 02:43:38 +01:00
Kareem Khazem
af98fb492f Add Litani submodule 2020-09-22 02:43:38 +01:00
Muneeb Ahmed
38f24af76c
Set NULL payloads and fix unit test (#71)
* Set publish payload to NULL when zero length

* Add unit test for zero length payload

* Fix unit tests for deserialize publish

* Rename setupWillInfo to setupPublishInfo

* Remove void * from memset
2020-09-18 17:40:33 -07:00
Oscar Michael Abrina
c4990cba70
Log test results after running the coverage target (#70)
CMake is updated to log test results after running the coverage target
2020-09-17 13:41:05 -07:00
Archit Aggarwal
227c31e53e
Update versioning case (#66) 2020-09-16 11:36:03 -07:00
Archit Aggarwal
0d7d6b4124
Update unit test of deserializeConnack (#59)
Add unit test for deserializeConnack session present output parameter bug fixed in #56
2020-09-15 10:49:34 -07:00
Oscar Michael Abrina
0e1f5fb728
Add version number and missing @file tags (#53)
* Add version numbers

* Add missing @file tags

* Update lexicon.txt

* Update @brief tag for MQTT cbmc state

Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
2020-09-14 16:54:24 -07:00
Archit Aggarwal
627c64e563
Fix coverity_analysis target to include serializer (#55) 2020-09-11 19:25:19 -07:00
Archit Aggarwal
a5377c8ce8
Re-add MQTT library target to run coverity and test MQTT_DO_NOT_USE_CUSTOM_CONFIG config (#37)
* Add a library target to run Coverity analysis in CI
* Use the new library target as a mechanism to build the MQTT library without custom config
2020-09-09 14:23:18 -07:00
SarenaAWS
ea7d08f9bd
Move lexicon.txt to the top level. (#41) 2020-09-09 09:16:19 -07:00
Archit Aggarwal
3b0958bb4d
Hygiene changes in doxygen configuration (#38)
* Replace mqtt_config with core_mqtt_config in CBMC comments

* Update doxygen to generate configurations page with core_mqtt_config page name
2020-09-08 13:59:33 -07:00
fbbotero-aws
f9917f0721
Updating submodule aws-templates-for-cbmc-proofs to include CBMC change to use Kissat and speed up proofs (#34) 2020-09-04 13:19:42 -07:00
Archit Aggarwal
d355bfa259
Re-brand lightweight MQTT as MQTT serializer (#29)
Rename all instance of "lightweight" MQTT with "serializer" in files and documentation
2020-09-03 14:56:32 -07:00
Nathan Glimsdale
b591004ba5
Add formatting checks. (#30)
* Add formatting checks.

Co-authored-by: Sarena Meas <sarem@amazon.com>
Co-authored-by: Archit Aggarwal <architag@amazon.com>
2020-09-03 14:40:28 -07:00
Archit Aggarwal
56f024f4ba
Remove library target, and move CMake files under test folder (#28)
* Add license where needed in the test files.
* Remove default configs from the test core_mqtt_config.h.

Co-authored-by: SarenaAWS <6563840+sarenameas@users.noreply.github.com>
2020-09-03 13:25:25 -07:00
Kareem Khazem
b73a02959a Add CBMC Batch proof markers 2020-09-02 22:27:54 +01:00
SarenaAWS
bf48e6d0b6
Spellcheck github action (#24) 2020-09-02 10:38:17 -07:00
Archit Aggarwal
d0cc7ba5b3
Add spell check support to repository (#21)
* Add spell check scripts under tools/spell
* Break lexicon file into specific files for source/ and test/unit-test directories
2020-09-01 16:17:53 -07:00
Archit Aggarwal
09fbf71a3f
Enable CBMC proof builds (#16) 2020-08-31 16:23:26 -07:00
Muneeb Ahmed
54b54e78ad
Add define guards and change spellings (#15)
* Add checks for definition of false and true

* Prefer American spellings for optimize and acknowledgment
2020-08-31 14:51:21 -07:00
Muneeb Ahmed
b6bf2005ca
Fix bug that may sometimes disable keep alive (#7)
* Reset the waitingForPingResp flag in every MQTT_Connect
2020-08-31 12:45:46 -07:00
Archit Aggarwal
e83fadcfc7
Rename MQTT files, and Relocate CBMC and unit-test files (#12)
* Relocate CBMC to test/cbmc and unit test files to test/unit-test

* Rename all library and test files to use "core_" prefix
2020-08-31 10:02:38 -07:00
Archit Aggarwal
52ffc3af7f
Enable Cmake builds (#8)
* Update CMake infrastructure for repository to be self-sufficient for building targets
* Update GitHub CI workflow to only use build infrastructure of the repository
2020-08-28 14:47:22 -07:00
Nathan Glimsdale
f238a29b9f
Setup CI Actions (#5)
* Setup Unit Test Action
* Add complexity
2020-08-27 17:33:18 -07:00
Archit Aggarwal
f2581e5da5
Re-structure files (#3)
* Relocate library, test and doc files

* Add transport interface from C-SDK

* Update file path in mqttFilePaths.cmake
2020-08-27 16:29:26 -07:00