3208 Commits

Author SHA1 Message Date
ae92d8c6ee Add uncrustify github workflow (#659)
* Add uncrustify github workflow

* Fix exclusion pattern

* fix find expression

* exclude uncrustify files

* Uncrustify common demo and test files

* exlude white space checking files

* Fix EOL whitespace checker

* Remove whitespaces from EOL

* Fix space at EOL

* Fix find spaces at EOL

Co-authored-by: Archit Aggarwal <architag@amazon.com>
2021-07-22 14:23:48 -07:00
dd80d615b5 Remove duplicate error.c in WIN32.vcxproj.filters files (#662) 2021-07-22 11:42:29 -07:00
e2b1d46340 Update the template readme file (#658)
Update instructions to use repositories instead of directories.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2021-07-20 15:13:54 -07:00
1e4f79709c Some changes for upcoming release (#657)
Update mbedTLS submodule to v2.26.0 and update History.txt
2021-07-20 14:58:39 -07:00
6c17a54685 CorePKCS11 Muthual Auth demo fix (#656) 2021-07-19 17:23:17 -07:00
aa1eed8b4e Defender demo cleanup (#651) 2021-07-19 16:32:53 -07:00
63d38b846e Remove redundant mbedtls error sources (#654)
Since `mbedtls_error.c` is already part of the mbedTLS submodule, the duplicate files are removed from this repository.

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2021-07-19 16:17:18 -07:00
a44df5c1b9 Fix clock drift issue in SNTP demo (#655)
Issue
The existing clock discipline algorithm in the coreSNTP demo yields an inaccurate wall-clock time (in UTC) that is always behind the astronomical UTC time by the chosen polling interval period of the demo. The issue with the clock discipline algorithm was that it was calculating the slew rate to make the system clock be gradually compensated for the previous time synchronization clock drift over the period of the subsequent polling time interval. Thereby, the clock slew rate correction calculated is always lower than it should be (because it does not incorporate possible clock drift that would occur over another period of time polling interval till the next time synchronization attempt).

Fix
This PR fixes the clock discipline algorithm to make the demo calculate its system time that matches the astronomical UTC time.
The fix involves simplifying the clock discipline algorithm to use a combination of step and slew correction approaches where:

1. Step correction is applied on EVERY time successful synchronization with a time server. This immediately corrects the system time to match server time.
2. Slew rate is calculated ONCE (on the second successful time synchronization with server) and applied henceforth, on every time polling interval period to compensate gradually for the system clock drift during the period.
2021-07-19 16:05:35 -07:00
a9c27ccdac [P3] Update corePKCS11 demo to read the public key (#652)
* PKCS11 fix
2021-07-16 16:30:09 -07:00
2fedeff332 Update BSP and SDK for HiFive board (#645)
* Update BSP and SDK for HiFive board

This commit also adds demo start and success/failure output messages.
2021-07-15 18:40:22 -07:00
b550e6090d Add note in coreSNTP demo about Network Time Security (NTS) (#648)
This PR makes the following changes in the coreSNTP demo:

To suggest the most secure way of using SNTP communication, we are adding a documentation note about the Network Time Security in the SNTP demo.
Hygiene update of using the FreeRTOS/backoffAlgorithm utility library for calculating time polling period interval backoff when time requests are rejected by a time server.
2021-07-15 15:21:29 -07:00
e38c279b22 Fix: qemu mps2 demo bug (#649) 2021-07-15 14:32:37 -07:00
096824515f Cleaned up report_builder in defender_demo_json (#644) 2021-07-14 14:12:23 -07:00
5a4fe788d7 Update coreSNTP demo to avoid issues from open UDP socket (#647)
Issue
There is a possible vulnerability of Denial of Service attack by keeping the UDP socket for the SNTP client task always open in the coreSNTP demo. The Denial of Service attack can occur from receiving multiple server response (duplicated or malicious) for a single SNTP time request sent by the client, and thereby, filing the socket network buffer response packets that affect future time requests.

Solution
This PR fixes this vulnerability by updating the demo to keep a UDP socket open only for the time period of waiting for server response, closing the socket on either receiving a server response or experiencing server timeout, and re-creating a UDP socket for the next polling try. This PR also adds another security functionality using a random port for UDP socket to protect against spoofing attacks from "off-network path" attackers.
2021-07-14 13:21:40 -07:00
3fd635b39e [P3] Submodule pointer update to LTS Libraries (#640)
* moved submodule to backoff v1.0.1

* move corehttp module to latest commit

* move coremqtt module to latest commit

* move coremqtt Agent module to latest commit

* move coreSNTP Agent module to latest commit

* move coreJSON Agent module to latest commit

* move corePKCS11 Agent module to latest commit

* Reverting coreHttp to previous commit

* Updating coreHttp pointer after fix
2021-07-14 12:10:35 -07:00
693a9994b0 Add static to a variable in Qemu mps2 demo (#646) 2021-07-14 10:05:22 -07:00
d663850e1b Demo: Exit on Error with Qemu MPS2 Full Demo (#642) 2021-07-13 21:13:31 -07:00
141070a2eb Demo: Run uncrustify on quemu mps2 demo (#643) 2021-07-12 18:04:36 -07:00
25e73f2e75 RP2040 Demo (#618)
* Fix code to match comment; idle prioriry task should not block to yield, as then it will hardly run at all (bug affects SMP tests)

* Add RP2040 Demo - can be used for 'main' or 'smp' branch of FreeRTOS_Kernel

* move to latest main/ of FreeRTOS-Kernel

* move RP2040 demos into Community-Supported

* Update whitespace issue

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>

* Add SMP to lexicon

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2021-07-09 09:32:42 -07:00
bec88bfe41 Update the size of privileged data section (#639)
This is needed because FreeRTOS heap is now placed in the privileged
data section.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2021-07-07 13:14:40 -07:00
6ef5c92233 Updated device-shadow submodule to support named shadow, and updated demo to use named shadow (#636) 2021-07-07 11:15:33 -07:00
d1c84a324a Template Project for existing FreeRTOS port (#637)
* Partner demo changes

* Adding template folder

* readme addition to partner supported folder

* updating license

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2021-07-01 12:36:31 -07:00
b8bcbf2a40 Fix data copy address error (#634) 2021-06-29 10:18:00 -07:00
a14f136596 Doc: Add new lines 2021-06-28 17:07:24 -07:00
449ad960e2 Doc: Improve debugging doc with Qemu demo 2021-06-28 17:07:24 -07:00
e66c4a93ee Fix data copy address error (#632)
* Fix data copy address error

Co-authored-by: Jinping Wu <jinping.wu@verisilicon.com>
2021-06-28 14:19:26 -07:00
ac5bf3b934 Update coreSNTP submodule and coreSNTP demo (#631)
Update the coreSNTP submodule to the latest commit. Also, make updates to the coreSNTP demo for the new changes in the SNTP library which include the following:

1. Update to the type for packet size from size_t to uint16_t for parameters in the transport and authentication interfaces.
2. Change in the call to Sntp_SendTimeRequest API to pass the new blockTimeMs parameter added to the API.
3. Update to the clock-offfset type from int32_t to int64_t for representing information in milliseconds. To accommodate this update in the SntpSetTime_t interface, the mathematical model for representing system clock has been updated to store slew rate as milliseconds/second (instead of second/second). This change improves the accuracy of the WinSim demo time correction (because the milliseconds of time difference between server and client time is corrected over the entire polling interval which makes a significant difference!).

This PR also adds demo config macros for setting the block time values passed to the Sntp_SendTimeRequest and Sntp_ReceiveTimeResponse APIs.
2021-06-25 12:19:00 -07:00
4c4a0ab755 Fix Bug from Issue #565 (#629)
Co-authored-by: Victor <vfernandez@maccorobotics.com>
Co-authored-by: Paul Bartell <pbartell@amazon.com>
Co-authored-by: Shivangi <66447522+gshvang@users.noreply.github.com>
2021-06-21 17:39:10 -07:00
434eeadf9f Add new demo submodules to manifest.yml (#630) 2021-06-21 17:12:33 -07:00
5e596c2e32 Add new submodules for port demo contribution (#628)
Adds two new submodules for community and partner supported ports demos.
2021-06-21 10:42:23 -07:00
5a41846f05 Add authentication support to coreSNTP demo (#625)
Update the coreSNTP demo to showcase use of symmetric key algorithm of authentication scheme for securing SNTP communication between client and server.
The demo uses the AES-128-CMAC algorithm for the generating Message Authentication Code for the client on sending the SNTP time request to server as well as validating the server response received by verifying if the payload present authentication code can be generated. Use of an authentication mechanism in SNTP communication protects against server spoofing attacks as well as man-in-the-middle attacks of server response modification.

The demo uses corePKCS11 library for the AES-CMAC operations. Also, the demo adds functionality of generating random number, using corePKCS11, for sending as a parameter to the Sntp_SendTimeRequest API.

Note: For symmetric key based security mechanism to be protective against malicious, it is IMPORTANT to securely pre-share the symmetric key between client and server.
2021-06-16 10:22:06 -07:00
f771faef4a Add unauthenticated mode demo for coreSNTP library for time synchronization (#621)
Add the FreeRTOS/coreSNTP library as a submodule (along with manifest.yaml file update) and add a demo project to showcase use of the coreSNTP library for having a SNTP client daemon in the system for periodically synchronizing system time with the internet to maintain Coordinated Univeral Time (UTC) in a device. This demo maintains UTC time of system in RAM, thereby, representing systems without a Real-Time Clock (RTC) module in the device.

Note: This demo shows use of coreSNTP library for SNTP communication with NTP/SNTP time servers in non-authenticated mode (i.e. without any security mechanism payload beyond the standard 48 bytes of NTP packet exchange between client-server).
2021-06-10 13:42:42 -07:00
6881522370 Demo: fix trace vs coverage options, add option no trace on enter 2021-06-09 16:08:24 -07:00
b6624fa44d Remove or rework assumptions in queue proofs (#603)
This commit is paired with another to queue.c in the kernel.  To
accomodate changes in newer versions of CBMC, the
--pointer-overflow-check is removed.
2021-06-04 15:42:14 -04:00
d9ddcc0134 Add Lexicon word 2021-06-02 11:00:10 -07:00
9904e571f9 Remove extra Makefile print 2021-06-02 11:00:10 -07:00
b0e693e88b Demo: exit 1 on error exit 2 on Ctrl_C 2021-06-02 11:00:10 -07:00
e84fc19966 Make full demo exit on error 2021-06-02 11:00:10 -07:00
aed7209b7a Bump urllib3 from 1.26.4 to 1.26.5 in /.github/scripts/common (#617)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.4 to 1.26.5.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.4...1.26.5)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-02 09:29:22 -07:00
f37753da06 Update unit tests to match changes in queue.c (#614) 2021-06-01 15:33:43 -04:00
ea798d0612 Update release scripts to handle new "<DEVELOPMENT BRANCH>" version tags. (#615)
Add support for setting the main branch version number in task.h from within the github auto release workflow.
2021-05-28 07:22:30 -07:00
0c0333985b Run unctustify, fix some Readme wording 2021-05-27 20:07:54 -07:00
a2029c781c Enable profiling for the linux port 2021-05-27 20:07:54 -07:00
784fb8c157 Bump urllib3 from 1.26.3 to 1.26.4 in /.github/scripts/common
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.3 to 1.26.4.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.3...1.26.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-27 17:54:39 -07:00
e78feebe7b Allow pip to determine the correct version of colorama and requests 2021-05-27 17:38:55 -07:00
5136a30399 Test: Mask unit test warning (#592)
* Test: Mask unit test warning

* Fix Unit Test Bug

* Unit Test: Add setters and getters for xMaskAssertAndAbort

* Fix Warning

* Update Makefile
2021-05-27 16:26:31 -07:00
459a6cbb4c Update header_checker.py to support python and assembly files.
Add support for checking and verifying SPDX license identifiers.
2021-05-27 15:59:21 -07:00
3c4049c8f7 Update kernel HEAD (#611) 2021-05-27 14:37:41 -07:00
803016a27a Updated demo_config.h and include paths for OTA demos (#605)
Co-authored-by: Jason Carroll <czjaso@amazon.com>
2021-05-27 10:48:03 -07:00
5d3ec8031f deprecating the mcf5235 demos (#609) 2021-05-26 16:37:01 -07:00