Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
[Add] Added RZ/A2M Evaluation Board Kit (#50)
Browse files Browse the repository at this point in the history
* [UPDATED] RX65N-envision-kit CCRX with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-envision-kit GCC with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-gr-rose CCRX MQTT demo with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-gr-rose GCC MQTT demo with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk-uart-sx-ulpgn CCRX with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk-uart-sx-ulpgn GCC with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk-uart-esp32 CCRX with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk-uart-esp32 GCC with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk-uart-esp32 GCC with FIT v122

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] RX65N-rsk CCRX  OTA type1,2 and 4 with FIT v122.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] scfg file

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [ADDED] RX72M RSK GCC e2 studio with E2 Emulator Lite

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Folder name of RX72M-RSK GCC project

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] RTOS option setting

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] Updated to BSP v5.40

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATE] Implemented SHA256-ECDSA OTA transfer (signature verification is confirmed)

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED]RX72M RSK CC-RX e2 studio with E2 Emulator Lite
Fixed Debugger setting

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [ADDED] boot loader message for integrity check scheme information. (boot_loader.c)
[FIXED] bug when compiling optimization would be ON. (aws_ota_pal.c)

Signed-off-by: HirokiIshiguro <hiroki.ishiguro.fv@renesas.com>

* [UPDATE] Updated the test project so that OTA works in the device tester (test has not passed yet)

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [UPDATE] same configuration conditions in demo and test

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Fixed the data flash size handled by the boot loader from 32KB to 16KB.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [UPDATED] bsp version

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED] Random algorithm

Signed-off-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>

* [FIXED]boot loader code

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED] OTA PAL Semaphore

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED] OTA Test MQTT configuration value

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED]OTA test section
       Debug setting
       Printf output port

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [UPDATE]OTA GUI tool

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [UPDATE] boot loader code

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [UPDATE]Added OTA batch file for devicetester.

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED]Folder name

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED]Bootloader output mot file.

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [UPDATE] Add dummy write project.

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED] GUI tool binary setting switch.

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [UPDATED] aws_tests flashing project (for Renesas Flash Programmer) file path.

Signed-off-by: HirokiIshiguro <hiroki.ishiguro.fv@renesas.com>

* [UPDATE]Motorola Converter tool

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED]Motorola Converter tools

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [UPDATE]Supports fragment data for OTA PAL.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Fixed OTA PAL code.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Supported OTA PAL test.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED]Pass file lock check.

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED] Supported OTA PAL test.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Secure Sockets Code

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Ether config and FreeRTOS config files.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] wrong section setting for aws_tests.

Signed-off-by: HirokiIshiguro <hiroki.ishiguro.fv@renesas.com>

* [REVERTED] aws_tests optimize level from 2 to 0.
[REVERTED] aws_demos buffer pool size.

Signed-off-by: HirokiIshiguro <hiroki.ishiguro.fv@renesas.com>

* [FIXED] Fixed to work with IoT Device Tester.
 - Updated demo and test FIT module
 - Revised configuration conditions
 - Fixed OTA Pal code

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] mot file converter Initial firm tabControl1

Signed-off-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>

* [FIXED] Fixed to work with IoT Device Tester.
 - Supported the OTA agent test named prvParseJobDocFromJSONandPrvOTA_Close().
 - Changed boot loader project optimization level to 2.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Supports reset during firmware update. The operating environment has been revised.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Deleted old file (aws_demos_build_path_check_and_make.bat)

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [REVERT] Use mqtt demo for default
This reverts commit 594bfe4.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [REVERT] Revert the Motorola conversion tool to the previous commit.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Fixed configuration file to AWS default condition.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Fixed fragment data write process.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [FIXED] Fixed fragment data write process.

Signed-off-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>

* [RZ/A2M] Added SX-SDMAC projects, and OTA feature

* [RZ/A2M] Modified OTA bootloader

* [RZ/A2M] Renamed python script

* CY8CKIT-064S0S2-4343W: Add back OTA

Signed-off-by: Raymond Ngun <raymond.ngun@cypress.com>

* nrf52 spi w/ new loopback tests -- disabled by default

* Add board specific configuration. Currently only SPI 1 supported

* uncrustify

* Merge error. Meant to remove callback installation

* Fix remaining warnings and make transfer atomics instance-specific

* Address remaining PR requests. sOpenend --> ucState and reset config to default at close

* PSoC64: force reprov_helper.py to use cm0 DAP for flash erase ops

Re-provision helper script uses pyocd to erase Flash. By default,
pyocd uses sys_ap port which is not available if the board runs TFM.
This causes a failure when attempting to re-provision a board that
was previously programmed with TFM CM0P image.

