diff --git a/README.md b/README.md index 7eb26d3..1f93d1c 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,13 @@ This repository contains tests that verify an integration of FreeRTOS IoT libraries running on a specific microcontroller-based development board for robustness and compatibility with AWS’s published best practices for AWS IoT Core connectivity. -Refer to [FreeRTOS Porting Guide](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting.html) for how to port FreeRTOS libraries and test your project. -The tests are used by [AWS IoT Device Tester](https://docs.aws.amazon.com/freertos/latest/userguide/device-tester-for-freertos-ug.html) (IDT) -as part of the [AWS Device Qualification for FreeRTOS](https://docs.aws.amazon.com/freertos/latest/qualificationguide/afr-qualification.html). The tests can also be run locally from your IDE to verify your project, but a test report from IDT is required for AWS Device Qualification. ### Tests The following test groups are included in this repository: 1. Transport Interface Test validates the implementation of transport interface required by [coreMQTT](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-mqtt.html) and [coreHTTP](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-corehttp.html). The implementation can be plain text or TLS. See [Transport Interface Test](/src/transport_interface) for details. 2. PKCS11 Test validates the implementation of PKCS11 interface required by [corePKCS11](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-pkcs.html).See [PKCS11 Test](/src/pkcs11) for details. -3. OTA Test validates the implementation of Physical Abstract Layer for [Over-the-Air Updates](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-ota.html). See [OTA Test](/src/ota) for details. -4. MQTT Test validates the integration with coreMQTT library. +3. MQTT Test validates the integration with coreMQTT library. ### Folder Structure @@ -24,7 +20,6 @@ The folder inside the repository is organized as follows: ├── src │   ├── common | |── mqtt -| |── ota | |── pkcs11 │   └── transport_interface └── tools @@ -71,6 +66,8 @@ If testing using the [FreeRTOS-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS) re | [202012.04-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.04-LTS) | [202205.01](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/202205.01) | | [202012.05-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.05-LTS) | [202205.01](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/202205.01) | | [202210.00-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) | [202210.00](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/202210.00) | +| [202210.01-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.01-LTS) | [202210.01](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/202210.01) | +| [202406.00-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202406.00-LTS) | [202406.00](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/202406.00) | 4. Checkout the version of this repository needed with the following command: ``` diff --git a/config_template/test_execution_config_template.h b/config_template/test_execution_config_template.h index 5a2cf59..ccb36d3 100644 --- a/config_template/test_execution_config_template.h +++ b/config_template/test_execution_config_template.h @@ -46,18 +46,6 @@ * #define TRANSPORT_INTERFACE_TEST_ENABLED (0) */ -/** - * @brief Configuration to enable the OTA PAL test. - * - * #define OTA_PAL_TEST_ENABLED (0) - */ - -/** - * @brief Configuration to enable the OTA End-to-end test. - * - * #define OTA_E2E_TEST_ENABLED (0) - */ - /** * @brief Configuration to enable the corePKCS11 test. * diff --git a/config_template/test_param_config_template.h b/config_template/test_param_config_template.h index fcbdf16..1bb5671 100644 --- a/config_template/test_param_config_template.h +++ b/config_template/test_param_config_template.h @@ -156,46 +156,6 @@ * #define TRANSPORT_CLIENT_PRIVATE_KEY NULL */ -/** - * @brief Microseconds to delay the start of test. - * - * @note This configuration is optional. Default is 5000. - * - * #define TEST_START_DELAY_MS 5000 - */ - -#define OTA_RSA_SHA1 1 -#define OTA_RSA_SHA256 2 -#define OTA_ECDSA_SHA256 3 -/** - * @brief Certificate type for OTA PAL test. - * Valid options are: OTA_RSA_SHA1, OTA_RSA_SHA256, OTA_ECDSA_SHA256. - * - * #define OTA_PAL_TEST_CERT_TYPE OTA_ECDSA_SHA256 - */ - -/** - * @brief Path to cert for OTA test PAL. Used to verify signature. - * If applicable, the device must be pre-provisioned with this certificate. Please see - * test/common/ota/test_files for the set of certificates. - * - * #define OTA_PAL_CERTIFICATE_FILE "ecdsa-sha256-signer.crt.pem" - */ - -/** - * @brief Some devices have a hard-coded name for the firmware image to boot. - * - * #define OTA_PAL_FIRMWARE_FILE "dummy.bin" - */ - -/** - * @brief Some boards OTA PAL layers will use the file names passed into it for the - * image and the certificates because their non-volatile memory is abstracted by a - * file system. Set this to 1 if that is the case for your device. - * - * #define OTA_PAL_USE_FILE_SYSTEM 0 - */ - /** * @brief The PKCS #11 supports RSA key function. * @@ -303,29 +263,4 @@ * #define PKCS11_TEST_LABEL_ROOT_CERTIFICATE pkcs11configLABEL_ROOT_CERTIFICATE */ -/** - * @brief The IoT Thing name for the device for OTA test. - * - * #define IOT_THING_NAME "PLACE_HOLDER" - */ - -/** - * @brief Major version for OTA E2E test. - * - * #define OTA_APP_VERSION_MAJOR 0 - */ - -/** - * @brief Major version for OTA E2E test. - * - * #define OTA_APP_VERSION_MINOR 9 - */ - -/** - * @brief Major version for OTA E2E test. - * - * #define OTA_APP_VERSION_BUILD 1 - */ - - #endif /* TEST_PARAM_CONFIG_H */ diff --git a/src/ota/README.md b/src/ota/README.md deleted file mode 100644 index db25055..0000000 --- a/src/ota/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# OTA Platform Abstraction Layer (PAL) Test - -## On this page: -1. [Introduction](#1-introduction) -2. [OTA PAL Test Cases](#2-ota-pal-test-cases) -3. [Prerequisites For OTA PAL Test](#3-prerequisites-for-ota-pal-test) -4. [Configure OTA PAL Test](#4-configure-ota-pal-test) -5. [Running OTA PAL Test](#5-running-ota-pal-test) - -## 1. Introduction - -OTA PAL tests help to verify OTA PAL implementation. OTA PAL interface can be found [here](https://freertos.org/Documentation/api-ref/ota-for-aws-iot-embedded-sdk/docs/doxygen/output/html/ota_pal_interface.html). - -OTA PAL tests have the following required parameters that should be setup in `SetupOtaPalTestParam()` implementation: -* pageSize: page size of flash. All test writes will be aligned to this page size. - -## 2. OTA PAL Test Cases - -The OTA PAL tests verify the implementation by running various test cases. - -|Test Case |Test Case Detail |Expected result | -|--- |--- |--- | -|otaPal_CloseFile_ValidSignature | Test otaPal_CloseFile with a valid signature and signature verification certificate | otaPal_CloseFile returns OtaPalSuccess | -|otaPal_CloseFile_InvalidSignatureBlockWritten |Call otaPal_CloseFile with an invalid signature in the file context after writing a block of dummy data to the file | otaPal_CloseFile returns OtaPalSignatureCheckFailed | -|otaPal_CloseFile_InvalidSignatureNoBlockWritten | Call otaPal_CloseFile with an invalid signature in the file context without writing to the file | otaPal_CloseFile returns OtaPalSignatureCheckFailed | -|otaPal_CloseFile_NonexistingCodeSignerCertificate | Call otaPal_CloseFile with a signature verification certificate path does not exist in the system. | otaPal_CloseFile returns OtaPalBadSignerCert| -|otaPal_CreateFileForRx_CreateAnyFile | Create a file with any name with otaPal_CreateFileForRx | otaPal_CreateFileForRx returns OtaPalSuccess| -|otaPal_Abort_OpenFile |Abort on an open file | otaPal_Abort returns OtaPalSuccess | -|otaPal_Abort_FileWithBlockWritten | Abort after writing a block to an open file | otaPal_Abort returns OtaPalSuccess | -|otaPal_Abort_NullFileHandle |Call otaPal_Abort on a NULL file handle | otaPal_Abort returns OtaPalSuccess | -|otaPal_Abort_NonExistentFile |Call otaPal_Abort on a non-existent file | otaPal_Abort returns OtaPalSuccess | -|otaPal_WriteBlock_WriteSingleByte | Write one byte of data into created OTA file | otaPal_WriteBlock returns 1 | -|otaPal_WriteBlock_WriteManyBlocks | Write multiple blocks of data into created OTA file |otaPal_WriteBlock returns number of bytes written | -|otaPal_SetPlatformImageState_AcceptedStateWithoutClose | Set the platform state to accepted before closing the file | otaPal_SetPlatformImageState returns OtaPalCommitFailed | -|otaPal_SetPlatformImageState_InvalidImageState | Set an invalid platform image state exceeding the range | otaPal_SetPlatformImageState returns OtaPalBadImageState| -|otaPal_SetPlatformImageState_UnknownImageState | Set the image state to unknown | otaPal_SetPlatformImageState returns OtaPalBadImageState | -|otaPal_GetPlatformImageState_InvalidImageStateFromFileCloseFailure | Set the platform image state to aborted | otaPal_SetPlatformImageState returns success | - - -Assert may be used to check invalid parameters. In that case, you may need to replace -the assert macro to return negative value in your implementation -to ensure invalid parameter error can be catched by assert.

-For example, if you are using FreeRTOS configASSERT macro to check invalid parameters, -you can replace the macro with the following code: -``` -#define configASSERT( x ) if( !( x ) ) { return NEGATIVE_VALUE_TO_INDICATE_ERROR; } -``` - -## 3. Prerequisites For OTA PAL Test - -The OTA PAL test assumes the tested platform already has the following components integrated. - -* **OTA PAL implementation** - -* **Unity test framework** - The OTA PAL tests make use of the Unity test framework. Reference the [website](https://github.com/ThrowTheSwitch/Unity) for integration guide. - -## 4. Configure OTA PAL Test -Please refer to top level [README](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/main/README.md) on high level project setup. -This section covers OTA PAL test specific configuration. - -1. Implement the setup function, **SetupOtaPalParam**, for OTA PAL test to provide test parameters. The following are required test parameters: - -```C -typedef struct OtaPalTestParam -{ - uint32_t pageSize; -} OtaPalTestParam_t; - -void SetupOtaPalTestParam( OtaPalTestParam_t * pTestParam ); -``` -The pageSize parameter is expected to be multiples of flash page size. The tests will handle page size alignment and OTA PAL implementation is not expected to handle page alignment explicitly. This is to align with [OTA platform interface specification](https://github.com/aws/ota-for-aws-iot-embedded-sdk/blob/1cd22fbe9cca9046c54bacbb2279098eccae13c2/source/include/ota_platform_interface.h#L213). - -## 5. Running OTA PAL Test - -Open test_execution_config.h and define `OTA_PAL_TEST_ENABLED` to 1. - -In test_param_config.h, update the following options: - -* OTA_PAL_TEST_CERT_TYPE: Select the certificate type used -* OTA_PAL_CERTIFICATE_FILE: Path to on device certificate, if applicable. -* OTA_PAL_FIRMWARE_FILE: Name of the firmware file, if applicable. -* OTA_PAL_USE_FILE_SYSTEM: Set to 1 if the OTA PAL uses file system abtraction. - -Build and flash the application using toolchain of your choice. When RunQualificationTest() is called, the OTA PAL tests will run. Test results are outputted to serial. diff --git a/src/ota/aws_test_ota_pal_ecdsa_sha256_signature.h b/src/ota/aws_test_ota_pal_ecdsa_sha256_signature.h deleted file mode 100644 index a657991..0000000 --- a/src/ota/aws_test_ota_pal_ecdsa_sha256_signature.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * FreeRTOS V202107.00 - * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - -#ifndef AWS_TEST_PAL_ECDSA_SHA256_SIGNATURE_H_ -#define AWS_TEST_PAL_ECDSA_SHA256_SIGNATURE_H_ -#include - -/** - * @brief Invalid signature for OTA PAL testing. - */ -static const uint8_t ucInvalidSignature[] = -{ - 0x30, 0x44, 0x02, 0x20, 0x75, 0xde, 0xa8, 0x1f, 0xca, 0xec, 0xff, 0x16, - 0xbb, 0x38, 0x4b, 0xe3, 0x14, 0xe7, 0xfb, 0x68, 0xf5, 0x3e, 0x86, 0xa2, - 0x71, 0xba, 0x9e, 0x5e, 0x50, 0xbf, 0xb2, 0x7a, 0x9e, 0x00, 0xc6, 0x4d, - 0x02, 0x20, 0x19, 0x72, 0x42, 0x85, 0x2a, 0xac, 0xdf, 0x5a, 0x5e, 0xfa, - 0xad, 0x49, 0x17, 0x5b, 0xce, 0x5b, 0x65, 0x75, 0x08, 0x47, 0x3e, 0x55, - 0xf9, 0x0e, 0xdf, 0x9e, 0x8c, 0xdc, 0x95, 0xdf, 0x63, 0xd2 -}; -static const int ucInvalidSignatureLength = 70; - -/** - * @brief Valid signature matching the test block in the OTA PAL tests. - */ -static const uint8_t ucValidSignature[] = -{ - 0x30, 0x44, 0x02, 0x20, 0x15, 0x6a, 0x68, 0x98, 0xf0, 0x4e, 0x1e, 0x12, - 0x4c, 0xc4, 0xf1, 0x05, 0x22, 0x36, 0xfd, 0xb4, 0xe5, 0x5d, 0x83, 0x08, - 0x2a, 0xf3, 0xa6, 0x7d, 0x32, 0x6b, 0xff, 0x85, 0x27, 0x14, 0x9b, 0xbf, - 0x02, 0x20, 0x26, 0x7d, 0x5f, 0x4d, 0x12, 0xab, 0xec, 0x17, 0xd8, 0x45, - 0xc6, 0x3d, 0x8e, 0xd8, 0x8d, 0x3f, 0x28, 0x26, 0xfd, 0xce, 0x32, 0x34, - 0x17, 0x05, 0x47, 0xb2, 0xf6, 0x84, 0xd5, 0x68, 0x3e, 0x36 -}; -static const int ucValidSignatureLength = 70; - -#define OTA_PAL_CODE_SIGNING_CERTIFICATE \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIBXDCCAQOgAwIBAgIJAPMhJT8l0C6AMAoGCCqGSM49BAMCMCExHzAdBgNVBAMM\n" \ - "FnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wHhcNMTgwNjI3MjAwNDQyWhcNMTkwNjI3\n" \ - "MjAwNDQyWjAhMR8wHQYDVQQDDBZ0ZXN0X3NpZ25lckBhbWF6b24uY29tMFkwEwYH\n" \ - "KoZIzj0CAQYIKoZIzj0DAQcDQgAEyza/tGLVbVxhL41iYtC8D6tGEvAHu498gNtq\n" \ - "DtPsKaoR3t5xQx+6zdWiCi32fgFT2vkeVAmX3pf/Gl8nIP48ZqMkMCIwCwYDVR0P\n" \ - "BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMAoGCCqGSM49BAMCA0cAMEQCIDkf\n" \ - "83Oq8sOXhSyJCWAN63gc4vp9//RFCXh/hUXPYcTWAiBgmQ5JV2MZH01Upi2lMflN\n" \ - "YLbC+lYscwcSlB2tECUbJA==\n" \ - "-----END CERTIFICATE-----\n" -#endif /* ifndef AWS_TEST_PAL_ECDSA_SHA256_SIGNATURE_H_ */ diff --git a/src/ota/aws_test_ota_pal_rsa_sha1_signature.h b/src/ota/aws_test_ota_pal_rsa_sha1_signature.h deleted file mode 100644 index 89db4b3..0000000 --- a/src/ota/aws_test_ota_pal_rsa_sha1_signature.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * FreeRTOS V202107.00 - * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - -#ifndef AWS_TEST_OTA_PAL_RSA_SHA1_SIGNATURE_H_ -#define AWS_TEST_OTA_PAL_RSA_SHA1_SIGNATURE_H_ - -#include - -/** - * @brief Invalid signature for OTA PAL testing. - */ -static const uint8_t ucInvalidSignature[] = -{ - 0x1a, 0x90, 0xe6, 0xd8, 0x25, 0x0b, 0xa5, 0x53, 0xa1, 0xb3, 0x10, 0xdb, - 0x5b, 0x36, 0xda, 0x81, 0xbf, 0x77, 0x63, 0xc1, 0xc9, 0xe6, 0xd2, 0x5e, - 0x2e, 0x2c, 0x32, 0xbc, 0x0f, 0x78, 0xc4, 0x42, 0xf2, 0xfb, 0x20, 0x39, - 0x0a, 0xdc, 0xbd, 0x52, 0x68, 0x6a, 0xb4, 0xfa, 0xf5, 0xc0, 0x04, 0xb9, - 0x5a, 0x7e, 0xf2, 0x44, 0x72, 0x90, 0x21, 0x0c, 0xe5, 0x4a, 0x9f, 0x8d, - 0x9d, 0x6f, 0x54, 0x2c, 0x57, 0x20, 0x4e, 0xdf, 0xf8, 0x00, 0x6f, 0xc0, - 0x91, 0xc3, 0xbe, 0xe7, 0x0a, 0xe2, 0x65, 0x82, 0x00, 0xaa, 0xf8, 0x8b, - 0xe6, 0x0a, 0x58, 0xe3, 0x4a, 0x86, 0xe4, 0xce, 0x20, 0xd5, 0x4a, 0x39, - 0x2d, 0x7b, 0xef, 0x71, 0x99, 0x62, 0xf3, 0xa9, 0xe1, 0x21, 0x28, 0x73, - 0x79, 0x3d, 0x60, 0xe9, 0x1d, 0x38, 0xb0, 0x65, 0x88, 0xef, 0x06, 0x83, - 0x14, 0x72, 0xd4, 0x29, 0x34, 0x0f, 0x43, 0x87, 0x9a, 0xf8, 0x09, 0xb8, - 0xec, 0xc6, 0x4d, 0x2f, 0x5f, 0xc8, 0xf0, 0x09, 0x25, 0x03, 0x05, 0x30, - 0x96, 0x26, 0x48, 0xc9, 0x2e, 0xaf, 0xfb, 0xb5, 0x4e, 0xbe, 0xbe, 0x99, - 0xc3, 0xb4, 0x80, 0xd8, 0xd3, 0x33, 0xf7, 0xc9, 0xf9, 0x16, 0xfe, 0xed, - 0xef, 0xaa, 0x28, 0xf4, 0x65, 0x80, 0xb3, 0x6a, 0xe4, 0xb5, 0x1d, 0x72, - 0x62, 0xb7, 0xb8, 0x26, 0x62, 0xbf, 0x2b, 0xa7, 0x89, 0x3d, 0x45, 0x69, - 0x3e, 0x65, 0x7a, 0x89, 0x05, 0x83, 0xe8, 0x14, 0x57, 0xe2, 0x6b, 0x64, - 0x7c, 0xba, 0xe2, 0xd6, 0xee, 0xfe, 0x49, 0x56, 0x20, 0x27, 0x70, 0x2c, - 0x77, 0x46, 0xf7, 0x9d, 0x6c, 0x61, 0x41, 0xe0, 0xdf, 0x2c, 0xe2, 0xd0, - 0x44, 0x6f, 0x4a, 0xd8, 0x16, 0x20, 0xf9, 0xcf, 0x2d, 0x67, 0x79, 0x10, - 0x1c, 0x86, 0xf6, 0xf4, 0xe9, 0xb0, 0x0e, 0x40, 0x32, 0xce, 0x11, 0xde, - 0x28, 0x86, 0x43, 0x6d -}; - -static int ucInvalidSignatureLength = 256; - -/** - * @brief Valid signature matching the test block in the OTA PAL tests. - */ -static const uint8_t ucValidSignature[] = -{ - 0x14, 0x79, 0x9d, 0x06, 0x72, 0x31, 0x8a, 0x45, 0xb0, 0x2a, 0xb8, 0x56, - 0xc6, 0x48, 0x4a, 0xd5, 0xae, 0x1a, 0xe8, 0xe9, 0x3d, 0x35, 0x75, 0xa9, - 0x0b, 0x76, 0x3a, 0x12, 0x5d, 0xf9, 0x99, 0x80, 0x9b, 0xca, 0xff, 0xe1, - 0xa0, 0x2f, 0x1a, 0x63, 0x3f, 0xee, 0xa3, 0x05, 0x13, 0xc1, 0xf0, 0x71, - 0x90, 0xa9, 0x97, 0xac, 0xa0, 0x6e, 0x30, 0x59, 0xaa, 0xd5, 0x6b, 0x6f, - 0x0c, 0x9a, 0x76, 0x2c, 0xa2, 0xd3, 0x5a, 0x81, 0xda, 0xb2, 0x90, 0x4d, - 0x8f, 0x0d, 0x4d, 0xa9, 0x0a, 0xcd, 0x6d, 0xaa, 0x3e, 0x54, 0x68, 0x67, - 0x10, 0x03, 0x13, 0xb7, 0xfa, 0xa3, 0x85, 0x56, 0x2b, 0xc2, 0x1d, 0x20, - 0x7b, 0x50, 0xed, 0x90, 0xdd, 0x27, 0xf9, 0x24, 0xf2, 0xcc, 0x21, 0x0d, - 0x75, 0x9f, 0xa6, 0xdd, 0x62, 0xc9, 0xca, 0xb5, 0x0f, 0xec, 0x1a, 0x3a, - 0xe6, 0x08, 0x84, 0xd6, 0xde, 0x59, 0x4b, 0x37, 0xa8, 0xce, 0x28, 0x5f, - 0x2e, 0x74, 0xca, 0x47, 0x0d, 0x0f, 0x30, 0xc4, 0xbe, 0xaf, 0xf3, 0x6c, - 0xc7, 0x0d, 0x2d, 0x03, 0x0d, 0x05, 0xd3, 0xe5, 0xbd, 0x80, 0xc1, 0x3e, - 0xa8, 0x56, 0x2d, 0xbb, 0x9e, 0x17, 0x2b, 0xcd, 0xce, 0x37, 0x45, 0x36, - 0x07, 0x64, 0xdc, 0xbc, 0x15, 0x84, 0x5e, 0xca, 0xd9, 0xa6, 0xab, 0xd9, - 0x23, 0xcd, 0xe4, 0x8a, 0x4e, 0xee, 0x74, 0xcf, 0xb3, 0x0d, 0x24, 0x28, - 0xeb, 0x95, 0xec, 0xa8, 0xb1, 0x70, 0x29, 0x08, 0x46, 0x82, 0xcd, 0x33, - 0xcb, 0x90, 0x33, 0x59, 0xcd, 0x7c, 0xbf, 0xbb, 0x8b, 0x7c, 0xc6, 0xbe, - 0x18, 0x36, 0xf7, 0x01, 0x4e, 0xe0, 0x12, 0x81, 0xf9, 0x2d, 0x7a, 0x04, - 0x7f, 0x0e, 0x2b, 0xe6, 0x80, 0xd5, 0xb3, 0x87, 0x33, 0x04, 0xcb, 0x9c, - 0x05, 0x93, 0xb0, 0x02, 0x37, 0xf1, 0x1d, 0x8b, 0x96, 0x9f, 0xdc, 0x9c, - 0xad, 0xe0, 0x8e, 0xd3 -}; -static const int ucValidSignatureLength = 256; - -/** - * @brief The type of signature method this file defines for the valid signature. - */ -#define OTA_PAL_CODE_SIGNING_CERTIFICATE \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQUFADB8MQswCQYDVQQGEwJJTDEP\n" \ - "MA0GA1UECAwGU2hhcm9uMRAwDgYDVQQHDAdSYWFuYW5hMR8wHQYDVQQKDBZUZXhh\n" \ - "cyBJbnN0cnVtZW50cyBJbmMuMQwwCgYDVQQLDANSTkQxGzAZBgNVBAMMEmR1bW15\n" \ - "LXJvb3QtY2EtY2VydDAeFw0xODA2MjcxOTI4NTNaFw0xOTA2MjcxOTI4NTNaMCEx\n" \ - "HzAdBgNVBAMMFnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wggEiMA0GCSqGSIb3DQEB\n" \ - "AQUAA4IBDwAwggEKAoIBAQC5craIexo46oq3OTj+3fLz17MCtw/icXku8sJ16el0\n" \ - "29Cibq4u8bdJeDnGlc42UySw0UlodWnzd5I52tXoXcQZs++m6uQ3JvvRHFXpNuV6\n" \ - "Cyo//AdQ2MoqdKK8/pZqu4X71/xXHcIMBb3kS1RSkunJB65mPuPOfjcem6IXDtRk\n" \ - "E346aN6wMfeIlmwOoFK4RBoWse459ELB5aq0tSwUmHv7UcyHYQf4Cxkz5HjWfx0y\n" \ - "NYKCR4tPoudjg8E9R6uqik7DFlqrijNW2XdXS67d/cVToDJFn1SnYcHStARAoZUK\n" \ - "gP0JwXTapO31QThi9q+q63FETBcnEQ29rfmeN1/pBOI/AgMBAAGjJDAiMAsGA1Ud\n" \ - "DwQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzANBgkqhkiG9w0BAQUFAAOCAQEA\n" \ - "W29xvDV66B7NYAOSqXIG11JH+Pk2GFzZl5gNehkcDPPMHumBRNHHZqVAO4mah3Ej\n" \ - "StqWmTXnIs5YKX9Ro7ch3NfKHMt4/JFvR7v9VolVIVwZZB+AQU1BD8OAGlHNEq28\n" \ - "TbOdkpdv9Q69W4TVsqXAkVhONekLkEJQTZyhW7db28nb/LizftfN4ps+uuE2Xl9c\n" \ - "YHmgWb/xqi9NIcsyQL08urJVCnyGuLQgj+GfitELFsCfc3ohhacNENsXupRIOz08\n" \ - "NCa9WuCyk5uwoo6mn6JIErBMLqLTBcs82vq9d7WIFHf4QpgTs2FuelY/Hyw7HRFo\n" \ - "Ml3tXnR4B4lqeJy/BP6/GA==\n" \ - "-----END CERTIFICATE-----" - -#endif /* AWS_TEST_OTA_PAL_RSA_SHA1_SIGNATURE_H_ */ diff --git a/src/ota/aws_test_ota_pal_rsa_sha256_signature.h b/src/ota/aws_test_ota_pal_rsa_sha256_signature.h deleted file mode 100644 index d4f76fe..0000000 --- a/src/ota/aws_test_ota_pal_rsa_sha256_signature.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * FreeRTOS V202107.00 - * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://aws.amazon.com/freertos - * http://www.FreeRTOS.org - */ - -#ifndef AWS_TEST_OTA_PAL_RSA_SHA256_SIGNATURE_H_ -#define AWS_TEST_OTA_PAL_RSA_SHA256_SIGNATURE_H_ - -#include - -/** - * @brief Invalid signature for OTA PAL testing. - */ -static const uint8_t ucInvalidSignature[] = -{ - 0x65, 0x2d, 0x7f, 0x38, 0x7d, 0xa7, 0x2b, 0x63, 0x83, 0x01, 0x7d, 0xc8, - 0x5a, 0x49, 0xd8, 0x9e, 0x46, 0xaa, 0x61, 0x32, 0x9b, 0xd6, 0x96, 0xfc, - 0xc3, 0x2a, 0x06, 0xaf, 0xc4, 0x41, 0xf5, 0xe1, 0x5b, 0x61, 0xc7, 0x39, - 0xf6, 0xe8, 0xe3, 0x00, 0xfc, 0xc4, 0x01, 0x63, 0x26, 0x90, 0x5c, 0x1f, - 0x44, 0x1f, 0x43, 0x02, 0xaf, 0x96, 0xd4, 0x3e, 0x88, 0x9e, 0xb6, 0x37, - 0xd1, 0xdd, 0x31, 0x1b, 0xfd, 0x1a, 0x3f, 0xbd, 0x7d, 0x93, 0x8d, 0x69, - 0xbb, 0x3e, 0xfc, 0x44, 0x61, 0xef, 0xc4, 0xce, 0xba, 0xd6, 0x29, 0xb4, - 0x41, 0xc9, 0xab, 0xac, 0xc5, 0x4d, 0x86, 0x0b, 0xd4, 0xb1, 0x26, 0xc3, - 0xa3, 0x9e, 0xea, 0x2b, 0x6c, 0xfa, 0x3f, 0x24, 0x27, 0x86, 0x17, 0x5d, - 0xc0, 0xa6, 0x98, 0xd4, 0x7d, 0x18, 0x47, 0xde, 0xd4, 0xd7, 0x46, 0x95, - 0x60, 0x91, 0x5e, 0xc9, 0xed, 0x87, 0x98, 0x68, 0xb5, 0xe7, 0x83, 0x0c, - 0xaa, 0xfd, 0x36, 0x27, 0x17, 0xfb, 0xb1, 0xb2, 0xed, 0x73, 0x3b, 0xeb, - 0x55, 0xa3, 0x29, 0xb4, 0x80, 0x38, 0xdb, 0x36, 0x3b, 0x9e, 0x67, 0xfd, - 0x33, 0x8b, 0x9b, 0x91, 0xc0, 0xc3, 0x14, 0xb7, 0xbe, 0x97, 0x80, 0xef, - 0x67, 0x97, 0xdf, 0x81, 0x0d, 0x40, 0x38, 0xd9, 0xaa, 0x82, 0xb8, 0x20, - 0x63, 0x91, 0x06, 0xe5, 0x03, 0xa0, 0x65, 0x21, 0x3d, 0xc4, 0x3a, 0xd1, - 0xb5, 0x4d, 0x3d, 0x85, 0x54, 0x5d, 0xfe, 0x0f, 0x0b, 0x42, 0xf4, 0x8a, - 0xfa, 0x69, 0x42, 0xa8, 0x9d, 0x19, 0x45, 0x38, 0x0b, 0x88, 0xdf, 0x28, - 0xd3, 0xd6, 0x57, 0xb5, 0x2f, 0x74, 0x92, 0x2a, 0xb4, 0x2d, 0x0b, 0xa6, - 0xed, 0x1a, 0x6f, 0x13, 0x8f, 0xb8, 0x59, 0x52, 0xc5, 0x31, 0xaf, 0xef, - 0xbc, 0x58, 0x93, 0xbf, 0xf5, 0x8c, 0x4e, 0xc6, 0x54, 0x49, 0x95, 0xca, - 0x9d, 0xdd, 0xd9, 0x5f -}; -static const int ucInvalidSignatureLength = 256; - -/** - * @brief Valid signature matching the test block in the OTA PAL tests. - */ -static const uint8_t ucValidSignature[] = -{ - 0xa9, 0x5f, 0xa1, 0x5d, 0x9b, 0x42, 0x09, 0x78, 0xaf, 0x95, 0xe4, 0x42, - 0xac, 0xf4, 0xd7, 0x83, 0xea, 0xa9, 0x67, 0x54, 0x32, 0x62, 0x54, 0x21, - 0x46, 0xf5, 0x91, 0xe7, 0x76, 0xdf, 0x2f, 0xa0, 0x6a, 0xe3, 0xb1, 0xd2, - 0xda, 0x1b, 0x6d, 0x54, 0x6b, 0xac, 0xb6, 0x38, 0x1d, 0x3c, 0xf1, 0xcf, - 0x0d, 0x33, 0x84, 0xac, 0x5d, 0xf1, 0x20, 0x7b, 0xfe, 0x2f, 0x9d, 0xf9, - 0x93, 0x5e, 0x4d, 0x34, 0xdc, 0x21, 0x1c, 0x1b, 0x90, 0xf8, 0x37, 0xc6, - 0x7d, 0x16, 0x16, 0x25, 0xe3, 0xcc, 0x06, 0xb5, 0xd5, 0xbf, 0x64, 0x64, - 0x44, 0xa0, 0x60, 0xfe, 0xf3, 0xba, 0xf2, 0xdc, 0xc7, 0x57, 0xbe, 0xca, - 0xcc, 0x6b, 0x57, 0xc2, 0x89, 0x7c, 0xef, 0xdc, 0xc8, 0xf8, 0xb3, 0x34, - 0x8f, 0x67, 0x7a, 0x04, 0x3e, 0x9f, 0x96, 0x17, 0x7f, 0x98, 0x6c, 0x87, - 0x21, 0x70, 0x9d, 0xf8, 0xf4, 0x26, 0xe4, 0xc8, 0x61, 0x57, 0x2a, 0xea, - 0x08, 0xe1, 0x51, 0x52, 0xbb, 0x53, 0x11, 0x35, 0x1e, 0x39, 0x1a, 0x11, - 0x2f, 0xc4, 0xa6, 0x19, 0x5e, 0x6a, 0x62, 0xa1, 0x77, 0x7f, 0x6b, 0xc4, - 0x0a, 0x61, 0xf8, 0x9a, 0x95, 0xd2, 0xfa, 0x09, 0x38, 0xd1, 0xb1, 0xfb, - 0x75, 0xd1, 0x36, 0xfe, 0x2f, 0xc5, 0x08, 0xc1, 0x35, 0x66, 0x7a, 0x97, - 0x46, 0x61, 0x8a, 0xfa, 0xbb, 0x83, 0x63, 0x8c, 0xe9, 0x0b, 0x2a, 0x3e, - 0x88, 0xaa, 0x79, 0x63, 0xb6, 0x92, 0x22, 0xb1, 0x75, 0xeb, 0x20, 0x0d, - 0x06, 0xb2, 0x01, 0x35, 0x01, 0xa2, 0xa7, 0x21, 0x3f, 0xe9, 0x80, 0x83, - 0x87, 0xfd, 0x29, 0x54, 0x77, 0x3a, 0x13, 0xa6, 0x10, 0xa7, 0x47, 0xed, - 0x9f, 0xb1, 0x52, 0xb6, 0x86, 0x54, 0xbc, 0x89, 0x40, 0xa8, 0x74, 0x15, - 0xd8, 0xa7, 0x69, 0x9b, 0x27, 0x7a, 0x99, 0xde, 0x9d, 0xdc, 0x69, 0xb6, - 0x0c, 0x57, 0x68, 0x3d -}; -static const int ucValidSignatureLength = 256; - -/** - * @brief The type of signature method this file defines for the valid signature. - */ -#define OTA_PAL_CODE_SIGNING_CERTIFICATE_PEM \ - "-----BEGIN CERTIFICATE-----\n" \ - "MIIC6TCCAdGgAwIBAgIJAJmG5mbNWlukMA0GCSqGSIb3DQEBCwUAMCExHzAdBgNV\n" \ - "BAMMFnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wHhcNMTgwNjI3MjAwMDIyWhcNMTkw\n" \ - "NjI3MjAwMDIyWjAhMR8wHQYDVQQDDBZ0ZXN0X3NpZ25lckBhbWF6b24uY29tMIIB\n" \ - "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt8SVb/B4pRHAsxtK5Xcm1iBK\n" \ - "BIpiUc/ovUPzhGVlvkeZJfV2hrHc8PJx+XMyxp/MQGI1nr0AfHKkmAbisfU15/ta\n" \ - "foY1D9Skomlp+QKCK4UvJCKRl/vgdgKtZ6+vEls4tguBmt0pwQsEhNP2TDUA47uq\n" \ - "n7wcvgEwrrDLa9cmP7bfxRbVTWCKdchllOnRgLc05lQpRGxyMaB8zsgmx27AJlJI\n" \ - "rXFmnSiOKKGo6Di9/UQTLTzC+t6YfajMSpq+Fe+td7hv/vSsZT+5yLSpJDwmHTp5\n" \ - "66AljEEv0vfcJ72dStacEoOKM/qX4dfQfQOF3nyeP6ofgakc+zEjncQPCoCLUQID\n" \ - "AQABoyQwIjALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZI\n" \ - "hvcNAQELBQADggEBAHjgDAj+U4SpHIaxfvKuNxxPiGnyUSWyXS2h5HiPixL85psS\n" \ - "k5hvbZaFJwRICSX1dU9EAf2sQN+s2MCLKPnm8vzKWLkyEUzWScr7C/mVXw8cEmdI\n" \ - "rd3uzsN4IThHxHiwhPXu2IjjoIjSXLHcTKyZR2uHaifXbVEEwmUimg/49of02eIa\n" \ - "ouLySI/+zcLgNFtTklRdSUxxGVK9y47ufiVb+sErzfDBpYx7CwZg0d+wPgfbuYE2\n" \ - "8GMrCwFUbsFGMvhscPwG51rFLNonWh+ThZIwHrBwnVXmsDXayBlr6wCA50zGfBQb\n" \ - "SXVRXIv/SKpj1k1slnf9IJLfArH6F0Ctjcef/Aw=\n" \ - "-----END CERTIFICATE-----" - -#endif /* AWS_TEST_OTA_PAL_RSA_SHA256_SIGNATURE_H_ */ diff --git a/src/ota/ota_pal_test.c b/src/ota/ota_pal_test.c deleted file mode 100644 index e890faa..0000000 --- a/src/ota/ota_pal_test.c +++ /dev/null @@ -1,651 +0,0 @@ -/** - * @file ota_pal_test.c - * @brief Various tests for validating an implementation to the OTA PAL. - */ - -#include "test_execution_config.h" -#if ( OTA_PAL_TEST_ENABLED == 1 ) - -/* Standard includes. */ -#include -#include -#include -#include - -/* Unity Test framework include. */ -#include "unity_fixture.h" -#include "unity.h" - -/* Include OTA headers. */ -#include "ota.h" -#include "ota_appversion32.h" -#include "ota_pal.h" - -#include "ota_pal_test.h" -#include "test_param_config.h" - -#ifndef OTA_PAL_TEST_CERT_TYPE - #error "Please define OTA_PAL_TEST_CERT_TYPE" -#endif - -#if( OTA_PAL_TEST_CERT_TYPE == OTA_RSA_SHA1 ) - #include "aws_test_ota_pal_rsa_sha1_signature.h" -#elif( OTA_PAL_TEST_CERT_TYPE == OTA_RSA_SHA256 ) - #include "aws_test_ota_pal_rsa_sha256_signature.h" -#elif( OTA_PAL_TEST_CERT_TYPE == OTA_ECDSA_SHA256 ) - #include "aws_test_ota_pal_ecdsa_sha256_signature.h" -#else - #error "Invalid OTA_PAL_TEST_CERT_TYPE" -#endif - -/* For the otaPal_WriteBlock_WriteManyBlocks test this is the number of blocks - * of ucDummyData to write to the non-volatile memory. */ -#define testotapalNUM_WRITE_BLOCKS 10 - -static OtaPalTestParam_t testParam; - -/* - * @brief: This dummy data is prepended by a SHA1 hash generated from the - * rsa-sha1-signer certificate and keys in tests/common/ota/test_files. - * - * The RSA SHA256 signature and ECDSA 256 signature are generated from this - * entire data block as is. - */ -static uint8_t ucDummyData[] = -{ - 0x83, 0x0b, 0xf0, 0x6a, 0x81, 0xd6, 0xca, 0xd7, 0x08, 0x22, 0x0d, 0x6a, - 0x33, 0xfa, 0x31, 0x9f, 0xa9, 0x5f, 0xb5, 0x26, 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0c, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, - 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, - 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f -}; - -/* Global static OTA file context used in every test. This variable is reset to - * all zeros before every test. */ -static OtaFileContext_t xOtaFile; - -/** - * @brief Test group definition. - */ -TEST_GROUP( Full_OTA_PAL ); - -TEST_SETUP( Full_OTA_PAL ) -{ - /* Reset the OTA file context before each test. */ - memset( &xOtaFile, 0, sizeof( xOtaFile ) ); -} - -TEST_TEAR_DOWN( Full_OTA_PAL ) -{ - OtaPalStatus_t xOtaStatus; - - /* Abort the OTA file after every test. This closes the OTA file. - * otaPal_Abort should only return OtaPalSuccess or OtaPalAbortFailed. */ - xOtaStatus = otaPal_Abort( &xOtaFile ); - TEST_ASSERT( OTA_PAL_MAIN_ERR( xOtaStatus ) == OtaPalSuccess || - OTA_PAL_MAIN_ERR( xOtaStatus ) == OtaPalAbortFailed ); -} - -TEST_GROUP_RUNNER( Full_OTA_PAL ) -{ - /************* otaPAL_CloseFile Tests *************/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_CloseFile_ValidSignature ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_CloseFile_InvalidSignatureBlockWritten ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_CloseFile_InvalidSignatureNoBlockWritten ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_CloseFile_NonexistingCodeSignerCertificate ); - - /********** otaPal_CreateFileForRx Tests **********/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_CreateFileForRx_CreateAnyFile ); - - /* Other failure case testing for otaPal_CreateFileForRx() is not possible - * because the MCU's underlying non-volatile memory will have to be mocked - * to return failures for creating a new file. */ - - /*************** otaPal_Abort Tests ***************/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_Abort_OpenFile ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_Abort_FileWithBlockWritten ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_Abort_NullFileHandle ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_Abort_NonExistentFile ); - - /************* otaPal_WriteBlock Tests ************/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_WriteBlock_WriteSingleByte ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_WriteBlock_WriteManyBlocks ); - - /******** otaPal_SetPlatformImageState Tests ******/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_SetPlatformImageState_AcceptedStateWithoutClose ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_SetPlatformImageState_InvalidImageState ); - RUN_TEST_CASE( Full_OTA_PAL, otaPal_SetPlatformImageState_UnknownImageState ); - - /* Setting the image with the accepted state is not supported because that - * requires an image that was written, verified, and rebooted. */ - - /******* otaPal_GetPlatformImageState Tests *******/ - RUN_TEST_CASE( Full_OTA_PAL, otaPal_GetPlatformImageState_InvalidImageStateFromFileCloseFailure ); -} - -/** - * @brief Test otaPal_CloseFile with a valid signature and signature verification - * certificate. Verify the success. - */ -TEST( Full_OTA_PAL, otaPal_CloseFile_ValidSignature ) -{ - OtaPalStatus_t xOtaStatus; - Sig_t xSig = { 0 }; - int16_t bytesWritten; - - /* We use a dummy file name here because closing the system designated bootable - * image with content that is not runnable may cause issues. */ - xOtaFile.pFilePath = ( uint8_t * ) ( "test_happy_path_image.bin" ); - xOtaFile.fileSize = sizeof( ucDummyData ); - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails somewhere here. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - xOtaFile.pSignature = &xSig; - xOtaFile.pSignature->size = ucValidSignatureLength; - memcpy( xOtaFile.pSignature->data, ucValidSignature, ucValidSignatureLength ); - xOtaFile.pCertFilepath = ( uint8_t * ) OTA_PAL_CERTIFICATE_FILE; - - xOtaStatus = otaPal_CloseFile( &xOtaFile ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Call otaPal_CloseFile with an invalid signature in the file context. - * The close is called after we have a written a block of dummy data to the file. - * Verify the correct OTA Agent level error code is returned from otaPal_CloseFile. - */ -TEST( Full_OTA_PAL, otaPal_CloseFile_InvalidSignatureBlockWritten ) -{ - OtaPalStatus_t xOtaStatus; - Sig_t xSig = { 0 }; - int16_t bytesWritten; - - /* Create a local file using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails somewhere here. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Fill out an incorrect signature. */ - xOtaFile.pSignature = &xSig; - xOtaFile.pSignature->size = ucInvalidSignatureLength; - memcpy( xOtaFile.pSignature->data, ucInvalidSignature, ucInvalidSignatureLength ); - xOtaFile.pCertFilepath = ( uint8_t * ) OTA_PAL_CERTIFICATE_FILE; - - /* Try to close the file. */ - xOtaStatus = otaPal_CloseFile( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSignatureCheckFailed, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Call otaPal_CloseFile with an invalid signature in the file context. - * The close is called when no blocks have been written to the file. - * Verify the correct OTA Agent level error code is returned from otaPal_CloseFile. - */ -TEST( Full_OTA_PAL, otaPal_CloseFile_InvalidSignatureNoBlockWritten ) -{ - OtaPalStatus_t xOtaStatus; - Sig_t xSig = { 0 }; - - /* Create a local file using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* Fill out an incorrect signature. */ - xOtaFile.pSignature = &xSig; - xOtaFile.pSignature->size = ucInvalidSignatureLength; - memcpy( xOtaFile.pSignature->data, ucInvalidSignature, ucInvalidSignatureLength ); - xOtaFile.pCertFilepath = ( uint8_t * ) OTA_PAL_CERTIFICATE_FILE; - - /* We still want to close the file if the test fails somewhere here. */ - if( TEST_PROTECT() ) - { - /* Try to close the file. */ - xOtaStatus = otaPal_CloseFile( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSignatureCheckFailed, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Call otaPal_CloseFile with a signature verification certificate path does - * not exist in the system. Verify the correct OTA Agent level error code is returned - * from otaPal_CloseFile. - * - * @note This test is only valid if your device uses a file system in your non-volatile memory. - * Some devices may revert to using aws_codesigner_certificate.h if a file is not found, but - * that option is not being enforced. - */ -TEST( Full_OTA_PAL, otaPal_CloseFile_NonexistingCodeSignerCertificate ) -{ - #if ( OTA_PAL_USE_FILE_SYSTEM == 1 ) - OtaPalStatus_t xOtaStatus; - Sig_t xSig = { 0 }; - int16_t bytesWritten; - - memset( &xOtaFile, 0, sizeof( xOtaFile ) ); - - /* Create a local file using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails somewhere here. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Check the signature (not expected to be valid in this case). */ - xOtaFile.pSignature = &xSig; - xOtaFile.pSignature->size = ucValidSignatureLength; - memcpy( xOtaFile.pSignature->data, ucValidSignature, ucValidSignatureLength ); - xOtaFile.pCertFilepath = ( uint8_t * ) ( "nonexistingfile.crt" ); - - xOtaStatus = otaPal_CloseFile( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalBadSignerCert , OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } - #endif /* if ( OTA_PAL_USE_FILE_SYSTEM == 1 ) */ -} - -/** - * @brief Create a file with any name, and verify success. - */ -TEST( Full_OTA_PAL, otaPal_CreateFileForRx_CreateAnyFile ) -{ - OtaPalStatus_t xOtaStatus; - - memset( &xOtaFile, 0, sizeof( OtaFileContext_t ) ); - - /* TEST: Create a local file using the PAL. Verify error in close. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); -} - -/** - * @brief Abort on an open file. Verify success. - */ -TEST( Full_OTA_PAL, otaPal_Abort_OpenFile ) -{ - OtaPalStatus_t xOtaStatus; - - memset( &xOtaFile, 0, sizeof( OtaFileContext_t ) ); - - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - /* Create a local file using the PAL. */ - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* Signal that the download is being aborted. */ - xOtaStatus = otaPal_Abort( &xOtaFile ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* Verify that the file handle is null. */ - TEST_ASSERT_EQUAL_INT( NULL, xOtaFile.pFile ); -} - -/** - * @brief Abort after writing a block to an open file. Verify success. - */ -TEST( Full_OTA_PAL, otaPal_Abort_FileWithBlockWritten ) -{ - OtaPalStatus_t xOtaStatus; - int16_t bytesWritten; - - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - /* Create a local file again using the PAL. */ - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails here. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - } - - /* Signal that the download is being aborted. */ - xOtaStatus = otaPal_Abort( &xOtaFile ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* Verify that the file handle is null. */ - TEST_ASSERT_EQUAL_INT( NULL, xOtaFile.pFile ); -} - -/** - * @brief Call otaPal_Abort on a NULL file handle. Verify there is no error. - */ -TEST( Full_OTA_PAL, otaPal_Abort_NullFileHandle ) -{ - OtaPalStatus_t xOtaStatus; - - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.pFile = 0; - - xOtaStatus = otaPal_Abort( &xOtaFile ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); -} - -/** - * @brief Verify there is no error for aborting a file that doesn't exist. - */ -TEST( Full_OTA_PAL, otaPal_Abort_NonExistentFile ) -{ - OtaPalStatus_t xOtaStatus; - - xOtaFile.pFilePath = ( uint8_t * ) ( "nonexistingfile.bin" ); - - xOtaStatus = otaPal_Abort( &xOtaFile ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); -} - -/** - * @brief Write one byte of data and verify success. - */ -TEST( Full_OTA_PAL, otaPal_WriteBlock_WriteSingleByte ) -{ - OtaPalStatus_t xOtaStatus; - int16_t bytesWritten; - uint8_t ucData = 0xAA; - - /* TEST: Write a byte of data. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - if( TEST_PROTECT() ) - { - bytesWritten = otaPal_WriteBlock( &xOtaFile, 0, &ucData, 1 ); - TEST_ASSERT_EQUAL_INT( 1, bytesWritten ); - } -} - -/** - * @brief Write many blocks of data to a file opened in the device. Verify success. - * - * Because of Flash property, we might not able to write same page multiple times. - * So we write one block into one page. - */ -TEST( Full_OTA_PAL, otaPal_WriteBlock_WriteManyBlocks ) -{ - OtaPalStatus_t xOtaStatus; - int16_t bytesWritten; - - /* The page size must >= dummy data size, so that we can write whole dummy data in one operation. */ - TEST_ASSERT_LESS_OR_EQUAL( testParam.pageSize, sizeof( ucDummyData ) ); - - /* Some platforms compare the offset and file size, and it's not legal to write when offset > filesize. - * We just set file size to the number of block size to make sure file size is big enough for every write. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = testParam.pageSize * testotapalNUM_WRITE_BLOCKS; - /* TEST: Write many bytes of data. */ - - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - if( TEST_PROTECT() ) - { - int lIndex = 0; - uint32_t writeOffset = 0; - - for( lIndex = 0; lIndex < testotapalNUM_WRITE_BLOCKS; lIndex++ ) - { - bytesWritten = otaPal_WriteBlock( &xOtaFile, writeOffset, ucDummyData, sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL_INT( sizeof( ucDummyData ), bytesWritten ); - - /* Align the writeOff with page size */ - writeOffset = writeOffset + testParam.pageSize; - } - } -} - -/** - * @brief Set the platform state to accepted before closing the file. - * This should result in otaPal_SetPlatformImageState returning OtaPalCommitFailed. - */ -TEST( Full_OTA_PAL, otaPal_SetPlatformImageState_AcceptedStateWithoutClose ) -{ - OtaPalStatus_t xOtaStatus; - OtaImageState_t eImageState = OtaImageStateUnknown; - int16_t bytesWritten; - - /* Create a local file again using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Set the image state. */ - eImageState = OtaImageStateAccepted; - xOtaStatus = otaPal_SetPlatformImageState( &xOtaFile, eImageState ); - TEST_ASSERT_EQUAL_INT( OtaPalCommitFailed, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Set an invalid platform image state exceeding the range and verify - * the expected error code is returned. - */ -TEST( Full_OTA_PAL, otaPal_SetPlatformImageState_InvalidImageState ) -{ - OtaPalStatus_t xOtaStatus; - OtaImageState_t eImageState = OtaImageStateUnknown; - int16_t bytesWritten; - - /* Create a local file again using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Try to set an invalid image state. */ - eImageState = ( OtaImageState_t ) ( OtaLastImageState + 1 ); - xOtaStatus = otaPal_SetPlatformImageState( &xOtaFile, eImageState ); - TEST_ASSERT_EQUAL( OtaPalBadImageState, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Set the image state to unknown and verify a failure. - */ -TEST( Full_OTA_PAL, otaPal_SetPlatformImageState_UnknownImageState ) -{ - OtaPalStatus_t xOtaStatus; - OtaImageState_t eImageState = OtaImageStateUnknown; - int16_t bytesWritten; - - /* Create a local file again using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Try to set an invalid image state. */ - eImageState = OtaImageStateUnknown; - xOtaStatus = otaPal_SetPlatformImageState( &xOtaFile, eImageState ); - TEST_ASSERT_EQUAL( OtaPalBadImageState, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - } -} - -/** - * @brief Set the platform image state to aborted. - * We cannot test a abort failed without mocking the underlying non-volatile memory. - */ -TEST( Full_OTA_PAL, otaPal_SetPlatformImageState_AbortImageState ) -{ - OtaPalStatus_t xOtaStatus; - OtaImageState_t eImageState = OtaImageStateUnknown; - int16_t bytesWritten; - - /* Create a local file again using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - eImageState = OtaImageStateAborted; - xOtaStatus = otaPal_SetPlatformImageState( &xOtaFile, eImageState ); - TEST_ASSERT_EQUAL_INT( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - eImageState = OtaImageStateUnknown; - eImageState = otaPal_GetPlatformImageState( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaImageStateAborted, eImageState); - } -} - -/** - * @brief Verify that the current image received is in the invalid state after a - * failure to close the file because of a bad signature. - */ -TEST( Full_OTA_PAL, otaPal_GetPlatformImageState_InvalidImageStateFromFileCloseFailure ) -{ - OtaPalStatus_t xOtaStatus; - Sig_t xSig = { 0 }; - OtaPalImageState_t ePalImageState = OtaPalImageStateUnknown; - int16_t bytesWritten; - - /* TEST: Invalid image returned from otaPal_GetPlatformImageState(). Using a failure to close. */ - /* Create a local file again using the PAL. */ - xOtaFile.pFilePath = ( uint8_t * ) OTA_PAL_FIRMWARE_FILE; - xOtaFile.fileSize = sizeof( ucDummyData ); - - xOtaStatus = otaPal_CreateFileForRx( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSuccess, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* We still want to close the file if the test fails. */ - if( TEST_PROTECT() ) - { - /* Write data to the file. */ - bytesWritten = otaPal_WriteBlock( &xOtaFile, - 0, - ucDummyData, - sizeof( ucDummyData ) ); - TEST_ASSERT_EQUAL( sizeof( ucDummyData ), bytesWritten ); - - /* Check the signature. */ - xOtaFile.pSignature = &xSig; - xOtaFile.pSignature->size = ucInvalidSignatureLength; - memcpy( xOtaFile.pSignature->data, ucInvalidSignature, ucInvalidSignatureLength ); - xOtaFile.pCertFilepath = ( uint8_t * ) OTA_PAL_CERTIFICATE_FILE; - - xOtaStatus = otaPal_CloseFile( &xOtaFile ); - TEST_ASSERT_EQUAL( OtaPalSignatureCheckFailed, OTA_PAL_MAIN_ERR( xOtaStatus ) ); - - /* The file failed to close, so it is invalid or in an unknown state. */ - ePalImageState = otaPal_GetPlatformImageState( &xOtaFile ); - TEST_ASSERT( ( OtaPalImageStateInvalid == ePalImageState ) || ( OtaPalImageStateUnknown == ePalImageState ) ); - } -} - -/*-----------------------------------------------------------*/ - -int RunOtaPalTest( void ) -{ - int status = -1; - SetupOtaPalTestParam( &testParam ); - - /* Initialize unity. */ - UnityFixture.Verbose = 1; - UnityFixture.GroupFilter = 0; - UnityFixture.NameFilter = 0; - UnityFixture.RepeatCount = 1; - - UNITY_BEGIN(); - - /* Run the test group. */ - RUN_TEST_GROUP( Full_OTA_PAL ); - - status = UNITY_END(); - return status; -} - -/*-----------------------------------------------------------*/ - -#endif /* if ( OTA_TEST_ENABLED == 1 ) */ diff --git a/src/ota/ota_pal_test.h b/src/ota/ota_pal_test.h deleted file mode 100644 index 46ae3b8..0000000 --- a/src/ota/ota_pal_test.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _OTA_PAL_TEST_H_ -#define _OTA_PAL_TEST_H_ - -#include - -typedef struct OtaPalTestParam -{ - uint32_t pageSize; -} OtaPalTestParam_t; - -void SetupOtaPalTestParam( OtaPalTestParam_t * pTestParam ); - -int RunOtaPalTest( void ); - -#endif /* _OTA_PAL_TEST_H_ */ diff --git a/src/ota/test_files/ecdsa-sha256-signer.crt.pem.test b/src/ota/test_files/ecdsa-sha256-signer.crt.pem.test deleted file mode 100644 index 7c33a62..0000000 --- a/src/ota/test_files/ecdsa-sha256-signer.crt.pem.test +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBXDCCAQOgAwIBAgIJAPMhJT8l0C6AMAoGCCqGSM49BAMCMCExHzAdBgNVBAMM -FnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wHhcNMTgwNjI3MjAwNDQyWhcNMTkwNjI3 -MjAwNDQyWjAhMR8wHQYDVQQDDBZ0ZXN0X3NpZ25lckBhbWF6b24uY29tMFkwEwYH -KoZIzj0CAQYIKoZIzj0DAQcDQgAEyza/tGLVbVxhL41iYtC8D6tGEvAHu498gNtq -DtPsKaoR3t5xQx+6zdWiCi32fgFT2vkeVAmX3pf/Gl8nIP48ZqMkMCIwCwYDVR0P -BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMAoGCCqGSM49BAMCA0cAMEQCIDkf -83Oq8sOXhSyJCWAN63gc4vp9//RFCXh/hUXPYcTWAiBgmQ5JV2MZH01Upi2lMflN -YLbC+lYscwcSlB2tECUbJA== ------END CERTIFICATE----- diff --git a/src/ota/test_files/rsa-sha1-root-ca-cert.pem.test b/src/ota/test_files/rsa-sha1-root-ca-cert.pem.test deleted file mode 100644 index f379f38..0000000 --- a/src/ota/test_files/rsa-sha1-root-ca-cert.pem.test +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDyzCCArOgAwIBAgIJAJOqV2LiCvmIMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNV -BAYTAklMMQ8wDQYDVQQIDAZTaGFyb24xEDAOBgNVBAcMB1JhYW5hbmExHzAdBgNV -BAoMFlRleGFzIEluc3RydW1lbnRzIEluYy4xDDAKBgNVBAsMA1JORDEbMBkGA1UE -AwwSZHVtbXktcm9vdC1jYS1jZXJ0MB4XDTE2MDkxMTEzMTgxMFoXDTI2MDkwOTEz -MTgxMFowfDELMAkGA1UEBhMCSUwxDzANBgNVBAgMBlNoYXJvbjEQMA4GA1UEBwwH -UmFhbmFuYTEfMB0GA1UECgwWVGV4YXMgSW5zdHJ1bWVudHMgSW5jLjEMMAoGA1UE -CwwDUk5EMRswGQYDVQQDDBJkdW1teS1yb290LWNhLWNlcnQwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC+F2fNjjVABanE6OWnG1wIlc4ODDVul/5W1YCC -i76uEzUOOMBxYTOFkL6b0rJN7Y22orJC22WuGd3admsG5o4MpYXqJKPOnSa8gZyH -1UGDC+Las5jCg1oHSCI/uZ6D767e+6XVO61JCd6xcAv9AWpfVqA1Rte1utRo6U3r -Duo8/lnCn7DSVgTVVyW1+PAvgRQJDh8+iaTO3KcPpJF6ePZy1ko2LxJtkFhJYM5Y -mEhnqYA7HaS7vCSLk037JUju8scyzJJB9TYoP+2Qz83QIxdNGdSkiTCZYjYCOjxu -MZZEtMPiHEkOgBkCYZvvo9RvPCkCRBSTNRuq9PI68jJ7gBjdAgMBAAGjUDBOMB0G -A1UdDgQWBBT9y29z8eQmTlanPieiimw8XsaxMzAfBgNVHSMEGDAWgBT9y29z8eQm -TlanPieiimw8XsaxMzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA+ -xBZzTey9Z17lCaxbOt8DLdhGm37NIXxU8qjLSWsW6CfPQ47xju8aHuy0CFLZmVTl -EsWhqIAZR/JBiofD0fNMGC6w1EsT0HgtPQsoBU40bquQ//oMNxy2gLKhGf631yDc -Hb+w7MWd1pYXAUHZP1upy+9MB4fFQEZrD8fB1mPhZBnMPzgKL/Q2EU4aUWL53Gii -3ZmxWzVcO2FNkdSoXunnzmmu94ZRliUevHRoy9iWmjJrYd7WfNdxyIBuYK8QFZ9l -VV6SfQDzPHoC39ux/AvyJ2AiUnJmGIhb7V+wtzRB328Rn5/rA2u4OJ0ZucN864Ox -zfDcM/moAoyTj0uE8EJe ------END CERTIFICATE----- diff --git a/src/ota/test_files/rsa-sha1-signer.crt.pem.test b/src/ota/test_files/rsa-sha1-signer.crt.pem.test deleted file mode 100644 index 5449f82..0000000 --- a/src/ota/test_files/rsa-sha1-signer.crt.pem.test +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQUFADB8MQswCQYDVQQGEwJJTDEP -MA0GA1UECAwGU2hhcm9uMRAwDgYDVQQHDAdSYWFuYW5hMR8wHQYDVQQKDBZUZXhh -cyBJbnN0cnVtZW50cyBJbmMuMQwwCgYDVQQLDANSTkQxGzAZBgNVBAMMEmR1bW15 -LXJvb3QtY2EtY2VydDAeFw0xODA2MjcxOTI4NTNaFw0xOTA2MjcxOTI4NTNaMCEx -HzAdBgNVBAMMFnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQC5craIexo46oq3OTj+3fLz17MCtw/icXku8sJ16el0 -29Cibq4u8bdJeDnGlc42UySw0UlodWnzd5I52tXoXcQZs++m6uQ3JvvRHFXpNuV6 -Cyo//AdQ2MoqdKK8/pZqu4X71/xXHcIMBb3kS1RSkunJB65mPuPOfjcem6IXDtRk -E346aN6wMfeIlmwOoFK4RBoWse459ELB5aq0tSwUmHv7UcyHYQf4Cxkz5HjWfx0y -NYKCR4tPoudjg8E9R6uqik7DFlqrijNW2XdXS67d/cVToDJFn1SnYcHStARAoZUK -gP0JwXTapO31QThi9q+q63FETBcnEQ29rfmeN1/pBOI/AgMBAAGjJDAiMAsGA1Ud -DwQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzANBgkqhkiG9w0BAQUFAAOCAQEA -W29xvDV66B7NYAOSqXIG11JH+Pk2GFzZl5gNehkcDPPMHumBRNHHZqVAO4mah3Ej -StqWmTXnIs5YKX9Ro7ch3NfKHMt4/JFvR7v9VolVIVwZZB+AQU1BD8OAGlHNEq28 -TbOdkpdv9Q69W4TVsqXAkVhONekLkEJQTZyhW7db28nb/LizftfN4ps+uuE2Xl9c -YHmgWb/xqi9NIcsyQL08urJVCnyGuLQgj+GfitELFsCfc3ohhacNENsXupRIOz08 -NCa9WuCyk5uwoo6mn6JIErBMLqLTBcs82vq9d7WIFHf4QpgTs2FuelY/Hyw7HRFo -Ml3tXnR4B4lqeJy/BP6/GA== ------END CERTIFICATE----- diff --git a/src/ota/test_files/rsa-sha256-signer.crt.pem.test b/src/ota/test_files/rsa-sha256-signer.crt.pem.test deleted file mode 100644 index 24bb13b..0000000 --- a/src/ota/test_files/rsa-sha256-signer.crt.pem.test +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC6TCCAdGgAwIBAgIJAJmG5mbNWlukMA0GCSqGSIb3DQEBCwUAMCExHzAdBgNV -BAMMFnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wHhcNMTgwNjI3MjAwMDIyWhcNMTkw -NjI3MjAwMDIyWjAhMR8wHQYDVQQDDBZ0ZXN0X3NpZ25lckBhbWF6b24uY29tMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt8SVb/B4pRHAsxtK5Xcm1iBK -BIpiUc/ovUPzhGVlvkeZJfV2hrHc8PJx+XMyxp/MQGI1nr0AfHKkmAbisfU15/ta -foY1D9Skomlp+QKCK4UvJCKRl/vgdgKtZ6+vEls4tguBmt0pwQsEhNP2TDUA47uq -n7wcvgEwrrDLa9cmP7bfxRbVTWCKdchllOnRgLc05lQpRGxyMaB8zsgmx27AJlJI -rXFmnSiOKKGo6Di9/UQTLTzC+t6YfajMSpq+Fe+td7hv/vSsZT+5yLSpJDwmHTp5 -66AljEEv0vfcJ72dStacEoOKM/qX4dfQfQOF3nyeP6ofgakc+zEjncQPCoCLUQID -AQABoyQwIjALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZI -hvcNAQELBQADggEBAHjgDAj+U4SpHIaxfvKuNxxPiGnyUSWyXS2h5HiPixL85psS -k5hvbZaFJwRICSX1dU9EAf2sQN+s2MCLKPnm8vzKWLkyEUzWScr7C/mVXw8cEmdI -rd3uzsN4IThHxHiwhPXu2IjjoIjSXLHcTKyZR2uHaifXbVEEwmUimg/49of02eIa -ouLySI/+zcLgNFtTklRdSUxxGVK9y47ufiVb+sErzfDBpYx7CwZg0d+wPgfbuYE2 -8GMrCwFUbsFGMvhscPwG51rFLNonWh+ThZIwHrBwnVXmsDXayBlr6wCA50zGfBQb -SXVRXIv/SKpj1k1slnf9IJLfArH6F0Ctjcef/Aw= ------END CERTIFICATE----- diff --git a/src/ota/test_files/rsasigner.crt.test b/src/ota/test_files/rsasigner.crt.test deleted file mode 100644 index 0127c90..0000000 --- a/src/ota/test_files/rsasigner.crt.test +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC6TCCAdGgAwIBAgIJAOqQJdWUFnoVMA0GCSqGSIb3DQEBBQUAMCExHzAdBgNV -BAMMFnRlc3Rfc2lnbmVyQGFtYXpvbi5jb20wHhcNMTcxMTAzMjI0MDA0WhcNMTgx -MTAzMjI0MDA0WjAhMR8wHQYDVQQDDBZ0ZXN0X3NpZ25lckBhbWF6b24uY29tMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArgCfxgXBykjdm+MBFg9O0IDj -wCWDYMXtzA6A/kXIL7W6LuokKPZizJlV2NrZTdwqTfAx8W35F2hEBw2FYZwJn8SN -Sdk3XPGYeiM8EnnmEY/ljlPjMcx9wBghhuVb1Lau2J0kG4U9vDDqTO/4cT0FtCN1 -9KRbyBjz2C3rEmCID8qAAfr9c1HUuhwJTfIuMzqu3urSLsbnSaGRW0nvPEWhnIQw -PuzsGITvjjqpZA7W64qgM4DITPtEZs4lgBUVbrivrkSZk9hjPk1qjHRJSWrbuJTA -pPV5rdH4chkXd+q5PxECajF1FgPaRFWmz5kTZululNKJcBFFig0WHbZ4hTjQ4wID -AQABoyQwIjALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZI -hvcNAQEFBQADggEBAGI70SXBSoUYsbMHrtFd5kzCxHaB6l8sdjSZxrc6Yjy3pJcG -chhv4zjuK4IW0jWk12O73ewWbLjkvCvgsw53SvNQ/L70H4PM5fDhFmpshNaT13Wg -FZyPpaNxxTB/xSZbnCHR63JCOcDgQSv3MyVP2FSvkv4mKSxKxhE1Nwk4e3ZF4eY9 -gQnHGq5VLJyVmLZflyvfxGPaRMl8yEXZb7C3wpT30vSQjRHEFicmHHV0tBv8lqyC -Rv5ibQWUlYyk4A5L8Z8HVAi7eRcjalEvHY2JnmDcmlSYDRej9ux8CwSFBC/FzU11 -G1nWaPLiijwD+M3Ys54b9uBFcmAYNl92hNJQG1E= ------END CERTIFICATE----- diff --git a/src/ota_pal_test.cmake b/src/ota_pal_test.cmake deleted file mode 100644 index 52474b2..0000000 --- a/src/ota_pal_test.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set( OTA_PAL_TEST_SOURCES "${CMAKE_CURRENT_LIST_DIR}/ota/ota_pal_test.c" ) -set( OTA_PAL_TEST_INCLUDE_DIRS - "${CMAKE_CURRENT_LIST_DIR}/ota" - "${CMAKE_CURRENT_LIST_DIR}/common" ) diff --git a/src/qualification_test.c b/src/qualification_test.c index 58839a7..6036783 100644 --- a/src/qualification_test.c +++ b/src/qualification_test.c @@ -32,10 +32,6 @@ extern int RunDeviceAdvisorDemo( void ); #endif -#if ( OTA_E2E_TEST_ENABLED == 1) - extern int RunOtaE2eDemo( void ); -#endif - #if ( TRANSPORT_INTERFACE_TEST_ENABLED == 1 ) #include "transport_interface_test.h" #endif @@ -44,10 +40,6 @@ #include "mqtt_test.h" #endif -#if ( OTA_PAL_TEST_ENABLED == 1 ) - #include "ota_pal_test.h" -#endif - #if ( CORE_PKCS11_TEST_ENABLED == 1 ) #include "core_pkcs11_test.h" #endif @@ -66,10 +58,6 @@ void RunQualificationTest( void ) RunDeviceAdvisorDemo(); #endif - #if ( OTA_E2E_TEST_ENABLED == 1) - RunOtaE2eDemo(); - #endif - #if ( TRANSPORT_INTERFACE_TEST_ENABLED == 1 ) RunTransportInterfaceTest(); #endif @@ -78,10 +66,6 @@ void RunQualificationTest( void ) RunMqttTest(); #endif - #if ( OTA_PAL_TEST_ENABLED == 1 ) - RunOtaPalTest(); - #endif - #if ( CORE_PKCS11_TEST_ENABLED == 1 ) RunPkcs11Test(); #endif