You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6.[Run The PKCS #11Test](#6-run-the-pkcs-11-test)<br>
10
10
</t>6.1 [Setup the provisioning mechanism and key function](#61-setup-the-provisioning-mechanism-and-key-function)<br>
11
-
</t>6.2 [Compile and run the PKCS11 test application](#62-compile-and-run-the-pkcs11-test-application)<br>
11
+
</t>6.2 [Compile and run the PKCS #11test application](#62-compile-and-run-the-pkcs-11-test-application)<br>
12
12
13
13
## 1. Introduction
14
14
[PKCS #11](https://en.wikipedia.org/wiki/PKCS_11) is a standardize API to allow application software to use, create, modify and delete cryptographic objects.
15
-
The benefit of PKCS11 is that it allows the app to take advantage of offload crypto while mitigating the threats of private key cloning and theft.
15
+
The benefit of PKCS #11 is that it allows the app to take advantage of offload crypto while mitigating the threats of private key cloning and theft.
16
16
17
-
FreeRTOS uses a subset of PKCS11 APIs to keep lean. Implementers are free to integrate more than our required subset of PKCS #11, but it is optional to do so.
17
+
FreeRTOS uses a subset of PKCS #11 APIs to keep lean. Implementers are free to integrate more than our required subset of PKCS #11, but it is optional to do so.
18
18
19
19
The PKCS #11 API functions required by FreeRTOS are described in the following table.
OTA | Verify, Digest, FindObject, GetAttributeValue
28
28
29
-
The PKCS11 test validates the PKCS11 subset implementation. The test directly exercises the PKCS11 implementation on the device under testing. User runs the PKCS11 test by running a test application. The test application is usually implemented by calling the provided PKCS11 test routine from the main function. By passing this test, the PKCS11 subset implementation is validated to support required PKCS11 functions by FreeRTOS.
29
+
The PKCS #11test validates the PKCS #11subset implementation. The test directly exercises the PKCS #11implementation on the device under testing. User runs the PKCS #11test by running a test application. The test application is usually implemented by calling the provided PKCS #11test routine from the main function. By passing this test, the PKCS #11subset implementation is validated to support required PKCS #11 functions by FreeRTOS.
30
30
31
-
## 2. PKCS11 Test Configurations
31
+
## 2. PKCS #11 Test Configurations
32
32
33
-
The following table lists the required test configurations for PKCS11 tests. These test configurations need to be defined in **test_param_config.h**.
33
+
The following table lists the required test configurations for PKCS #11 tests. These test configurations need to be defined in **test_param_config.h**.
34
34
35
35
|Configuration |Description |
36
36
|--- | --- |
@@ -48,7 +48,7 @@ The following table lists the required test configurations for PKCS11 tests. The
48
48
|PKCS11_TEST_LABEL_ROOT_CERTIFICATE |The label of the code verification key used in JITP codeverify test. |
49
49
50
50
51
-
FreeRTOS libraries and reference integrations needs at least one of the key function and one of the key provisioning mechanism supported by the PKCS11 APIs. The test must enable at least one of the following configurations:
51
+
FreeRTOS libraries and reference integrations needs at least one of the key function and one of the key provisioning mechanism supported by the PKCS #11 APIs. The test must enable at least one of the following configurations:
52
52
53
53
* At least one of the key function configurations:
54
54
* PKCS11_TEST_RSA_KEY_SUPPORT
@@ -63,7 +63,7 @@ Pre-provisioned device credential test can not be enabled with other provisionin
63
63
64
64
* Enable **PKCS11_TEST_PREPROVISIONED_SUPPORT** and the other provisioning mechanisms must be disabled
65
65
* Only one of the key function, **PKCS11_TEST_RSA_KEY_SUPPORT** or **PKCS11_TEST_EC_KEY_SUPPORT**, enabled
66
-
* Setup the pre-provisioned key labels according to your key function, including **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS**. These credentials must exist in the PKCS11 before running the test.
66
+
* Setup the pre-provisioned key labels according to your key function, including **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS**. These credentials must exist in the PKCS #11 before running the test.
67
67
68
68
You may need to run the test several times with different configurations if your implementation support pre-provisioned credentials and other provisioning mechanisms.
69
69
@@ -72,19 +72,19 @@ You may need to run the test several times with different configurations if your
72
72
Objects with label **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS** will be erased during the test if any one of **PKCS11_TEST_GENERATE_KEYPAIR_SUPPORT** and **PKCS11_TEST_GENERATE_KEYPAIR_SUPPORT** is enabled.
73
73
74
74
75
-
## 3. Prerequisites For PKCS11 Test
76
-
The PKCS11 tests assume the tested platform already has the following components integrated.
77
-
***The PKCS11 APIs subset implementation**<br>
75
+
## 3. Prerequisites For PKCS #11 Test
76
+
The PKCS #11 tests assume the tested platform already has the following components integrated.
77
+
***The PKCS #11 APIs subset implementation**<br>
78
78
The implementation should support the APIs list in this [section](#1-introduction).
79
79
***corePKCS11**<br>
80
-
The utilities in corePKCS11 are used in PKCS11 test. The software based mock implementation is up to developer's implementation choice.
80
+
The utilities in corePKCS #11are used in PKCS #11 test. The software based mock implementation is up to developer's implementation choice.
81
81
***MbedTLS**<br>
82
-
MbedTLS is required to verify the result of the PKCS11 implementation.
82
+
MbedTLS is required to verify the result of the PKCS #11 implementation.
83
83
***Unity test framework**<br>
84
-
PKCS11 test make use of the Unity test framework. Reference the [website](https://github.com/ThrowTheSwitch/Unity) for integration guide.
84
+
PKCS #11 test make use of the Unity test framework. Reference the [website](https://github.com/ThrowTheSwitch/Unity) for integration guide.
85
85
86
86
## 4. Source Code Organization
87
-
The tree only lists the required files to run the PKCS11 test.
87
+
The tree only lists the required files to run the PKCS #11 test.
88
88
```
89
89
./FreeRTOS-Libraries-Integration-Tests/
90
90
├── config_template
@@ -105,12 +105,12 @@ The tree only lists the required files to run the PKCS11 test.
105
105
└── qualification_test.h
106
106
```
107
107
108
-
## 5. Implement PKCS11 Test Application
108
+
## 5. Implement PKCS #11 Test Application
109
109
1. Add [FreeRTOS-Libraries-Integration-Tests](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) as a submodule into your project. It doesn’t matter where the submodule is placed in the project, as long as it can be built.
110
110
2. Copy **config_template/test_execution_config_template.h** and **config_template/test_param_config_template.h** to a project location in the build path, and rename them to **test_execution_config.h** and **test_param_config.h**.
111
111
3. Include relevant files into the build system. If using CMake, **qualification_test.cmake** and **src/pkcs11_test.cmake** can be used to include relevant files.
112
-
4. Implement the [platform functions](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/main/src/common/platform_function.h) required by PKCS11 tests.
113
-
5. Enable the PKCS11 test config, **PKCS11_TEST_ENABLED**, in **test_execution_config.h**.
112
+
4. Implement the [platform functions](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/main/src/common/platform_function.h) required by PKCS #11 tests.
113
+
5. Enable the PKCS #11 test config, **PKCS11_TEST_ENABLED**, in **test_execution_config.h**.
114
114
6. Implement the main function and call the **RunQualificationTest**.
115
115
116
116
The following is an example test application.
@@ -131,7 +131,7 @@ int FRTest_ThreadTimedJoin( FRTestThreadHandle_t threadHandle, uint32_t timeoutM
0 commit comments