391 Commits

Author SHA1 Message Date
c8fa483b68 Add custom metrics to defender demo (#507)
Adds custom metrics to the defender demo. The metrics added are a list of the task ids and the stack high water mark.
2021-03-05 17:56:28 -08:00
5ff9863249 Update corePKCS11 submodule. (#505)
Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
2021-02-22 11:31:18 -08:00
693212bd05 Update Jobs demo to use DescribeJobExecution instead of StartNextPendingJobExecution API (#496)
It is recommended by the AWS IoT Jobs service to use DescribeJobExecution API for scaling purposes instead of StartNextPendingJobExecution API. Thus, update the Jobs demo to replace the latter API call with the former API call.
2021-02-10 15:25:25 -08:00
a78cb45d12 Minor changes to wolfSSL MQTT demo files (#493)
* Clean up demo config for wolfSSL mutual auth. 
* Add comment about picking the correct ROOT CA.
* uncrustify using_wolfSSL.c and some other code style changes.
* Apply suggestions from code review

Co-authored-by: Archit Aggarwal <architag@amazon.com>
2021-02-04 16:17:34 -08:00
dfdf2ddf1f Add MQTT_Mutual_Auth_wolfSSL demo (#464)
Add a demo that shows MQTT over TLS mutual authentication connection and communication with a broken when using wolfSSL as the TLS library.
2021-02-02 17:28:43 -08:00
52c9756f21 Call taskYIELD after calling FreeRTOS_send in Plaintext_FreeRTOS_send (#491)
FreeRTOS_send adds the packet to be sent to the IP task's queue for
later processing. The packet is sent later by the IP task. When
FreeRTOS is used in collaborative mode (i.e. configUSE_PREEMPTION is 0),
the Plaintext_FreeRTOS_send function returns without actually sending
the packet as the IP task never gets a chance to run.

The fact that Plaintext_FreeRTOS_send returns without actually sending
the packet causes an issue in the MQTT_Connect which expects the CONNECT
packet to be actually sent and waits for CONNACK.

This commit adds a taskYIELD call after calling FreeRTOS_send to ensure
that the IP task gets a chance to run and send the packet before the
Plaintext_FreeRTOS_send function returns.
2021-01-25 14:30:42 -08:00
3a7da90c4f Qemu Mps2 network interrupt (#487)
* Enable netwrork nterrupt handling for Qemu MPS2

* Fix interrupt priority

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2021-01-04 11:08:47 -08:00
1c99d9f200 Prevent optimization in reset handler for QEMU MPS2 (#484) 2020-12-22 22:39:33 -08:00
da9b9a800d [AUTO][RELEASE]: Bump file header version to "202012.00" 2020-12-15 11:50:37 -07:00
45ba920ad0 [AUTO][RELEASE]: Bump submodules per manifest.yml for V202012.00 2020-12-15 10:22:10 -07:00
2e2ba99a74 [AUTO][RELEASE]: Bump file header version to "202012.00" 2020-12-15 10:20:29 -07:00
89c6fc6baf Update FreeRTOS-Plus-TCP (#479) 2020-12-14 22:09:01 -07:00
4ec66eb364 Move mbedtls tag to v2.25.0 2020-12-14 20:52:09 -08:00
db18ff7d59 Fix pkcs11 demo build. 2020-12-14 20:52:09 -08:00
f4591cec06 Stack fix (#475) 2020-12-14 19:10:03 -08:00
bff2f04c5f Update submodule pointers (#476) 2020-12-14 15:45:27 -08:00
6155c025a2 Update submodules of CSDK libraries (#473) 2020-12-13 17:31:14 -08:00
028bf653f7 Delete HTTP demo task upon completion (#472)
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-12-12 21:01:59 -08:00
2e0de9aa70 Clean up demo project files (#468) 2020-12-12 16:35:43 -08:00
41237e01d0 Split networking from posix and qemu mps2 demos (#455)
Split networking from posix and qemu mps2 demos
2020-12-12 16:29:23 -08:00
a503a3a7a0 Add links to the MQTT agent in the non-agent mqtt demos (#470)
Add URL file links to the MQTT agent documentation page.
Add comment blocks into each demo that also point toward the MQTT agent documentation to ensure users are aware the agent method exists.
2020-12-11 21:12:44 -08:00
1d444eecae Update mbedtls to v2.24.0 (#465)
* Set mbedtls submodule tag to v2.24.0

* Update projects

Co-authored-by: Oscar Michael Abrina <abrinao@amazon.com>
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-12-11 17:16:47 -08:00
f23752164b Map errors from FreeRTOS+TCP to mbedTLS and make read non-blocking when requesting start of frame (#452)
From the FreeRTOS documentation, pdFREERTOS_ERRNO_ENOSPC means that timeout occurred before any data could be sent or received.
- In the plaintext transport-interface implementation, we would directly return `-pdFREERTOS_ERRNO_ENOSPC`. However, an error like this can occur when the TCP buffer is full, so this ought to be retriable. Libraries that consume the transport interface interpret a return value of 0 to mean that send/recv can be invoked again to get the data. As such, we should appropriately set the return value as 0 when the status is `-pdFREERTOS_ERRNO_ENOSPC`.
- In the mbedTLS port, we would directly return whatever `FreeRTOS_send` or `FreeRTOS_recv` returns. However, sometimes, the return value can be an error. In such cases, we ought to map an error from FreeRTOS+TCP to an equivalent error in mbedTLS. In the case of `-pdFREERTOS_ERRNO_ENOSPC`, we map that to `MBEDTLS_ERR_SSL_TIMEOUT`. When the mbedTLS transport-interface send/recv wrapper sees that value, it appropriately returns 0, so that the library can retry the send/recv. I've verified that when the mbedTLS port returns an error, that same error is returned by `mbedtls_ssl_write` & `mbedtls_ssl_read`.
- The TCP socket may have a receive block time.  If bytesToRecv is greater than 1 then a frame is likely already part way through reception and blocking to wait for the desired number of bytes to be available is the
most efficient thing to do.  If bytesToRecv is 1 then this may be a speculative call to read to find the start of a new frame, in which case blocking is not desirable as it could block an entire protocol agent task for the duration of the read block time and therefore negatively impact performance.  So if bytesToRecv is 1 then don't call recv unless it is known that bytes are already available.

Co-authored-by: abhidixi11 <44424462+abhidixi11@users.noreply.github.com>
Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
2020-12-11 12:51:45 -08:00
ebd1cdf702 Add comment about handling S3 request limits to S3 download demos (#462)
- Adding a comment to the top of S3 download and multi-threaded download demo source code files, to explain how to handle S3 request limits. This is done to prevent users from treating this case as a bug.
- Increasing ipconfigTCP_RX_BUFFER_LENGTH to 5000, as was done recently for other demos.
2020-12-11 14:34:20 -05:00
1c2c671e7a Update comments about NetworkContext definition (#461)
Small change that simply specifies why the NetworkContext must be defined by each compilation unit along with details on how to include it to your project.

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-12-11 11:09:03 -08:00
d93a3d63a0 Update demos to use version macro from coreMQTT (#460)
Update demos to use the MQTT_LIBRARY_VERSION macro for the coreMQTT version they report in their metrics
2020-12-10 12:05:02 -08:00
c0d4c7c67c Update MQTT config for Keep Alive demo that uses dummy timer (#457)
The MQTT library has been updated with the MQTT_RECV_POLLING_TIMEOUT_MS and MQTT_SEND_RETRY_TIMEOUT_MS configurations which should be set to zero when using a dummy timer function to avoid possibility of infinite loop when retrying failed transport send/receive calls. As the MQTT Keep Alive demo uses a dummy timer function, this PR updates the demo configuration to set these timeouts to zero.
2020-12-09 19:02:51 -08:00
492ac6edb2 Move corePKCS11 forward and update to latest core_pkcs11.h (#441)
* Move corePKCS11 forward.
* Update licenses.
* strip NULL terminator.
* Add threading_alt.h
* Use github link.

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-12-07 17:30:20 -08:00
353d2ef35b Fix FreeRTOS+TCP submodule pointer (#453)
The FreeRTOS+TCP submodule pointer was set to a commit not in main,
which also lacked commits in main, which ended up causing build failures
for defender demo.
2020-12-07 14:03:18 -08:00
57161da956 Update HTTP demo project files (#451)
* Update project filters

* Address inaccurate retry count
2020-12-07 10:34:12 -08:00
87662ff4d8 Replace GPL with FreeRTOS license in MbedTLS demo config files (#447)
Since we own mbedtls_config.h files, updating the GPL to use the FreeRTOS license instead.
2020-12-04 18:38:40 -05:00
4538b99a9b Change all occurrences of broker to server in coreHTTP demos folder. (#445) 2020-12-04 15:09:54 -08:00
46acf2863a Update readme.txt (#446)
* Update readme.txt

* Update readme.txt

* Update readme.txt

* Update check-header.py

Co-authored-by: Joseph Julicher <jjulicher@mac.com>
2020-12-04 14:16:57 -08:00
d69c9c01e8 Port S3 multi-threaded download demo from C-SDK (#436)
Adding demo to demonstrate the use of pre-signed URLs to connect and download from a S3 bucket. Sends multiple GET requests synchronously to download a file in chunks using range headers. Uses a request and response task in addition to the main HTTP servicing task.
2020-12-04 16:14:41 -05:00
b7b9ccb099 Qemu mps2 networking (#439)
* Demo: Add Support for netwroking in Qemu for MPS2 AN385
* Add tcp echo client
* Add steps to Readme
2020-12-03 23:44:57 -08:00
79e432738b Adds error messages for AWS demo mqtt helpers + misc fixes (#440)
Switch MQTT helpers to logging error message instead of error code.
Adds time parameter to xProccessLoop so defender demo does not wait extra time.
Fixes some incorrect returns in metrics_collector.c
2020-12-03 19:10:10 -08:00
9c1efa8d02 Update WindowsTargetPlatformVersion to 10.0 (#442)
CI only supports 10.0, so this change is required for CI to build this demo correctly on Visual Studio.
2020-12-03 18:47:42 -08:00
934020a5a2 Move WolfSSL to ThirdParty and Submodule code (#433)
* Submodule wolfSSL and move wolfSSL and WolfSSL-FIPS-Ready to ThirdParty folder.

* Update VS studio project.

* Update FIPS project settings.

* Update FIPS demo readme.

* Add md to ignored file extensions.
2020-12-03 17:42:50 -08:00
4651c46479 Add retries to demos in case of a failure. (#435) 2020-12-02 17:39:09 -08:00
d2fcf20caf Port S3 Upload Demo from C-SDK (#417)
Adding demo to use script-generated pre-signed URLs to establish a TLS connection and upload a small file to an S3 bucket using a single PUT request, and then verify the upload by obtaining the file size from S3 and comparing it to the size of the local file.
2020-12-02 18:05:45 -05:00
24def41337 Port S3 Download Demo from C-SDK (#416)
Adding demo to use script-generated pre-signed URLs to establish a TLS connection and synchronously download a file from an S3 bucket, with multiple GET requests.
2020-12-02 17:51:11 -05:00
9a452918d1 Add UDP demo running FreeRTOS+TCP (#425)
* Add FreeRTOS+TCP UDP only demo.

* Update folder name and remove old one

* Update the network interface to be used.

* Update headers

* Update header

* Header update and folder name correction

* Remove WinPCap folder
2020-12-02 14:30:50 -08:00
eec68e8790 Fix TLS handshake failures in demos (#438)
Increase default size of FreeRTOS+TCP RX buffers in TLS demos to avoid TLS handshake failures
2020-12-02 11:03:55 -08:00
05dc34b27b Clean up server setup instructions for MQTT and HTTP demos (#429)
- Removes a broken link to configure Windows Firewall
- Removes references to Mosquitto in the httpbin server setup instructions
2020-12-01 20:28:50 -08:00
73b0d1b259 Support multiple transports in the same compilation unit (#434)
By removing the definition of the NetworkContext struct in the header file, we allow the application to define it. This allows an application writer to use multiple transports in the same compilation unit. That way, multiple .c files do not have to be created for each transport.
2020-12-01 17:24:18 -08:00
a7825dc973 Update FreeRTOS+TCP submodule pointer (#427)
Updates the FreeRTOS+TCP submodule pointer.
This brings in a fix that needs changes in defender demo.
2020-11-30 13:44:44 -08:00
682447445b Bump backoffAlgorithm submodule for API change and update demos (#426)
The API of FreeRTOS/backoffAlgorithm library has changed to remove dependency on random number generator; instead require the caller to generate the random number and pass it to the BackoffAlgorithm_GetNextBackoff API for backoff period calculation. This PR updates the submodule pointer commit, and updates the demos and tests to use the simplied library API
2020-11-30 11:12:07 -08:00
220dd5cc1c corePKCS11 submodule and file path update (#424)
* Move PKCS #11 submodule forward.

* Update file path for folder update in corePKCS11.

* Update mbedtls file filter.
2020-11-30 10:38:14 -08:00
5f72c0031d Have metrics collector return amount written (#428) 2020-11-28 15:31:24 -08:00
152b7db2c1 Add "Demo completed successfully" log in Jobs demo (#421) 2020-11-24 17:13:11 -08:00