- force pyocd to use cm0_ap for Flash erase operations
- also update acq_win to 100ms to be inline with the default policies

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* Add check for token to be true when generating a public key. (aws#2178)

* Add test case for the token property on a public key when generating a key pair (aws#2177)

* OTA: Handle new job document after resuming while previous job is in progress

* FreeRTOS+TCP : print resource statistics routine (aws#2164)

Co-authored-by: Hein Tibosch <hein@htibosch.net>

* Sync Single Echo Client demo tasks (aws#2181)

* Allow child tasks to finish before Parent

* Safely increment the variable

* Use semaphores for sync

* minor correction

* Allow task to delete itself + minor modifications

* Remove unused variables.

* uncrustify

* Changes after Cobus's comments

* Renable encrypt then MAC for CBC now that CBC is renabled. (aws#2174)

* Fix: Cypress PSoC64 Cmake warning.

* Fix: PSoC64 BLE is missing in AFR_METADATA_MODE.

* Formatting Spaces vs Tabs

* PSoC64: fix application version parameters

- fixed version variables related warnings in all supported apps
- fixed aws_demo and wifi_scanner version parameters specified
  via env variables

aws_demo
--------
cmake build:
uses definitions in aws_application_version.h
MTB make build:
uses env variables if specified, otherwise - from
mtb/aws_demos/include/aws_application_version.h

ota, wifi_scanner and jitp apps
--------------------------
MTB make build:
uses env variables if specified, otherwise the values from
aws_application_version.h in the app's dir

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* PSoC64: fixing INCLUDE_xTaskIsTaskFinished implicit declaration warning

the warning (gcc make and cmake):

vendors/cypress/bluetooth/psoc6/cyosal/src/cybt_osal_amzn_freertos.c:
  In function 'wiced_rtos_join_thread':
vendors/cypress/bluetooth/psoc6/cyosal/src/cybt_osal_amzn_freertos.c:312:13:
   warning: implicit declaration of function 'xTaskIsTaskFinished'; did you mean
   'INCLUDE_xTaskIsTaskFinished'? [-Wimplicit-function-declaration]
     while ( xTaskIsTaskFinished( thread->_thread ) != pdTRUE )
             ^~~~~~~~~~~~~~~~~~~
             INCLUDE_xTaskIsTaskFinished

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* PSoC64: fixing 'struct flash_area' warning

A forward declaration of 'struct flash_area' is needed for the
psoc6_smif_read and psoc6_smif_write prototypes.
Full structure declaration is in flash_map_backend.h.

The warning:

In file included from
vendors/cypress/boards/CY8CKIT_064S0S2_4343W/aws_demos/application_code/main.c:36:
vendors/cypress/common/mcuboot/cy_flash_pal/include/cy_smif_psoc6.h:62:34:
warning: 'struct flash_area' declared inside parameter list will not be visible
outside of this definition or declaration
int psoc6_smif_read(const struct flash_area *fap, off_t addr, void *data, size_t len);

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* PSoC64: supressing ARM CLang linker warnings 6329, 6314 and 6304

Not being able to fix these in code, supressing CLang linker
warnings that is safe to ignore:

- L6304W - Duplicate input file <filename> ignored.
  The specified filename occurred more than once in the list of
  input files. GCC linker ignores this and gives no warning.
- L6314W - No section matches pattern <module>(<section>).
  There is no data/code to place in the section defined in scatter
  file. Ignored by GCC linker.
- L6329W - Pattern <module>(<section>) only matches removed unused
  sections. Some code is not used and was optimized out thus living
  the section empty (i.e. cy_ramfunc)

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* PSoC64: warning in iot_pkcs11_psa_object_management.c

cmake, IAR:

mbedtls_pk_type_t uxPrivateKeyTypePKCS11 = 0;
                                           ^
vendors/cypress/boards/CY8CKIT_064S0S2_4343W/ports/pkcs11/psa/
iot_pkcs11_psa_object_management.c",85  Warning[Pe188]:
enumerated type mixed with another type

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* PSoC64: warning in flash_qspi.c

cmake, IAR, aws_demos:

stat = -1;
       ^
vendors/cypress/common/mcuboot/cy_flash_pal/flash_qspi/flash_qspi.c,401
Warning[Pe188]: enumerated type mixed with another type

Signed-off-by: Andrei Narkevitch <ainh@cypress.com>

* CY8CKIT-064S0S2-4343W: Allow for OTA builds

Updates to projects to allow for successful OTA build when
enabled.

Signed-off-by: Raymond Ngun <raymond.ngun@cypress.com>

* Update PKCS #11 unit tests to account for x509 parsing in C_GetAttributeValue.

* Refactor Key Size Macros (aws#2196)

* Refactor Key Size Macros
Fix TODO for writing a key to DER.
Added size specific macros for the keys currently supported by the stack.
Use smallest possible buffer for converting keys to DER.

* Fix: Support for lwip getip with espressif (aws#2135)

* Fix: Support for lwip getip with espressif

* Update iot_wifi.c

* Update iot_test_wifi.c

* Update iot_wifi.c

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
Co-authored-by: Archit Aggarwal <architag@amazon.com>

* Enable RPA for ESP32 NimBLE (aws#2193)

* Fix: Enable BLE in Cypress PSoC64 MTB demo project.

* OTA: Support force cancel of in progress job

* OTA: Cleanup data interface when closing the file

* Feature/update mbedtls (aws#2219)

* Update Mbed TLS submodule pointer to v2.16.7
* Update aws_mbedtls_config.h for Mbed TLS v2.16.7
* Update README.md to include information on Mbed TLS

* DNS lookup: warn if ipconfigDNS_CACHE_NAME_LENGTH is too small (v2) (aws#2207)

* FreeRTOS+TCP : DNS look-up: warn if buffer length is too short

* Corrected indentation in function prvPrepareLookup()

Co-authored-by: Hein Tibosch <hein@htibosch.net>

* Make each config of a CBMC proof have unique name

Some CBMC proofs are built in several different 'configurations'. Prior
to this commit, the name of each of these configurations was the same as
the name of the original proof. This meant that CI would sometimes write
the proof artifacts of each of these configurations on top of each
other, since the artifacts are saved under a folder whose name is based
on the name of the proof.

This commit fixes this so that each configuration of each proof has a
unique name, formed by joining the name of the configuration to the name
of the proof with a double underscore---for example,
TaskIncrementTick__config_default.

* Update aws_mbedtls_config.h header file (aws#2233)

* Increase the logging queue size for Xilinx Microzed (aws#2129)

This is for the "Demo completed successfully" text to print for the CI.

* PKCS #11 TODOs (aws#2213)

This commit addresses the last of the TODOs in iot_pkcs11_mbedtls.c
* Removed a TODO refactor comment as it was vague.
* Added a variable to track whether the sign and verify key is the same as the last operation, saving key parse operations.

* Reintroduce MBT to CMake and the windows test project. (aws#2222)

* Reintroduce MBT to CMake and the windows test project.

* UDP: Add ipconfigUDP_PASS_ZERO_CHECKSUM_PACKETS compile time constant (aws#2225)

* UDP: Add ipconfigUDP_PASS_ZERO_CHECKSUM_PACKETS compile time constant

* Revert "UDP: Add ipconfigUDP_PASS_ZERO_CHECKSUM_PACKETS compile time constant"

This reverts commit df9b39d.

* UDP: Add ipconfigUDP_PASS_ZERO_CHECKSUM_PACKETS compile time constant

* Added same check in case the driver takes care of the RX checksum calculations

* Some changes after comments of Gary and Aniruddha

* Removed an erroneous "#if( ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS != 0 )"

* Just a commit to trigger CBMB checks

Co-authored-by: Hein Tibosch <hein@htibosch.net>

* Add ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS compile time constant (aws#2226)

* Add ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS compile time constant

* Some changes after Gary's review

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Count only A records in DNS resolution logic (aws#2241)

* Added amazon_freertos_common, boards, rx_driver_package (v125) (aws#2246)

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Add additional length check when checksum offloading is used (aws#2227)

* Add additional length check when checksum offloading is used

* Some changes after Gary's review

* Removed an erroneous "#if( ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS != 0 )" ( belonged to another PR )

* FreeRTOSIPConfigDefaults.h wasn't up-to-date with earlier PR's 2225, and 2226

* Change after Gary's comments

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Fix GreenGrass Discovery demo failure in Nuvoton Ethernet board (aws#2242) (aws#2249)

* Fix mapping of configPRINTF to vLoggingPrintf to fix message mangling

* Fix incorrect mapping of FreeRTOS_debug_printf

* Fix incorrect mapping of FreeRTOS_debug_printf for aws_tests

* Enable ipconfigINCLUDE_FULL_INET_ADDR for Nuvoton Ethernet GreenGrass demo

* Add logs GGD_SecureConnect_Connect for improving debuggability

* Hygiene improvements

* Add error log for SOCKETS_GetHostByName failure

* Increase logging message length in aws_demo config to avoid truncated message causing CI failure in

* Initial iteration. Now testing

* Re-use existing CommonIO loopback tests. All tests passing. Now Polishing...

* Disable tests by default. Set CIO macros to default values. Uncrustify

* OTA: Self-test rollback in case the job in self-test is forced cancelled (aws#2257)

* OTA: Use platform get state function in processjobhandler instead of agent state (aws#2260)

* Address PR feedback. Return to default values on close as well, move iot_gpio_config.h, single return line

* Define state-set with enums. Report pin number when pin already opened

* Correct error reporting in demo (aws#2270)

* Correct error reporting in demo

* Remove unwanted comments

* uncrustify

* Hygiene changes for new macros in FreeRTOS+TCP config defaults (aws#2267) (aws#2273)

* Remove duplication of code and add documentation for new macros in FreeRTOSIPConfigDefaults.h

* Updates to macro documentation based on review comments

* Update flash offset align check (aws#2254)

* Update flash offset align check

* Make the offset align check simpler and add block size check.

* Check the flash size, block size, sector size and page size are the power of 2.

* MISRA related changes in FreeRTOS_DNS.c (aws#2256)

* DNS MISRA changes

* ulDNSHandlePacket #defines removed

* Correct formatting in FreeRTOS_DNS.c

* Changes after Hein's comments.

* revert changes in vcxproj file

* Corrections after review comments

* TLS Shim Layer DRBG (aws#2274)

* TLS Shim Layer DRBG

Use PKCS #11 to seed a DRBG instead of calling PKCS #11 for all random numbers needed by TLS.
This reduces the load on secure elements significantly when creating many random numbers.

* Added TI IAR test project and NXP MCUXpresso test project support (aws#2281)

* add nxp mcuxpresso aws_tests project

* add ti iar aws_tests project

* fix: Added #ifdef in FreeRTOSConfig.h of TI

The change is to pass the IAR compilation of assembled files

* temporary changes of test project file

* Added TI predefined macro

* fix: change to use FLEXCOMM for debug output

* [nxp-mcuxpresso] add related macros in aws_tests project

* fix: Incread minimal stack size to 256 from 90

* Remove temparary changes

Co-authored-by: Daniel Wen <wnyu@amazon.com>

* Fix precompiler if should be ifdef in ota agent

* Address some PKCS #11 TODOs (aws#2200)

* Address some PKCS #11 TODOs

* Added check to see if the parsed buffer was a certificate.
* Added macro for magic number for the EC point used in EC public keys.
* Determined byte size of an EC signature on the prime256v1 curve.

* changed test name from OTA_incorrect_wifi_password to OtaTestRollbackIfUnableToConnectAfterUpdate (aws#2279)

Co-authored-by: Yeh <ericyeh@38f9d3619710.ant.amazon.com>

* PR #2: Fix demo, test project after updating device driver (aws#2236)

* MISRA changes in FreeRTOS_IP.c + Misc. changes (aws#2280)

* FreeRTOP_IP.c changes

* missed a file

* Some More changes

* correction after PR 2236

* PR# 3: Update boot loader for RX65N-RSK (aws#2237)

* Added amazon_freertos_common, boards, rx_driver_package (v125)

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Update iot_pkcs11_pal.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Updated NetworkInterface.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Fixed aws_demos, aws_tests

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Removed amazon_freertos_common, boards, FIT, tools in vendors/renesas

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Added boot loader project for RX65N-RSK

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* PR #4 : Update OTA PAL (aws#2238)

* Added amazon_freertos_common, boards, rx_driver_package (v125)

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Update iot_pkcs11_pal.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Updated NetworkInterface.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Fixed aws_demos, aws_tests

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Removed amazon_freertos_common, boards, FIT, tools in vendors/renesas

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Added boot loader project for RX65N-RSK

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Added unsupported device for OTA feature in aws_ota_pal.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* PR #5: aws_demos and aws_tests for OTA (aws#2239)

* Added amazon_freertos_common, boards, rx_driver_package (v125)

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Update iot_pkcs11_pal.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Updated NetworkInterface.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Fixed aws_demos, aws_tests

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Removed amazon_freertos_common, boards, FIT, tools in vendors/renesas

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Added boot loader project for RX65N-RSK

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Added unsupported device for OTA feature in aws_ota_pal.c

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Fixed aws_demos and aws_tests with OTA feature

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Fix memory leak in pkcs11 implementation. (aws#2302)

* Add warning message to help user debug environment variable related build issues with Espressif CMake. (aws#2304)

* Fix CMake Board Path's Command (aws#2309)

The Renesas manifest file is not in the root of the vendor directory, and causes an error when earching for vendor paths.

To reproduce:
Before merging this commit
` cmake -P tools/cmake/afr_board_paths.cmake`

Expected Output:
cmake_supported_boards.yml created

Actual Output:
CMake Error at tools/cmake/afr_board_paths.cmake:19 (include):
  include could not find load file:

/Users/lundinc/Documents/amazon-freertos/vendors/renesas/manifest.cmake

* Add Mbed TLS macros to the LPC54018 bootloader project (aws#2317)

* Add the MBEDTLS_CONFIG_FILE and CONFIG_MEDTLS_USE_AFR_MEMORY macros
* Add the directory of the AWS Mbed TLS config file to the include path
* Add the Mbed TLS utility directory to the include path

* Add OTA port for rx65n-rsk to CMake files (aws#2315)

* Update the rx65n-rsk CMake files to include a port for the OTA library

* Correct some type defination of battery info and comments (aws#2275)

* Add all common-io peripherals to CMake build system (aws#2308)

* Add all common-io peripherals to CMake build system.

* Arrange tests in order of their dependencies.

* parent 1e3ae78
author David Chalco <david@chalco.io> 1595882030 -0700
committer David Chalco <david@chalco.io> 1595965008 -0700

24/24 tests passing. Had to remove a single incorrect test assertion

* Test w/ soft-device disabled and move test address much further past used flash

* Address PR feedback

* Retain perfcounter tests

* Update rx65n CMake file to match folder structure (aws#2321)

Previous commits changed and moved files in the renesas vendor
directory. The paths in the CMakeLists.txt file for renesas was
not updated alongside the file shuffle. This aligns the CMake file
with the current folder structure so that the metadata can build.

* Update iot_test_freertos_tcp.c (aws#2293)

* NimBLE AFR: Set flags for only advertisement data and not for scan response data (aws#2314)

* Removed unnecessary check now that prvMbedTLS_Initialize has a static scope. Added additional guard to prevent freeing the sha256 mbedtls context if an operation was never initialized. (aws#2300)

* Fix non-conformance to mbed TLS pk.h API when hashing a signature. (aws#2311)

* Fix non-conformance to mbed TLS pk.h API when hashing a signature.

* PKCS #11 Doxygen (aws#2326)

* PKCS #11 Doxygen

Fix macros not being included in the doxygen. Add dependency graphs. Various formatting fixes

* Fix/renesas folder structure (aws#2333)

* Move Renesas vendor directory content
* Update rx65n CMakeLists.txt for new folder structure
* Update the board directory in the Renesas manifest
* Fix paths in Renesas demo and test project files

* OTA bug fix (aws#2329)

* Separate OTA control and data cleanup

* Remove an unused variable in OTA agent

* Fix a crash in OTA

* Removes unnecessary checks of OTA agent

* Quarantine part of WiFi tests (aws#2337)

* Quarantine part of wifi tests

* solve the reset issue by return error if the WINC driver is closed (aws#2334)

* Refactor PKCS #11 tests for boards that cannot create new credentials. Eg. for multi-acc registration. (aws#2338)

PKCS 11 Multi Acc Auth

*Removed stdio includes

* Update configurations.xml to fix build errors for MPLABX 5.40 (aws#2346)

* fix: Update configurations.xml to work with MPLABX 5.40

* fix: Update configurations.xml by opening in MPLABX 5.40

* fix: Update all mchp projects to use DFP version 1.2.51

* Change ioctl test case for ADC to use greater than equal. (aws#2354)

* Fix logging issue that is causing start markers to be mangled in Microchip boards

The issue is addressed by defining WDRV_STUB_Print to be configPRINTF rather than SYS_CONSOLE_PRINT.

* Remove wifi dependency from lwip Secure Sockets implementation (aws#2359)

* Proper lwip DNS resolution

* Adding Advertise Tx Power defines (aws#2352)

* Tx Power defines which would be an index to Power values to be set by platforms.

* Update IotThreads_Free/Malloc defaults (aws#2357)

* Fix public key deletion and PKCS #11 tests on Optiga X. (aws#2358)

* Fix public key deletion and PKCS #11 tests on Optiga X.

* Fix: Mediatek wifi_ping fail on zero (aws#2102)

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>

* Update PSA submodule pointer. (aws#2364)

* Update OTA_AgentShutdown function comment (aws#2377)

* Minor iot_adc.h documentation update. (aws#2368)

* Created sequence diagrams for the PKCS #11 demos. (aws#2362)

They cover the following workflows:
* RNG
* Message Digest Creation
* Importing an object
* Generating a key pair

* OTA E2E test fix (aws#2372)

* Fix some OTA E2E tests

We should start the first OTA update only after we build everything.
Sometimes it takes long time to build and first OTA update could already
finish before we finish the second build and proceed to cancel it.

* Switch to junitparser for OTA E2E

* Add OtaTest2UpdatesCancel1st test case

* Save firmware to afr root folder

When rebuilding, the whole build folder might get deleted. To preserve
the previous build image, copy it to AFR root dir

* Improve demo comment related to IotSdk_Init (aws#2378)

* Added some features to RZ/A2M EBK

- added demos\renesas\rza2m-ebk-uart-esp32.
- added OTA test to tests\renesas\rza2m-ebk.
- added tests\renesas\rza2m-ebk-sx-sdmac.

* Modifed 2 files for not using OTA function.

* modified OTA test settings.

* Modified test settings

* Moved Flash API to lib/third_party/mcu_vendor/renesas/rz_mcu_boards/amazon_freertos_common/Flash.

* Updated drivers.

* Modified RZ/A2M Wi-Fi test.

* Deleted unused files.

* Added GR-MANGO.

* Deleted unused files.

* Switched GR-MANGO project to normal environment (not using ota boot).

* Added GR-MANGO + Wi-Fi(SX-SDMAC) demo project

* Modifed compilation options of GR-MANGO SX-SDMAC demos

* Deleted Debug folders. Added a script to generate bootloader for GR-MANGO.

* [Added] projects for RZ/A2M EBK.

* [Modified] modified projects to avoid compilation errors.

* Modified the return value of PKCS11_PAL_Initialize function.

* Added boot loader to RZ/A2M EBK aws_demos project.

* Added GR-MANGO aws_demos project.

Co-authored-by: vannam.dinh.xt <vannam.dinh.xt@renesas.com>
Co-authored-by: KosukeFunabashi <kosuke.funabashi.aj@renesas.com>
Co-authored-by: HiroakiHashiguchi <hiroaki.hashiguchi.bx@renesas.com>
Co-authored-by: HirokiIshiguro <hiroki.ishiguro.fv@renesas.com>
Co-authored-by: Raymond Ngun <raymond.ngun@cypress.com>
Co-authored-by: David Chalco <david@chalco.io>
Co-authored-by: Andrei Narkevitch <ainh@cypress.com>
Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Co-authored-by: Prasad Vyawahare <pvyawaha@amazon.com>
Co-authored-by: David Chalco <59750547+dachalco@users.noreply.github.com>
Co-authored-by: Hein Tibosch <hein_tibosch@yahoo.es>
Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Co-authored-by: Ming Yue <mingyue86010@gmail.com>
Co-authored-by: Carl Lundin <lundinc@amazon.com>
Co-authored-by: alfred gedeon <alfred2g@hotmail.com>
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
Co-authored-by: Archit Aggarwal <architag@amazon.com>
Co-authored-by: Ravishankar Bhagavandas <bhagavar@amazon.com>
Co-authored-by: Joshua Yan <52796499+yanjos-dev@users.noreply.github.com>
Co-authored-by: Kareem Khazem <karkhaz@amazon.com>
Co-authored-by: SarenaAWS <6563840+sarenameas@users.noreply.github.com>
Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
Co-authored-by: Dinh Van Nam <52021577+VanNamDinh@users.noreply.github.com>
Co-authored-by: Jae Young Choi <62124394+jychoi-inoon@users.noreply.github.com>
Co-authored-by: xuelix <33909469+xuelix@users.noreply.github.com>
Co-authored-by: Daniel Wen <wnyu@amazon.com>
Co-authored-by: Bjoern Lichtblau <Bjoern.Lichtblau@MSAsafety.com>
Co-authored-by: Eric Yeh <ericyeh@amazon.com>
Co-authored-by: Yeh <ericyeh@38f9d3619710.ant.amazon.com>
Co-authored-by: Hex Ren <68041319+renhongxue@users.noreply.github.com>
Co-authored-by: Prasad Alatkar <43741073+prasad-alatkar@users.noreply.github.com>
Co-authored-by: Tiangang Song <ts.whu@outlook.com>
Co-authored-by: benpoon-microchip <41128195+benpoon-microchip@users.noreply.github.com>
Co-authored-by: Oscar Michael Abrina <abrinao@amazon.com>
Co-authored-by: mohaveen <69489161+mohaveen@users.noreply.github.com>
  • Loading branch information
1 parent 4e8219e commit ec52b18
Show file tree
Hide file tree
Showing 2,269 changed files with 1,676,352 additions and 264,260 deletions.
3 changes: 2 additions & 1 deletion demos/demo_runner/iot_demo_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ static int _initialize( demoContext_t * pContext )
bool commonLibrariesInitialized = false;
bool semaphoreCreated = false;

/* Initialize common libraries required by network manager and demo. */
/* Initialize the C-SDK common libraries. This function must be called
* once (and only once) before calling any other C-SDK function. */
if( IotSdk_Init() == true )
{
commonLibrariesInitialized = true;
Expand Down
46 changes: 39 additions & 7 deletions demos/tcp/aws_tcp_echo_client_single_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@
#include "aws_demo_config.h"

/* Dimensions the buffer used to generate the task name. */
#define echoMAX_TASK_NAME_LENGTH 8
#define echoMAX_TASK_NAME_LENGTH 8

/* Maximum connection count. */
#define echoMAXIMUM_CONNECTION_COUNT 10

/* Maximum Loop count. */
#define echoMAX_LOOP_COUNT 10

/* The threshold to declare this demo as successful. Range: 0 - 1. */
#define echoSUCCESS_THRESHOLD 0.95

/* Sanity check the configuration constants required by this demo are
* present. */
Expand Down Expand Up @@ -156,7 +165,7 @@ static char cTxBuffers[ echoNUM_ECHO_CLIENTS ][ echoBUFFER_SIZES ],

/* Create a semaphore to sync all Echo task(s). */
static SemaphoreHandle_t EchoSingleSemaphore;

BaseType_t xSuccess[ echoNUM_ECHO_CLIENTS ];

int vStartTCPEchoClientTasks_SingleTasks( bool awsIotMqttMode,
const char * pIdentifier,
Expand All @@ -165,8 +174,9 @@ int vStartTCPEchoClientTasks_SingleTasks( bool awsIotMqttMode,
const IotNetworkInterface_t * pNetworkInterface )
{
BaseType_t xX;
BaseType_t TaskCompleteCounter;
BaseType_t TaskCompleteCounter, SuccessfulConnections = 0;
char cNameBuffer[ echoMAX_TASK_NAME_LENGTH ];
float SuccessPercent = 0;

/* Unused parameters */
( void ) awsIotMqttMode;
Expand Down Expand Up @@ -200,8 +210,27 @@ int vStartTCPEchoClientTasks_SingleTasks( bool awsIotMqttMode,
TaskCompleteCounter++;
}

/* Return Success. */
return EXIT_SUCCESS;
xX = 0;

/* Count the number of successes. */
while( xX < echoNUM_ECHO_CLIENTS )
{
SuccessfulConnections += xSuccess[ xX++ ];
}

/* Calculate the percentage of successful connections across all connections. */
SuccessPercent = ( ( float ) SuccessfulConnections / ( echoNUM_ECHO_CLIENTS * echoMAX_LOOP_COUNT * echoMAXIMUM_CONNECTION_COUNT ) );

if( SuccessPercent > echoSUCCESS_THRESHOLD )
{
/* Number of successful connections more than threshold. Return Success. */
return EXIT_SUCCESS;
}
else
{
/* Number of successful connections less than threshold. Return Failure. */
return EXIT_FAILURE;
}
}
/*-----------------------------------------------------------*/

Expand All @@ -210,15 +239,15 @@ static void prvEchoClientTask( void * pvParameters )
Socket_t xSocket;
/*_RB_ struct convention is for this not to be typedef'ed, so 'struct' is required. */ SocketsSockaddr_t xEchoServerAddress;
int32_t lLoopCount = 0UL;
const int32_t lMaxLoopCount = 10;
const int32_t lMaxLoopCount = echoMAX_LOOP_COUNT;
volatile uint32_t ulTxCount = 0UL;
BaseType_t xReceivedBytes, xReturned, xInstance;
BaseType_t xTransmitted, xStringLength;
char * pcTransmittedString;
char * pcReceivedString;
TickType_t xTimeOnEntering;
BaseType_t lConnectionCount;
const BaseType_t lMaxConnectionCount = 10;
const BaseType_t lMaxConnectionCount = echoMAXIMUM_CONNECTION_COUNT;

#if ( ipconfigUSE_TCP_WIN == 1 )
WinProperties_t xWinProps;
Expand Down Expand Up @@ -358,6 +387,9 @@ static void prvEchoClientTask( void * pvParameters )
/* The echo reply was received without error. */
ulTxRxCycles[ xInstance ]++;
configPRINTF( ( "Received correct string from echo server.\r\n" ) );

/* Increment success count. */
xSuccess[ xInstance ]++;
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions doc/config/pkcs11
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@INCLUDE = common

# Basic project information.
PROJECT_NAME = "PKCS11"
PROJECT_BRIEF = "PKCS11 Cryptoki Library"
PROJECT_NAME = "PKCS #11"
PROJECT_BRIEF = "PKCS #11 Cryptoki Library"

# Library documentation output directory.
HTML_OUTPUT = pkcs11
Expand Down
154 changes: 148 additions & 6 deletions doc/lib/pkcs11.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
@mainpage
@anchor pkcs11
@brief PKCS #11 Crytpo Abstraction Library.
@brief PKCS #11 Crypto Abstraction Library.

> PKCS #11 is a standard maintained by OASIS for interacting with cryptographic hardware.

Expand All @@ -13,8 +13,127 @@ This PKCS #11 library implements a subset of the PKCS #11 API required to establ
- Managing certificates and keys.
- Generating random numbers.

@section PKCS11_Wrapper PKCS #11 Wrapper Dependencies

Currently, the PKCS #11 wrapper library has a dependency on:
- FreeRTOS
- The C standard library stdint
- PKCS #11.

Note: "iot_pkcs11.h" should always be included first as it defines the macros that are needed by the standard PKCS #11 header files.

@dot "PKCS #11 wrapper direct dependencies"
digraph pkcs11_wrapper_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_wrapper[label="PKCS #11 Wrapper", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
pkcs11[label="PKCS #11"];
freertos[label="FreeRTOS"];
}

pkcs11_wrapper -> pkcs11;
pkcs11_wrapper -> freertos;
}
@enddot

@section PKCS11_implementation PKCS #11 Software Implementation Dependencies

PKCS #11 is a flexible library, and can easily be swapped out for other implementations. The PKCS #11 library documented here
is a software based implementation, to allow for writing libraries and code that can easily interface with Hardware Security Modules (HSM).

Currently, the software based PKCS #11 library has the following dependencies:
- The API defined by the PKCS #11 specification. The headers used can be found [here](https://github.com/amazon-freertos/pkcs11/tree/v2.40_errata01).
- The PKCS #11 PAL layer. This is used for writing PKCS #11 objects to flash.
- FreeRTOS. This library uses FreeRTOS primitives, like semaphores.
- mbed TLS. This library uses mbed TLS for the cryptographic logic. Some examples include parsing key and certificate objects, signing operations, and creating digests.
- The standard C library string, for memory manipulation.

@dot "PKCS #11 implementation direct dependencies"
digraph pkcs11_software_implementation_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_software_implementation[label="PKCS #11 Software Implementation", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
pkcs11_wrapper[label="PKCS #11"];
freertos[label="FreeRTOS"];
mbedtls[label="mbed TLS"];
pkcs11_pal[label="PKCS #11 PAL"];
}

pkcs11_software_implementation -> pkcs11_wrapper;
pkcs11_software_implementation -> freertos;
pkcs11_software_implementation -> mbedtls;
pkcs11_software_implementation -> pkcs11_pal;
}
@enddot

@section PKCS11_utilities PKCS #11 Utilities Dependencies

The PKI utils module is a forked version of the PKI utilities provided by mbed TLS. They are used to convert from
Currently, the module has the following dependencies:
- The standard C library
- FreeRTOS

@dot "PKCS #11 Utilities Dependencies"
digraph pkcs11_utils_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_utils[label="PKCS #11 Utilities", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
freertos[label="FreeRTOS"];
stdlib[label="string.h"];
}

pkcs11_utils -> stdlib;
pkcs11_utils -> freertos;
}
@enddot


@page pkcs11_rng_seq PKCS #11 RNG Sequence Diagram
@brief Sequence diagram illustrating how to generate random bytes from PKCS #11.
@image html pkcs11_rng.png "PKCS #11 RNG Sequence" width=80%

@page pkcs11_dig_seq PKCS #11 Digest Sequence Diagram
@brief Sequence diagram illustrating how to create a message digest with PKCS #11.
@image html pkcs11_digest.png "PKCS #11 Digest Sequence" width=80%

@page pkcs11_obj_imp_seq PKCS #11 Object Import Sequence Diagram
@brief Sequence diagram illustrating how to import an object with PKCS #11.
@image html pkcs11_object_import.png "PKCS #11 Object Import Sequence" width=80%

@page pkcs11_obj_gen_seq PKCS #11 Generate Key Pair Sequence Diagram
@brief Sequence diagram illustrating how to generate a key pair with PKCS #11.
@image html pkcs11_object_generate.png "PKCS #11 Generate Key Pair Sequence" width=80%

@page pkcs11_sign_verify_seq PKCS #11 Sign and Verify Sequence Diagram
@brief Sequence diagram illustrating how to sign a hash and verify a signature with PKCS #11.
@image html pkcs11_sign_verify.png "PKCS #11 Sign and Verify Sequence" width=80%

@constants_page{pkcs11}
@constants_brief{PKCS #11 library}
@constants_brief{PKCS #11 library constants}
@section pkcs11_pal_constants PKCS #11 PAL File Names

@brief Provide file name mappings for the TLS client certificate, and keys.
Expand Down Expand Up @@ -44,19 +163,42 @@ as the solution, the application will fail to use them for it's TLS needs.
@section pkcs11configMAX_LABEL_LENGTH
@brief Max length of a PKCS #11 Label attribute

PKCS #11 uses labels to map human readable strings to a PKCS #11 object. This defines the maximum allowable length for such a string.
PKCS #11 uses labels to map human readable strings to a PKCS #11 object. This defines the maximum allowable length for such a string.<br>

@configpossible Any positive integer.<br>
@configdefault `32`

@section pkcs11configMAX_NUM_OBJECTS
@brief Maximum number of token objects that can be stored by the PKCS #11 module.

The maximum number of token objects that can be stored by the PKCS #11 module.
@brief Maximum number of token objects that can be stored by the PKCS #11 module.<br>

@configpossible Any positive integer.<br>
@configdefault `6`


@section pkcs11configMAX_SESSIONS
@brief Maximum number of sessions that can be stored by the PKCS #11 module.<br>
The more sessions created, the higher RAM used by the PKCS #11 module.<br>
@configpossible Any positive integer.<br>
@configdefault 10

@section pkcs11testIMPORT_PRIVATE_KEY_SUPPORT
@brief Set to 1 if the PKCS #11 stack or device/hsm can load objects from an external source.<br>

@configpossible 0 or 1 <br>
@configdefault `0`

@section pkcs11testGENERATE_KEYPAIR_SUPPORT
@brief Set to 1 if the PKCS #11 stack or device/hsm can generate a key pair.<br>
@note The device should be able to store certificate onboard as well.<br>

@configpossible 0 or 1 <br>
@configdefault `0`

@section pkcs11testPREPROVISIONED_SUPPORT
@brief Set to 1 if the PKCS #11 stack or device/hsm is pre-provisioned with all objects necessary to connect to AWS IoT Core.<br>
@configpossible 0 or 1 <br>
@configdefault `0`

@section pkcs11configPAL_DESTROY_SUPPORTED
@brief Set to 1 if a PAL destroy object is implemented.

Expand Down
Binary file added doc/plantuml/images/pkcs11_digest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/plantuml/images/pkcs11_object_generate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/plantuml/images/pkcs11_object_import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/plantuml/images/pkcs11_rng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/plantuml/images/pkcs11_sign_verify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions doc/plantuml/pkcs11_digest.pu
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber

participant "Application" as app
participant "PKCS #11" as pkcs

box "PKCS #11 - Creating A Message Digest" #LightBlue
participant app
participant pkcs
end box

app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions

app -> pkcs: Initialize with C_Initialize

app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs

app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE

app -> pkcs: Log in to current session with C_Login

app -> pkcs: Query for supported mechanisms with C_GetMechanismInfo
pkcs -> app: Return CK_MECHANISM_INFO

app -> pkcs: Start a digest operation using SHA-256 by passing CKM_SHA256 to C_DigestInit
app -> pkcs: Pass bytes buffer of message to C_DigestUpdate
app -> pkcs: Pass bytes buffer for storing the digest to C_DigestFinal
pkcs -> app: Fill buffer with digest bytes

app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize

@enduml
33 changes: 33 additions & 0 deletions doc/plantuml/pkcs11_object_generate.pu
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber

participant "Application" as app
participant "PKCS #11" as pkcs

box "PKCS #11 - Generating A Key Pair" #LightBlue
participant app
participant pkcs
end box

app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions

app -> pkcs: Initialize with C_Initialize

app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs

app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE

app -> pkcs: Log in to current session with C_Login

app -> pkcs: Pass CK_ATTRIBUTEs template to C_CreateKeyPair
pkcs -> app: Return CK_OBJECT_HANDLE for public key and for private key

app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize

@endumlf
Loading

0 comments on commit ec52b18

Please sign in to comment.