Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

PKCS #11 Remove iot prefix. #2563

Merged
merged 8 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checksums.json
Original file line number Diff line number Diff line change
Expand Up @@ -3044,8 +3044,8 @@
"libraries/abstractions/pkcs11/ecc608a/atca_cert_chain.c": "f2c7f60a04ae73cc77d4839ec74d83e23ec2e40a5acf4791c1eb6ed051cadc41",
"libraries/abstractions/pkcs11/ecc608a/atca_cert_chain.h": "63cce6d76da4ed68aa89de2809e6d88c6c61fad3312da3051b1da0df784b805a",
"libraries/abstractions/pkcs11/ecc608a/iot_pkcs11_secure_element.c": "fbd4353c28cc7c4a416f494bd541f6a7666c974bcbe2a86a1b42ef61cbc2a8a6",
"libraries/abstractions/pkcs11/include/iot_pkcs11_pal.h": "59f6d5fd3b5f80757df9649c3a20eff016497b6ba044d3219858d60edac12b0a",
"libraries/abstractions/pkcs11/mbedtls/iot_pkcs11_mbedtls.c": "c1dfd675c8fa1751f3830eded8b5447fb4f0c6a342487dff499f66a7d666b09c",
"libraries/abstractions/pkcs11/include/core_pkcs11_pal.h": "59f6d5fd3b5f80757df9649c3a20eff016497b6ba044d3219858d60edac12b0a",
"libraries/abstractions/pkcs11/mbedtls/core_pkcs11_mbedtls.c": "c1dfd675c8fa1751f3830eded8b5447fb4f0c6a342487dff499f66a7d666b09c",
"libraries/abstractions/pkcs11/mbedtls/threading_alt.h": "8fb68e3c74fa208d6e2e42ece0f934331690ae79107bc12e0af43826cc3b13ad",
"libraries/abstractions/pkcs11/psa/License.md": "79147b607b79da7884e49f492f0623ad85f7ad30a991f15fb0ab5022e8d5ae44",
"libraries/abstractions/pkcs11/psa/ReadMe.md": "25610558583d1e478a7bb0739334972cc92b5a741eb4db776d608a35b94614b1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#ifndef _AWS_DEV_MODE_KEY_PROVISIONING_H_
#define _AWS_DEV_MODE_KEY_PROVISIONING_H_

#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"

typedef struct ProvisioningParams_t
{
Expand Down Expand Up @@ -104,7 +104,7 @@ CK_RV vAlternateKeyProvisioning( ProvisioningParams_t * xParams );
* or ASN.1 DER encoded.
* \param[in] xPrivateKeyLength Length of the data at pucPrivateKey, in bytes.
* \param[in] pucLabel PKCS #11 CKA_LABEL attribute value to be used for key.
* This should be a string values. See iot_pkcs11_config.h
* This should be a string values. See core_pkcs11_config.h
* \param[out] pxObjectHandle Points to the location that receives the PKCS #11
* private key handle created.
*
Expand All @@ -125,7 +125,7 @@ CK_RV xProvisionPrivateKey( CK_SESSION_HANDLE xSession,
* \param[in] xKeyLength Length of the data at pucPrivateKey, in bytes.
* \param[in] xPublicKeyType The type of key- either CKK_RSA or CKK_EC.
* \param[in] pucPublicKeyLabel PKCS #11 CKA_LABEL attribute value to be used for key.
* This should be a string values. See iot_pkcs11_config.h.
* This should be a string values. See core_pkcs11_config.h.
* \param[out] pxPublicKeyHandle Points to the location that receives the PKCS #11 public
* key handle created.
*
Expand All @@ -148,8 +148,8 @@ CK_RV xProvisionPublicKey( CK_SESSION_HANDLE xSession,
* for help with formatting.
* \param[in] xCertificateLength Length of pucCertificate, in bytes.
* \param[in] pucLabel PKCS #11 label attribute value for certificate to be imported.
* This should be a string value. See iot_pkcs11.h.
* This should be a string value. See iot_pkcs11_config.h.
* This should be a string value. See core_pkcs11.h.
* This should be a string value. See core_pkcs11_config.h.
* \param[out] pxObjectHandle Points to the location that receives the PKCS #11
* certificate handle created.
*
Expand All @@ -166,9 +166,9 @@ CK_RV xProvisionCertificate( CK_SESSION_HANDLE xSession,
*
* \param[in] xSession A valid PKCS #11 session handle.
* \param[in] pucPrivateKeyLabel PKCS #11 label attribute value for private key to be created.
* This should be a string value. See iot_pkcs11_config.h.
* This should be a string value. See core_pkcs11_config.h.
* \param[in] pucPublicKeyLabel PKCS #11 label attribute value for public key to be created.
* This should be a string value. See iot_pkcs11_config.h.
* This should be a string value. See core_pkcs11_config.h.
* \param[out] pxPrivateKeyHandle Points to the location that receives the PKCS #11 private
* key handle created.
* \param[out] pxPublicKeyHandle Points to the location that receives the PKCS #11 public
Expand All @@ -187,9 +187,9 @@ CK_RV xProvisionGenerateKeyPairRSA( CK_SESSION_HANDLE xSession,
*
* \param[in] xSession A valid PKCS #11 session handle.
* \param[in] pucPrivateKeyLabel PKCS #11 label attribute value for private key to be created.
* This should be a string value. See iot_pkcs11_config.h.
* This should be a string value. See core_pkcs11_config.h.
* \param[in] pucPublicKeyLabel PKCS #11 label attribute value for public key to be created.
* This should be a string value. See iot_pkcs11_config.h.
* This should be a string value. See core_pkcs11_config.h.
* \param[out] pxPrivateKeyHandle Points to the location that receives the PKCS #11 private
* key handle created.
* \param[out] pxPublicKeyHandle Points to the location that receives the PKCS #11 public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include "semphr.h"

/* PKCS#11 includes. */
#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"

/* Client credential includes. */
#include "aws_clientcredential.h"
Expand All @@ -55,7 +55,7 @@
#include "aws_dev_mode_key_provisioning.h"

/* Utilities include. */
#include "iot_pki_utils.h"
#include "core_pki_utils.h"

/* mbedTLS includes. */
#include "mbedtls/pk.h"
Expand Down
14 changes: 7 additions & 7 deletions libraries/abstractions/pkcs11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ set(inc_dir "${CMAKE_CURRENT_LIST_DIR}/corePKCS11/source/include")
afr_module_sources(
pkcs11_utils
PRIVATE
"${src_dir}/iot_pki_utils.c"
"${inc_dir}/iot_pki_utils.h"
"${src_dir}/core_pki_utils.c"
"${inc_dir}/core_pki_utils.h"
)

afr_module_include_dirs(
Expand All @@ -31,8 +31,8 @@ set(inc_dir "${CMAKE_CURRENT_LIST_DIR}/corePKCS11/source/include")
afr_module_sources(
pkcs11
PRIVATE
"${inc_dir}/iot_pkcs11.h"
"${src_dir}/iot_pkcs11.c"
"${inc_dir}/core_pkcs11.h"
"${src_dir}/core_pkcs11.c"
)

afr_module_include_dirs(
Expand Down Expand Up @@ -109,7 +109,7 @@ if(ECC608_IN_USE)
INTERFACE
"${atca_config_dir}/atca_cert_chain.h"
"${atca_config_dir}/atca_cert_chain.c"
"${atca_config_dir}/iot_pkcs11_secure_element.c"
"${atca_config_dir}/core_pkcs11_secure_element.c"
"${ecc608_src_list}"
)

Expand Down Expand Up @@ -160,9 +160,9 @@ else()
afr_module_sources(
pkcs11_mbedtls
INTERFACE
"${src_dir}/iot_pkcs11_mbedtls.c"
"${src_dir}/core_pkcs11_mbedtls.c"
"${src_dir}/include/threading_alt.h"
"${inc_dir}/iot_pkcs11_pal.h"
"${inc_dir}/core_pkcs11_pal.h"
)

afr_module_dependencies(
Expand Down
2 changes: 1 addition & 1 deletion libraries/abstractions/pkcs11/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ void PKCS11_PAL_GetObjectValueCleanup(

CK_RV PKCS11_PAL_DestroyObject( CK_OBJECT_HANDLE xHandle );
```
A stub of the PAL interface can be found at https://github.com/aws/amazon-freertos/blob/master/vendors/vendor/boards/board/ports/pkcs11/iot_pkcs11_pal.c.
A stub of the PAL interface can be found at https://github.com/aws/amazon-freertos/blob/master/vendors/vendor/boards/board/ports/pkcs11/core_pkcs11_pal.c.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@

/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "iot_pkcs11_config.h"
#include "core_pkcs11_config.h"

#include "iot_crypto.h"
#include "iot_pkcs11.h"
#include "iot_pkcs11_pal.h"
#include "iot_pki_utils.h"
#include "core_pkcs11.h"
#include "core_pkcs11_pal.h"
#include "core_pki_utils.h"

#include <string.h>

#ifdef FREERTOS_ENABLE_UNIT_TESTS
#include "iot_test_pkcs11_config.h"
#include "core_test_pkcs11_config.h"
#endif

/* Credential includes. */
Expand Down
2 changes: 1 addition & 1 deletion libraries/abstractions/pkcs11/psa
14 changes: 7 additions & 7 deletions libraries/abstractions/pkcs11/test/iot_test_pkcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
#include "FreeRTOSIPConfig.h"
#include "task.h"
#include "event_groups.h"
#include "iot_pki_utils.h"
#include "core_pki_utils.h"

/* Crypto includes. */
#include "iot_crypto.h"
#include "aws_clientcredential.h"
#include "iot_default_root_certificates.h"
#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"
#include "aws_dev_mode_key_provisioning.h"
#include "iot_test_pkcs11_config.h"
#include "core_test_pkcs11_config.h"
#include "mbedtls/x509_crt.h"

#if ( pkcs11testRSA_KEY_SUPPORT == 0 ) && ( pkcs11testEC_KEY_SUPPORT == 0 )
Expand All @@ -53,7 +53,7 @@
#endif

#include "iot_test_pkcs11_globals.h"
#include "iot_pkcs11_config.h"
#include "core_pkcs11_config.h"

/* Test includes. */
#include "unity_fixture.h"
Expand Down Expand Up @@ -407,12 +407,12 @@ static MultithreadTaskParams_t xGlobalTaskParams[ pkcs11testMULTI_THREAD_TASK_CO
/*-----------------------------------------------------------*/
/* Multitask loop configuration. */
/*-----------------------------------------------------------*/
/* Stack size of each task. This can be configured in iot_test_pkcs11_config.h. */
/* Stack size of each task. This can be configured in core_test_pkcs11_config.h. */
#ifndef pkcs11testMULTI_TASK_STACK_SIZE
#define pkcs11testMULTI_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 6 )
#endif

/* Priority of each task. This can be configured in iot_test_pkcs11_config.h. */
/* Priority of each task. This can be configured in core_test_pkcs11_config.h. */
#ifndef pkcs11testMULTI_TASK_PRIORITY
#define pkcs11testMULTI_TASK_PRIORITY ( tskIDLE_PRIORITY )
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "unity_fixture.h"
#include "unity.h"
#include "iot_pkcs11.h"
#include "core_pkcs11.h"

extern CK_SESSION_HANDLE xGlobalSession;
extern CK_FUNCTION_LIST_PTR pxGlobalFunctionList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "iot_secure_sockets.h"
#include "iot_tls.h"
#include "task.h"
#include "iot_pkcs11.h"
#include "core_pkcs11.h"
#include "iot_crypto.h"

#undef _SECURE_SOCKETS_WRAPPER_NOT_REDEFINE
Expand Down
4 changes: 2 additions & 2 deletions libraries/freertos_plus/aws/ota/test/aws_test_ota_pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@


#if ( otatestpalREAD_CERTIFICATE_FROM_NVM_WITH_PKCS11 == 1 )
#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"
#include "aws_dev_mode_key_provisioning.h"
#endif

Expand Down
6 changes: 3 additions & 3 deletions libraries/freertos_plus/standard/tls/src/iot_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "FreeRTOSIPConfig.h"
#include "iot_tls.h"
#include "iot_crypto.h"
#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"
#include "task.h"
#include "aws_clientcredential_keys.h"
#include "iot_default_root_certificates.h"
#include "iot_pki_utils.h"
#include "core_pki_utils.h"

/* mbedTLS includes. */
#include "mbedtls/platform.h"
Expand Down
8 changes: 4 additions & 4 deletions libraries/freertos_plus/standard/tls/test/iot_test_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
#include "iot_test_tls.h"

/* Configuration includes. */
#include "iot_pkcs11_config.h"
#include "iot_test_pkcs11_config.h"
#include "core_pkcs11_config.h"
#include "core_test_pkcs11_config.h"

/* Provisioning include. */
#include "aws_dev_mode_key_provisioning.h"
#include "iot_pkcs11_config.h"
#include "iot_pkcs11.h"
#include "core_pkcs11_config.h"
#include "core_pkcs11.h"

/*
* Length of elliptic curve credentials included from aws_clientcredential_keys.h.
Expand Down
20 changes: 10 additions & 10 deletions projects/cypress/CY8CKIT_064S0S2_4343W/mtb/aws_demos/.project
Original file line number Diff line number Diff line change
Expand Up @@ -666,19 +666,19 @@
<locationURI>PARENT-5-PROJECT_LOC/vendors/cypress/boards/CY8CKIT_064S0S2_4343W/ports/wifi/iot_wifi.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/psa/iot_pkcs11_psa_input_format.c</name>
<name>libraries/abstractions/pkcs11/psa/core_pkcs11_psa_input_format.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/iot_pkcs11_psa_input_format.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/core_pkcs11_psa_input_format.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/psa/iot_pkcs11_psa.c</name>
<name>libraries/abstractions/pkcs11/psa/core_pkcs11_psa.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/iot_pkcs11_psa.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/core_pkcs11_psa.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/psa/iot_pkcs11_psa_object_management.c</name>
<name>libraries/abstractions/pkcs11/psa/core_pkcs11_psa_object_management.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/iot_pkcs11_psa_object_management.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/psa/core_pkcs11_psa_object_management.c</locationURI>
</link>
<link>
<name>vendors/cypress/boards/CY8CKIT_064S0S2_4343W/ports/pkcs11/hw_poll.c</name>
Expand Down Expand Up @@ -1871,9 +1871,9 @@
<locationURI>PARENT-5-PROJECT_LOC/libraries/freertos_plus/standard/crypto/src/iot_crypto.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/corePKCS11/source/iot_pkcs11.c</name>
<name>libraries/abstractions/pkcs11/corePKCS11/source/core_pkcs11.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/iot_pkcs11.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/core_pkcs11.c</locationURI>
</link>
<link>
<name>libraries/freertos_plus/standard/tls/src/iot_tls.c</name>
Expand All @@ -1886,9 +1886,9 @@
<locationURI>PARENT-5-PROJECT_LOC/libraries/freertos_plus/standard/utils/src/iot_system_init.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/corePKCS11/source/iot_pki_utils.c</name>
<name>libraries/abstractions/pkcs11/corePKCS11/source/core_pki_utils.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/iot_pki_utils.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/core_pki_utils.c</locationURI>
</link>
<link>
<name>libraries/freertos_plus/aws/greengrass/src/aws_helper_secure_connect.c</name>
Expand Down
8 changes: 4 additions & 4 deletions projects/cypress/CY8CKIT_064S0S2_4343W/mtb/aws_tests/.project
Original file line number Diff line number Diff line change
Expand Up @@ -2126,9 +2126,9 @@
<locationURI>PARENT-5-PROJECT_LOC/libraries/freertos_plus/standard/crypto/src/iot_crypto.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/corePKCS11/source/iot_pkcs11.c</name>
<name>libraries/abstractions/pkcs11/corePKCS11/source/core_pkcs11.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/iot_pkcs11.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/core_pkcs11.c</locationURI>
</link>
<link>
<name>libraries/freertos_plus/standard/tls/src/iot_tls.c</name>
Expand All @@ -2141,9 +2141,9 @@
<locationURI>PARENT-5-PROJECT_LOC/libraries/freertos_plus/standard/utils/src/iot_system_init.c</locationURI>
</link>
<link>
<name>libraries/abstractions/pkcs11/corePKCS11/source/iot_pki_utils.c</name>
<name>libraries/abstractions/pkcs11/corePKCS11/source/core_pki_utils.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/iot_pki_utils.c</locationURI>
<locationURI>PARENT-5-PROJECT_LOC/libraries/abstractions/pkcs11/corePKCS11/source/core_pki_utils.c</locationURI>
</link>
<link>
<name>libraries/freertos_plus/standard/crypto/test/iot_test_crypto.c</name>
Expand Down
Loading