psa arch test v1.4 release
diff --git a/api-specs/crypto/v1.0.1/doc/IHI0086-PSA_Cryptography_API-1.0.1.pdf b/api-specs/crypto/v1.0.1/doc/IHI0086-PSA_Cryptography_API-1.0.1.pdf
new file mode 100644
index 0000000..8c657a7
--- /dev/null
+++ b/api-specs/crypto/v1.0.1/doc/IHI0086-PSA_Cryptography_API-1.0.1.pdf
Binary files differ
diff --git a/api-tests/dev_apis/README.md b/api-tests/dev_apis/README.md
index 24a5820..30d7b3d 100644
--- a/api-tests/dev_apis/README.md
+++ b/api-tests/dev_apis/README.md
@@ -14,12 +14,12 @@
For more information on the architecture test suite framework and methodology to run the tests, refer to the [Validation Methodology](../docs/Arm_PSA_APIs_Arch_Test_Validation_Methodology.pdf) document.
## This release
- - Code Quality : REL v1.3
+ - Code Quality : REL v1.4
- This release contains following PSA Functional APIs tests: <br />
| Test Category | Specification Version |
|--------------------------|--------------------------------------|
-| Crypto | [PSA Crypto API 1.0.0](../../api-specs/crypto/v1.0.0/doc/) |
+| Crypto | [PSA Crypto API 1.0.1](../../api-specs/crypto/v1.0.1/doc/) |
| Storage (PS and ITS) | [PSA Storage API 1.0.0](../../api-specs/storage/v1.0/doc/) |
| Attestation | [PSA Attestation API 1.0.2](../../api-specs/attestation/v1.0.2/doc/) |
@@ -30,6 +30,7 @@
| Release version | Release tag | PSA Crypto API | PSA Storage API | PSA Attestation API |
|-----------------|---------------|----------------|-----------------|---------------------|
+| REL v1.4 | [v22.01_API1.4_ADAC_BETA](https://github.com/ARM-software/psa-arch-tests/tree/v22.01_API1.4_ADAC_BETA/api-tests/dev_apis) | 1.0.1 | 1.0.0 | 1.0.2 |
| REL v1.3 | [v21.10_API1.3_ADAC_ALPHA-1](https://github.com/ARM-software/psa-arch-tests/tree/v21.10_API1.3_ADAC_ALPHA-1/api-tests/dev_apis) | 1.0.0 | 1.0.0 | 1.0.2 |
| REL v1.2 | [v21.07_API1.2_ADAC_ALPHA](https://github.com/ARM-software/psa-arch-tests/tree/v21.07_API1.2_ADAC_ALPHA/api-tests/dev_apis) | 1.0.0 | 1.0.0 | 1.0.2 |
| REL v1.1 | [v20.11_API1.1](https://github.com/ARM-software/psa-arch-tests/tree/v20.11_API1.1/api-tests/dev_apis) | 1.0-Beta3 | 1.0.0 | 1.0.0 |
@@ -131,4 +132,4 @@
--------------
-*Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/api-tests/dev_apis/crypto/test_c016/test_data.h b/api-tests/dev_apis/crypto/test_c016/test_data.h
index e6c24e0..b4044f9 100644
--- a/api-tests/dev_apis/crypto/test_c016/test_data.h
+++ b/api-tests/dev_apis/crypto/test_c016/test_data.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -150,7 +150,7 @@
.expected_range = {1, BITS_TO_BYTES(MIN(PSA_EXPORT_KEY_OUTPUT_SIZE(\
PSA_KEY_TYPE_RSA_PUBLIC_KEY, 2048), \
PSA_EXPORT_PUBLIC_KEY_MAX_SIZE))},
- .expected_status = PSA_ERROR_NOT_SUPPORTED
+ .expected_status = PSA_ERROR_INVALID_ARGUMENT
},
#endif
#endif
diff --git a/api-tests/dev_apis/crypto/testsuite.db b/api-tests/dev_apis/crypto/testsuite.db
index 21a20aa..691f44a 100644
--- a/api-tests/dev_apis/crypto/testsuite.db
+++ b/api-tests/dev_apis/crypto/testsuite.db
@@ -1,5 +1,5 @@
#/** @file
-# * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+# * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
(START)
test_c001
-test_c002, failing_test
+test_c002
test_c003
test_c004
test_c005
@@ -35,7 +35,7 @@
test_c013
test_c014
test_c015
-test_c016
+test_c016, failing_test
test_c017
test_c018
test_c019
diff --git a/api-tests/docs/Arm_PSA-M_Functional_API_Test_Suite_Validation_Methodology.pdf b/api-tests/docs/Arm_PSA-M_Functional_API_Test_Suite_Validation_Methodology.pdf
index 76bdf24..6b45bfa 100644
--- a/api-tests/docs/Arm_PSA-M_Functional_API_Test_Suite_Validation_Methodology.pdf
+++ b/api-tests/docs/Arm_PSA-M_Functional_API_Test_Suite_Validation_Methodology.pdf
Binary files differ
diff --git a/api-tests/docs/sw_requirements.md b/api-tests/docs/sw_requirements.md
index 2809434..ab9db8c 100644
--- a/api-tests/docs/sw_requirements.md
+++ b/api-tests/docs/sw_requirements.md
@@ -26,7 +26,7 @@
## Download source
-To download the master branch of the repository, type the following command: <br />
+To download the main branch of the repository, type the following command: <br />
~~~
git clone https://github.com/ARM-software/psa-arch-tests.git
~~~
@@ -45,4 +45,4 @@
--------------
-*Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/api-tests/docs/test_failure_analysis.md b/api-tests/docs/test_failure_analysis.md
index 8018152..02d310e 100644
--- a/api-tests/docs/test_failure_analysis.md
+++ b/api-tests/docs/test_failure_analysis.md
@@ -3,14 +3,14 @@
This file contains list of failures identified when testing the release
on tgt_dev_apis_tfm_an521 and tgt_dev_apis_tfm_musca_b1
-targets with TFM commit Hash - dd1fe44448db0f1750794cd9cf5596033f90f6f9 (tag: TF-Mv1.4.1).
+targets with TFM commit Hash - 6fb14a14140f94150f959c88e3b880f48372da06 (tag: TF-Mv1.5.0).
The reason for each failing test is listed here in this file.
## Known Failures
| Test | Fail description | Github issue |
|------|---------------------------------------------------------------------------------| ------------ |
-|test_c002 | reference platform implementation issue | NA |
+|test_c016 | This test will pass with the mbed TLS 3.1.0, TF-M 1.5.0 is not using mbed TLS 3.1.0. So the test is failing. | https://jira.arm.com/browse/PJ03206-534 |
|test_c026 | psa_sign_message not supported | https://jira.arm.com/browse/IOTPSW-4275 |
|test_c027 | psa_mac_update not supported | https://jira.arm.com/browse/IOTPSW-4275 |
|test_c028 | PSA_KEY_USAGE_SIGN_MESSAGE not found | https://jira.arm.com/browse/IOTPSW-4275 |
@@ -35,4 +35,4 @@
--------------
-*Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/api-tests/ff/README.md b/api-tests/ff/README.md
index c09cde6..53788e9 100644
--- a/api-tests/ff/README.md
+++ b/api-tests/ff/README.md
@@ -23,13 +23,14 @@
For more information on architecture test suite specification, refer to the [Validation Methodology](../docs/Arm_PSA_APIs_Arch_Test_Validation_Methodology.pdf) document.
## This release
- - Code Quality : REL v1.3
+ - Code Quality : REL v1.4
- This release contains the PSA-FF tests that are written for the PSA FF 1.1 Extensions specification.
## Release Tags
| Release version | Release tag | PSA FF specification version |
|-----------------|---------------|----------------|
+| REL v1.4 | [v22.01_API1.4_ADAC_BETA](https://github.com/ARM-software/psa-arch-tests/tree/v22.01_API1.4_ADAC_BETA/api-tests/ff) | 1.1-Alpha0 |
| REL v1.3 | [v21.10_API1.3_ADAC_ALPHA-1](https://github.com/ARM-software/psa-arch-tests/tree/v21.10_API1.3_ADAC_ALPHA-1/api-tests/ff) | 1.1-Alpha0 |
| REL v1.2 | [v21.07_API1.2_ADAC_ALPHA](https://github.com/ARM-software/psa-arch-tests/tree/v21.07_API1.2_ADAC_ALPHA/api-tests/ff) | 1.1-Alpha0 |
| REL v1.1 | [v20.11_API1.1](https://github.com/ARM-software/psa-arch-tests/tree/v20.11_API1.1/api-tests/ff) | 1.0 |
@@ -162,4 +163,4 @@
--------------
-*Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/api-tests/ff/ipc/test_i058/test_i058.c b/api-tests/ff/ipc/test_i058/test_i058.c
index 4277a1e..012d8fb 100644
--- a/api-tests/ff/ipc/test_i058/test_i058.c
+++ b/api-tests/ff/ipc/test_i058/test_i058.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,6 +42,7 @@
val->print(PRINT_TEST,
"[Check 1] Test PSA_DOORBELL signal\n", 0);
+ psa->call(SERVER_UNSPECIFED_VERSION_HANDLE, PSA_IPC_CALL, NULL, 0, NULL, 0);
#ifndef NONSECURE_TEST_BUILD
/* Wait for doorball notification */
@@ -79,6 +80,7 @@
}
#endif
+ psa->call(SERVER_UNSPECIFED_VERSION_HANDLE, PSA_IPC_CALL, NULL, 0, NULL, 0);
return status;
}
diff --git a/api-tests/ff/ipc/test_i058/test_supp_i058.c b/api-tests/ff/ipc/test_i058/test_supp_i058.c
index f84497d..c81c95d 100644
--- a/api-tests/ff/ipc/test_i058/test_supp_i058.c
+++ b/api-tests/ff/ipc/test_i058/test_supp_i058.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,6 +38,10 @@
int32_t status = VAL_STATUS_SUCCESS;
psa_msg_t msg = {0};
+ status = val->process_call_request(SERVER_UNSPECIFED_VERSION_SIGNAL, &msg);
+ val->err_check_set(TEST_CHECKPOINT_NUM(201), status);
+ psa_reply(msg.handle, PSA_SUCCESS);
+
if (msg.client_id > 0)
{
/* Doorbell signal to client partititon */
@@ -49,7 +53,9 @@
val->print(PRINT_ERROR, "Caller is from non-secure\n", 0);
}
+ status = val->process_call_request(SERVER_UNSPECIFED_VERSION_SIGNAL, &msg);
val->err_check_set(TEST_CHECKPOINT_NUM(202), status);
+ psa_reply(msg.handle, PSA_SUCCESS);
return status;
}
diff --git a/api-tests/ff/ipc/test_i063/test_i063.c b/api-tests/ff/ipc/test_i063/test_i063.c
index 4a03410..f51d015 100644
--- a/api-tests/ff/ipc/test_i063/test_i063.c
+++ b/api-tests/ff/ipc/test_i063/test_i063.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,10 +35,12 @@
int32_t client_test_psa_wait_signal_mask(caller_security_t caller __UNUSED)
{
-
-
val->print(PRINT_TEST, "[Check 1] Test psa_wait signal mask\n", 0);
+ psa->call(SERVER_UNSPECIFED_VERSION_HANDLE, PSA_IPC_CALL, NULL, 0, NULL, 0);
+
+ psa->call(SERVER_RELAX_VERSION_HANDLE, PSA_IPC_CALL, NULL, 0, NULL, 0);
+
return VAL_STATUS_SUCCESS;
}
diff --git a/api-tests/ff/ipc/test_i072/test_i072.c b/api-tests/ff/ipc/test_i072/test_i072.c
index 9f09884..96ebece 100644
--- a/api-tests/ff/ipc/test_i072/test_i072.c
+++ b/api-tests/ff/ipc/test_i072/test_i072.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,7 +98,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -196,7 +196,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i073/test_i073.c b/api-tests/ff/ipc/test_i073/test_i073.c
index b3891b5..886a52c 100644
--- a/api-tests/ff/ipc/test_i073/test_i073.c
+++ b/api-tests/ff/ipc/test_i073/test_i073.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,7 +98,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -196,7 +196,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i074/test_i074.c b/api-tests/ff/ipc/test_i074/test_i074.c
index 6042bb6..66d52a2 100644
--- a/api-tests/ff/ipc/test_i074/test_i074.c
+++ b/api-tests/ff/ipc/test_i074/test_i074.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -104,7 +104,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -218,7 +218,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i075/test_i075.c b/api-tests/ff/ipc/test_i075/test_i075.c
index 5c7f4d0..fa48863 100644
--- a/api-tests/ff/ipc/test_i075/test_i075.c
+++ b/api-tests/ff/ipc/test_i075/test_i075.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,7 +98,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -196,7 +196,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i076/test_i076.c b/api-tests/ff/ipc/test_i076/test_i076.c
index b4e9a0a..6a722be 100644
--- a/api-tests/ff/ipc/test_i076/test_i076.c
+++ b/api-tests/ff/ipc/test_i076/test_i076.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -136,7 +136,7 @@
NULL,
};
-static int32_t get_secure_partition_address(__attribute__((unused)) psa_handle_t *handle,
+static int32_t get_secure_partition_address(psa_handle_t *handle,
addr_t *addr,
driver_test_fn_id_t test_fn_id)
{
diff --git a/api-tests/ff/ipc/test_i083/test_i083.c b/api-tests/ff/ipc/test_i083/test_i083.c
index 8c1bd7f..2ba5073 100644
--- a/api-tests/ff/ipc/test_i083/test_i083.c
+++ b/api-tests/ff/ipc/test_i083/test_i083.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -240,13 +240,6 @@
TEST_ISOLATION_PSA_ROT_MMIO_WR)))
return VAL_STATUS_ERROR;
- /* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_S))
- {
- val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
- return VAL_STATUS_ERROR;
- }
-
/* Write PSA RoT mmio address.
* This should generate internal fault or ignore the write.
*/
diff --git a/api-tests/ff/ipc/test_i084/test_i084.c b/api-tests/ff/ipc/test_i084/test_i084.c
index 023b88c..1b84d7c 100644
--- a/api-tests/ff/ipc/test_i084/test_i084.c
+++ b/api-tests/ff/ipc/test_i084/test_i084.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,7 +98,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -195,7 +195,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i085/test_i085.c b/api-tests/ff/ipc/test_i085/test_i085.c
index f672fdd..476b461 100644
--- a/api-tests/ff/ipc/test_i085/test_i085.c
+++ b/api-tests/ff/ipc/test_i085/test_i085.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -99,7 +99,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -196,7 +196,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i086/test_i086.c b/api-tests/ff/ipc/test_i086/test_i086.c
index 2c2fcaa..d4577d8 100644
--- a/api-tests/ff/ipc/test_i086/test_i086.c
+++ b/api-tests/ff/ipc/test_i086/test_i086.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -102,7 +102,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -215,7 +215,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/ipc/test_i087/test_i087.c b/api-tests/ff/ipc/test_i087/test_i087.c
index 864d444..1debbc0 100644
--- a/api-tests/ff/ipc/test_i087/test_i087.c
+++ b/api-tests/ff/ipc/test_i087/test_i087.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -101,7 +101,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
@@ -201,7 +201,7 @@
return VAL_STATUS_ERROR;
/* Setting boot.state before test check */
- if (val->set_boot_flag(BOOT_EXPECTED_NS))
+ if (val->set_boot_flag(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val->print(PRINT_ERROR, "\tFailed to set boot flag before check\n", 0);
return VAL_STATUS_ERROR;
diff --git a/api-tests/ff/partition/client_partition.c b/api-tests/ff/partition/client_partition.c
index ae6b40f..3cb4c51 100644
--- a/api-tests/ff/partition/client_partition.c
+++ b/api-tests/ff/partition/client_partition.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -97,7 +97,9 @@
/* Server_partition requests client to connect to SERVER_SECURE_CONNECT_ONLY_SID */
else if (signals & PSA_DOORBELL)
{
-#if STATELESS_ROT != 1
+#if STATELESS_ROT == 1
+ psa_call(SERVER_SECURE_CONNECT_ONLY_HANDLE, PSA_IPC_CALL, NULL, 0, NULL, 0);
+#else
if (psa_connect(SERVER_SECURE_CONNECT_ONLY_SID, SERVER_SECURE_CONNECT_ONLY_VERSION)
!= PSA_ERROR_CONNECTION_REFUSED)
{
diff --git a/api-tests/ff/partition/driver_partition.c b/api-tests/ff/partition/driver_partition.c
index 8823fc2..433392a 100644
--- a/api-tests/ff/partition/driver_partition.c
+++ b/api-tests/ff/partition/driver_partition.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -497,7 +497,7 @@
psa_write(msg->handle, 0, (void *) &addr, sizeof(addr_t));
/* Setting boot.state before test check */
- if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_S))
+ if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val_print_sf("\tFailed to set boot flag before check\n", 0);
psa_reply(msg->handle, -2);
@@ -553,7 +553,7 @@
psa_write(msg->handle, 0, (void *) &addr, sizeof(addr_t));
/* Setting boot.state before test check */
- if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_S))
+ if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val_print_sf("\tFailed to set boot flag before check\n", 0);
psa_reply(msg->handle, -2);
@@ -614,14 +614,14 @@
/* Send PSA RoT heap address */
psa_write(msg->handle, 0, (void *) &buffer, BUFFER_SIZE);
- psa_reply(msg->handle, PSA_SUCCESS);
/* Setting boot.state before test check */
- if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_S))
+ if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_ON_SECOND_CHECK))
{
val_print_sf("\tFailed to set boot flag before check\n", 0);
psa_reply(msg->handle, -2);
}
+ psa_reply(msg->handle, PSA_SUCCESS);
/* Process second call request */
if (VAL_ERROR(process_call_request(DRIVER_TEST_SIGNAL, msg)))
@@ -683,14 +683,14 @@
/* Send PSA RoT mmio address */
memset((uint8_t *)&psa_rot_mmio_addr, (uint8_t)DATA_VALUE, sizeof(addr_t));
psa_write(msg->handle, 0, (void *) &psa_rot_mmio_addr, sizeof(addr_t));
- psa_reply(msg->handle, PSA_SUCCESS);
/* Setting boot.state before test check */
- if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_S))
+ if (val_driver_private_set_boot_flag_fn(BOOT_EXPECTED_ON_SECOND_CHECK))
{
- val_print_sf("\tFailed to set boot flag before check\n", 0);
- psa_reply(msg->handle, -2);
+ val_print_sf("\tFailed to set boot flag before check\n", 0);
+ psa_reply(msg->handle, -2);
}
+ psa_reply(msg->handle, PSA_SUCCESS);
/* Process second call request */
if (VAL_ERROR(process_call_request(DRIVER_TEST_SIGNAL, msg)))
diff --git a/api-tests/platform/drivers/watchdog/nrf/nrf9160_wdt.c b/api-tests/platform/drivers/watchdog/nrf/nrf9160_wdt.c
index f48318f..1d6f8dd 100644
--- a/api-tests/platform/drivers/watchdog/nrf/nrf9160_wdt.c
+++ b/api-tests/platform/drivers/watchdog/nrf/nrf9160_wdt.c
@@ -25,27 +25,28 @@
/**
* @brief Watchdog Timer
*/
-struct NRF_WDT_Type { /*!< (@ 0x40018000) WDT_NS Structure */
- __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the watchdog */
+struct NRF_WDT_Type { /*!< (@ 0x40018000) WDT_NS Structure */
+ __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the watchdog */
__IM uint32_t RESERVED[31];
- __IOM uint32_t SUBSCRIBE_START; /*!< (@ 0x00000080) Subscribe configuration for task START */
+ __IOM uint32_t SUBSCRIBE_START; /*!< (@ 0x00000080) Subscribe configuration for task START */
__IM uint32_t RESERVED1[31];
- __IOM uint32_t EVENTS_TIMEOUT; /*!< (@ 0x00000100) Watchdog timeout */
+ __IOM uint32_t EVENTS_TIMEOUT; /*!< (@ 0x00000100) Watchdog timeout */
__IM uint32_t RESERVED2[31];
- __IOM uint32_t PUBLISH_TIMEOUT; /*!< (@ 0x00000180) Publish configuration for event TIMEOUT */
+ __IOM uint32_t PUBLISH_TIMEOUT; /*!< (@ 0x00000180) Publish configuration for event TIMEOUT */
__IM uint32_t RESERVED3[96];
- __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Enable interrupt */
- __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Disable interrupt */
+ __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Enable interrupt */
+ __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Disable interrupt */
__IM uint32_t RESERVED4[61];
- __IM uint32_t RUNSTATUS; /*!< (@ 0x00000400) Run status */
- __IM uint32_t REQSTATUS; /*!< (@ 0x00000404) Request status */
+ __IM uint32_t RUNSTATUS; /*!< (@ 0x00000400) Run status */
+ __IM uint32_t REQSTATUS; /*!< (@ 0x00000404) Request status */
__IM uint32_t RESERVED5[63];
- __IOM uint32_t CRV; /*!< (@ 0x00000504) Counter reload value */
- __IOM uint32_t RREN; /*!< (@ 0x00000508) Enable register for reload request registers */
- __IOM uint32_t CONFIG; /*!< (@ 0x0000050C) Configuration register */
+ __IOM uint32_t CRV; /*!< (@ 0x00000504) Counter reload value */
+ __IOM uint32_t RREN; /*!< (@ 0x00000508) Enable register for reload request registers */
+ __IOM uint32_t CONFIG; /*!< (@ 0x0000050C) Configuration register */
__IM uint32_t RESERVED6[60];
- __OM uint32_t RR[8]; /*!< (@ 0x00000600) Description collection: Reload request n */
-};
+ __OM uint32_t RR[8]; /*!< (@ 0x00000600) Description collection: Reload request n */
+};
+
/* Register: WDT_CONFIG */
/* Description: Configuration register */
@@ -56,7 +57,8 @@
/* Register: WDT_RUNSTATUS */
/* Description: Run status */
#define WDT_RUNSTATUS_RUNSTATUSWDT_Pos (0UL) /*!< Position of RUNSTATUSWDT field. */
-#define WDT_RUNSTATUS_RUNSTATUSWDT_Msk (0x1UL << WDT_RUNSTATUS_RUNSTATUSWDT_Pos) /*!< Bit mask of RUNSTATUSWDT field. */
+ /*!< Bit mask of RUNSTATUSWDT field. */
+#define WDT_RUNSTATUS_RUNSTATUSWDT_Msk (0x1UL << WDT_RUNSTATUS_RUNSTATUSWDT_Pos)
#define WDT_RUNSTATUS_RUNSTATUSWDT_NotRunning (0UL) /*!< Watchdog is not running */
#define WDT_RUNSTATUS_RUNSTATUSWDT_Running (1UL) /*!< Watchdog is running */
@@ -68,7 +70,7 @@
**/
int nrf_wdt_init(addr_t base_addr, uint32_t time_us)
{
- struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type*)base_addr;
+ struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type *)base_addr;
/* The FF framework is written with the assumption that the watchdog timer
* can be stopped and reconfigured, but this is not possible on the nRF91.
@@ -108,8 +110,7 @@
**/
int nrf_wdt_enable(addr_t base_addr)
{
- struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type*)base_addr;
-
+ struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type *)base_addr;
if (!nrf_wdt_is_enabled(base_addr)) {
nrf_wdt->TASKS_START = 0x01UL; // Trigger start task
} else {
@@ -130,7 +131,7 @@
**/
int nrf_wdt_disable(addr_t base_addr)
{
- struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type*)base_addr;
+ struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type *)base_addr;
/* As the nRF91 WDT cannot be stopped, the timer will be reloaded to the
* value in the CRV register. This should work in all cases, as the timer
@@ -152,6 +153,6 @@
**/
int nrf_wdt_is_enabled(addr_t base_addr)
{
- struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type*)base_addr;
+ struct NRF_WDT_Type *nrf_wdt = (struct NRF_WDT_Type *)base_addr;
return (nrf_wdt->RUNSTATUS & WDT_RUNSTATUS_RUNSTATUSWDT_Msk);
}
diff --git a/api-tests/val/common/val.h b/api-tests/val/common/val.h
index 88bab7b..d93c649 100644
--- a/api-tests/val/common/val.h
+++ b/api-tests/val/common/val.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -213,6 +213,10 @@
* re-enter the same test and continue executing the same check function
*/
BOOT_EXPECTED_CONT_TEST_EXEC = 0x7,
+ /* Test expects reboot for secure/non-secure on second check of test . If reboot happens,
+ * re-enter the same test and execute the next check function
+ */
+ BOOT_EXPECTED_ON_SECOND_CHECK = 0x8,
} boot_state_t;
typedef enum {
diff --git a/api-tests/val/nspe/val_entry.h b/api-tests/val/nspe/val_entry.h
index 79646b9..c04c4d1 100644
--- a/api-tests/val/nspe/val_entry.h
+++ b/api-tests/val/nspe/val_entry.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
#include "val_framework.h"
#define PSA_ACS_MAJOR_VER 1
-#define PSA_ACS_MINOR_VER 3
+#define PSA_ACS_MINOR_VER 4
/**
@brief - PSA Test Suite C main function, does VAL init and calls test dispatcher
diff --git a/api-tests/val/nspe/val_framework.c b/api-tests/val/nspe/val_framework.c
index ec6b1cc..54e5dbd 100644
--- a/api-tests/val/nspe/val_framework.c
+++ b/api-tests/val/nspe/val_framework.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -122,7 +122,8 @@
}
if (boot.state == BOOT_NOT_EXPECTED || boot.state == BOOT_EXPECTED_REENTER_TEST
- || boot.state == BOOT_EXPECTED_CONT_TEST_EXEC)
+ || boot.state == BOOT_EXPECTED_CONT_TEST_EXEC
+ || boot.state == BOOT_EXPECTED_ON_SECOND_CHECK)
{
while (tests_list[i] != NULL)
{
@@ -131,6 +132,7 @@
* consider previous run pass and jump to second test function
* of the same test if available.
*/
+
if ((boot.state == BOOT_EXPECTED_REENTER_TEST) && (i == 1))
{
val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
@@ -138,6 +140,13 @@
continue;
}
+ if ((boot.state == BOOT_EXPECTED_ON_SECOND_CHECK) && (i == 1))
+ {
+ val_print(PRINT_DEBUG, "[Check 2] PASSED\n", 0);
+ i = i + 2 ;
+ continue;
+ }
+
if (boot.state != BOOT_EXPECTED_CONT_TEST_EXEC)
{
status = val_set_boot_flag(BOOT_NOT_EXPECTED);
@@ -257,6 +266,12 @@
val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
}
+ if (boot.state == BOOT_EXPECTED_ON_SECOND_CHECK)
+ {
+ test_info.block_num = test_info.block_num + 2;
+ val_print(PRINT_DEBUG, "[Check 2] PASSED\n", 0);
+ }
+
status = val_set_boot_flag(BOOT_NOT_EXPECTED);
if (VAL_ERROR(status))
{
@@ -589,7 +604,8 @@
BOOT_EXPECTED_S,
BOOT_EXPECTED_BUT_FAILED,
BOOT_EXPECTED_REENTER_TEST,
- BOOT_EXPECTED_CONT_TEST_EXEC
+ BOOT_EXPECTED_CONT_TEST_EXEC,
+ BOOT_EXPECTED_ON_SECOND_CHECK
};
status = val_get_boot_flag(&boot.state);
diff --git a/secure-debug/CMakeLists.txt b/secure-debug/CMakeLists.txt
index 85d3a42..d8e3c5c 100644
--- a/secure-debug/CMakeLists.txt
+++ b/secure-debug/CMakeLists.txt
@@ -1,5 +1,5 @@
#/** @file
-# * Copyright (c) 2021, Arm Limited or its affiliates. All rights reserved.
+# * Copyright (c) 2021-2022, Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,19 +27,17 @@
include(${PSA_ROOT_DIR}/tools/cmake/common/Utils.cmake)
set(CMAKE_C_STANDARD 99)
-set(CMAKE_C_EXTENSIONS Off)
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_EXTENSIONS Off)
-if(DEFINED RDDI_LIB)
- if(WIN32)
- set(DEPENDS_LIB_PATH ${CMAKE_SOURCE_DIR}/depends/rddi/win_32-x86_64)
- else()
- set(DEPENDS_LIB_PATH ${CMAKE_SOURCE_DIR}/depends/rddi/linux-x86_64)
- endif()
+# Check for LINK_LAYER
+if(NOT DEFINED LINK_LAYER_COMM)
+ set(LINK_LAYER_COMM unix_socket)
+ message(STATUS "[PSA] : Link layer not specified. Defaulting to ${LINK_LAYER_COMM}")
endif()
-set(DEPENDS_INC_PATH ${CMAKE_SOURCE_DIR}/platform/hosts/${TARGET}/include)
+set(DEPENDS_INC_PATH ${CMAKE_SOURCE_DIR}/platform/hosts/${TARGET}/${LINK_LAYER_COMM}/include)
+if (NOT EXISTS ${DEPENDS_INC_PATH})
+ Message(FATAL_ERROR "Link layer ${LINK_LAYER_COMM} not supported for target ${TARGET}.")
+endif()
if(NOT DEFINED PSA_ADAC_ROOT)
get_filename_component(PSA_ADAC_ROOT ${CMAKE_SOURCE_DIR}/psa-adac ABSOLUTE)
@@ -95,6 +93,7 @@
message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DTARGET=${TARGET}, supported targets are : ${PSA_TARGET_LIST}")
else()
message(STATUS "[PSA] : TARGET is set to ${TARGET}")
+ message(STATUS "[PSA] : LINK_LAYER is set to ${LINK_LAYER_COMM}")
endif()
# Check for the presence of required test suite directories
@@ -188,13 +187,8 @@
# Build PAL LIB
include(${CMAKE_SOURCE_DIR}/platform/common/pal.cmake)
-if(DEFINED RDDI_LIB)
- add_subdirectory(${CMAKE_SOURCE_DIR}/platform/csapbcom)
- set(ADAC_HOST_PAL_LIB csapbcom)
-else()
- add_subdirectory(${CMAKE_SOURCE_DIR}/platform/hosts/${TARGET} platform_stdc)
- target_link_libraries(${ADAC_HOST_PAL_LIB} platform_stdc)
-endif()
+add_subdirectory(${CMAKE_SOURCE_DIR}/platform/hosts/${TARGET}/${LINK_LAYER_COMM} platform_host)
+target_link_libraries(${ADAC_HOST_PAL_LIB} platform_host)
# Generate VAL LIB
include(${CMAKE_SOURCE_DIR}/val/val.cmake)
diff --git a/secure-debug/README.md b/secure-debug/README.md
index 3853c24..2cbc8bb 100644
--- a/secure-debug/README.md
+++ b/secure-debug/README.md
@@ -9,16 +9,18 @@
### ADAC test suite
-The ADAC test suite checks if a device-side implementation conforms to the behavior described in the ADAC specification. The tests are self-checking, portable C-based tests with directed stimulus. The tests are expected to run on the host platform only. The tests drive the commands from the host platform through the debug link and verify the response obtained from the target platform.
-
-The tests are available as open source. The tests and the corresponding abstraction layers are available with an Apache v2.0 license allowing for external contribution.
+The ADAC test suite checks if a device-side implementation conforms to the behavior described in the ADAC specification. The tests:
+ - Are self-checking and portable, written in C with directed stimulus.
+ - Are expected to run on the host platform only.
+ - Drive the commands from the host platform through the debug link and verify the response obtained from the target platform.
+ - Are available as open source.
+ - And the corresponding abstraction layers are available with an Apache v2.0 license allowing for external contribution.
## Release details
- - Release Version - 0.6
- - Code Quality: Alpha <br />
- The suite is in development. This indicates that the suite contains tests that have not been validated on any hardware platform. You can suggest enhancements and point out errors.
+ - Release Version - 0.8
+ - Code Quality: Beta <br/>
- - The ADAC tests are written for version Beta of the ADAC specification.
+ - The ADAC tests are written for version beta of the ADAC specification.
- This test suite is not a substitute for design verification.
## Layers
@@ -32,19 +34,19 @@
The abstraction layers provide platform information and runtime environment to enable execution of the tests.
-In this release, PAL implementation uses Unix sockets as the link layer for sending commands and receiving responses.
+In this release, PAL implementation for the 'emulation' target uses Unix sockets as the link layer to send commands and receive responses. Arm also provides support for executing the test suite on the 'Musca-b1' hardware board by adding a 'musca_b1' target which uses memory window protocol as the link layer.
-You can also write your own abstraction layer implementations to allow ADAC tests to be run in other host platforms and support the debug link layer.
+You can also write your own abstraction layer implementations to allow ADAC tests to run on other host platforms and support the debug link layer.
## Scenarios
-The mapping of the rules in the specification to the test cases and the steps followed in the tests are mentioned in the [Scenario document](docs/psa_adac_scenarios.md) present in the docs/ folder.
+The mapping of the rules to the test cases and the steps followed in the tests are mentioned in the [Scenario document](docs/psa_adac_scenarios.md) present in the docs/ folder.
## Getting started
-Follow the instructions in the subsequent sections to get a copy of the source code on your local machine and build the tests. <br />
-See [Arm Authenticated Debug Access Control Test Suite User guide](docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf) document to get details on the steps involved in porting the test suite to your platform.
+Follow the instructions in the subsequent sections to get a copy of the source code on your local machine and build the tests. <br/>
+See [Arm Authenticated Debug Access Control Test Suite User guide](docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf) to get details on the steps involved in porting the test suite to your platform.
This test suite is provided as a separate directory within the psa-arch-tests repository.
### Prerequisites
@@ -54,26 +56,26 @@
- Host Operating System: Ubuntu 16.04.4, RHEL 7, Windows 10
- Scripting tools: Python 3.7.1
- Other open-source tools: GNUARM 6.3.1, GCC 5.4.0 32-Bit (Linux Host), MinGW 6.3.0 32-Bit (Windows Host)
- CMake 3.1 or later
+ CMake 3.10 or later
## Download source
-To download the master branch of the repository, type the following command:
+To download the main branch of the repository, type the following command:
git clone https://github.com/ARM-software/psa-arch-tests.git
-To download the main branch of the psa-adac repository, type the following command:
+To download the main branch of the psa-adac repository, navigate to the secure debug directory and type the following command:
git clone git@github.com:ARMmbed/psa-adac.git
Note:
- To obtain the access to the psa-adac repository and some of its dependent submodules, Arm Licensees may contact Arm through their partner managers.
+ To receive access to the psa-adac repository and some of its dependent submodules, Arm licensees may contact Arm through their partner managers.
## Porting steps
-See the [Porting Guide](docs/porting_guide_adac_host.md) document for porting steps for your host platform.
-See the [User Guide](docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf) document in the docs folder for additional details.
+See the [Porting Guide](docs/porting_guide_adac_host.md) for porting steps for your host platform.
+See the [User Guide](docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf) in the docs/ folder for additional details.
## Build steps
@@ -81,59 +83,43 @@
~~~
cd psa-arch-tests/secure-debug
git clone git@github.com:ARMmbed/psa-adac.git --recurse-submodules
- cp adac_ats_alpha1.patch psa-adac/.
+ cp psa_adac_ats.patch psa-adac/.
cd psa-adac/
- git apply adac_ats_alpha1.patch
+ git apply psa_adac_ats.patch
cd ..
mkdir <host_build_dir>
cd <host_build_dir>
- cmake ../ -G<generator-name> -DTARGET=<target-name> -DSUITE=<suite-selection>
+ cmake ../ -G<generator-name> -DTARGET=<target-name> -DSUITE=<suite-selection> -DLINK_LAYER_COMM=<link-layer>
where:
- <generator-name> "Unix Makefiles" - to generate Makefiles for Linux and Cygwin
"MinGW Makefiles" - to generate Makefiles for cmd.exe on Windows
- <target-name> target to build, as created in the platform/hosts directory
- <suite-selection> ADAC - specify the ADAC suite
+ - <link-layer> link layer for the host platform, optional for emulation target
To build project
cmake --build .
To clean
cmake --build . -- clean
-
- For example:
- cmake ../ -G"Unix Makefiles" -DTARGET=hst_sdbg_stdc -DSUITE=ADAC
- cmake --build .
~~~
Note:
- It is recommended to build different build configurations in separate directories.
+ Arm recommends running different build configurations in separate directories. Refer to the host-platform specific README for information on additional build options.
### Build output
+
The following ADAC test suite build outputs are available under host build directory, as created.
- psa_adac_test executable
- val and platform layer libraries
-## Test Suite Execution
-
-The current release provides a reference implementation of ADAC target which communicates with the host platform using Unix sockets. To execute the test suite, follow the steps below:
-
- cd psa-arch-tests/secure-debug/psa-adac
- make native
-
-To launch the target to run as a server instance, run the target executable in another terminal as shown:
-
- cd psa-arch-tests/secure-debug/psa-adac
- ./build/native/Debug/psa_adac_server coms.socket tools/test/resources/chains/chain.EcdsaP256-3
-
-To run the test suite, execute the following command from your host build directory <host_build_dir>:
-
- ./psa_adac_test ../psa-adac/tools/test/resources/keys/EcdsaP256Key-3.pem \../psa-adac/tools/test/resources/chains/chain.EcdsaP256-3 ../psa-adac/coms.socket
+For running the test suite on the emulation platform, see the [Readme](platform/hosts/emulation/unix_socket/README.md).<br/>
+For running the test suite on the Musca-b1 hardware platform, see the [Readme](platform/hosts/musca_b1/memw_pyocd/README.md).<br/>
Note:
- See the psa-adac directory for information on other target platforms.
- The keys and the certificate credentials for a supported cryptosystem can be generated using the tools provided in the psa-adac repository.
- - The test suite is designed to run once per supported cryptosystem. You must ensure that the device must be provisioned with the correct certificates installed in the device's RoT.
-
+ - The test suite is designed to run once per supported cryptosystem. Ensure that the device must be provisioned with the correct certificates installed in the device's RoT.
## Security implication
@@ -141,9 +127,8 @@
## License
-Arm ADAC Architecture test suite is distributed under Apache v2.0 License.
-The psa-adac code repository is distributed under BSD-3-Clause License.
-
+Arm ADAC Architecture test suite is distributed under Apache v2.0 license.
+The psa-adac code repository is distributed under BSD-3-Clause license.
## Feedback, contributions, and support
@@ -154,4 +139,4 @@
--------------
-*Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/secure-debug/depends/rddi/linux-x86_64/README.txt b/secure-debug/depends/rddi/linux-x86_64/README.txt
deleted file mode 100644
index 80b9a82..0000000
--- a/secure-debug/depends/rddi/linux-x86_64/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This directory should include Linux x86_64 RDDI redistributables.
-
-These can be found in:
-- <Arm DS Install Directory>/sw/debugger/RDDI/redistributables/linux-x86_64/<compiler choice>/rel/
-
-<compiler choice>: Choose a compiler which matches your host system
diff --git a/secure-debug/depends/rddi/win_32-x86_64/README.txt b/secure-debug/depends/rddi/win_32-x86_64/README.txt
deleted file mode 100644
index f78ccd8..0000000
--- a/secure-debug/depends/rddi/win_32-x86_64/README.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This directory should include Windows x86_64 RDDI redistributable and development libraries.
-
-Redistributables can be found in:
-- <Arm DS Install Directory>/sw/debugger/RDDI/redistributables/win_32-x86_64/<compiler choice>/rel/
-
-Development libraries can be found in:
-- <Arm DS Install Directory>/sw/debugger/RDDI/lib/win_32-x86_64/<compiler choice>/rel/
-
-<compiler choice>: Choose a compiler which matches your host system
- Example compilers:
- cl-16.00.40219.01 = Microsoft Visual Studio 2010
- cl-19.00.24215.1 = Microsoft Visual Studio 2015 Update 3
diff --git a/secure-debug/docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf b/secure-debug/docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf
index 0c9d96a..178d588 100644
--- a/secure-debug/docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf
+++ b/secure-debug/docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User_Guide.pdf
Binary files differ
diff --git a/secure-debug/docs/porting_guide_adac_host.md b/secure-debug/docs/porting_guide_adac_host.md
index d84c86c..ebd205b 100644
--- a/secure-debug/docs/porting_guide_adac_host.md
+++ b/secure-debug/docs/porting_guide_adac_host.md
@@ -3,7 +3,7 @@
-----------------------------------------------------
## Introduction
-The ADAC test suite contains the *Platform Abstraction Layer* (PAL) which abstracts platform-specific information from the tests. You must implement and port the PAL interface functions to your host platform.
+The ADAC test suite contains the **Platform Abstraction Layer** (PAL) which abstracts platform-specific information from the tests. You must implement and port the PAL interface functions to your host platform.
This document provides the porting steps and the list of PAL APIs.
@@ -11,19 +11,19 @@
### Adding a new target
- 1. Create a new directory in **platform/<platform_name>**. For reference, see the existing platform **hst_sdbg_stdc** directory.
- 2. Execute `cp -rf platform/hosts/hst_sdbg_stdc/ platform/hosts/<platform_name>/`.
- 3. Update **platform/<platform_name>/CMakeLists.txt** appropriately to select the correct instances of PAL files for compilation.
- 4. Refer to the **List of PAL APIs** section to view the list of PAL APIs that must be ported for your target platform. These API definitions are available in **val/include/pal_interfaces.h**. These APIs are written for the virtual target **hst_sdbg_stdc**. You can reuse the code if it works for your platform. Otherwise, you must port them for your platform-specific peripherals.
- 5. The main.c requires path to the key and certificate chain that point to the host credentials. This must be provided as command-line arguments. You can provide debug link layer specific parameters as additional command-line arguments.
- 6. If you want to use a pre-built debug communication interface, create a new directory under the depends directory and list your shared libraries within it. A placeholder for RDDI libraries is provided. You can then link these libraries to your platform.
+ 1. Create a new directory in **platform/hosts/<platform_name>**. For reference, see the existing platform **musca_b1** directory.
+ 2. Execute `cp -rf platform/hosts/musca_b1/ platform/hosts/<platform_name>/`.
+ 3. Create the link layer directory for each link layer you want to support for your platform.
+ 4. Update **platform/<platform_name>/CMakeLists.txt** appropriately to select the correct instances of PAL files for compilation.
+ 5. Port the list of PAL APIs referenced in the **List of PAL APIs** section for your target platform. These API definitions are available in **val/include/pal_interfaces.h** and are written for the hardware target **musca_b1**. You can reuse the code if it works for your platform. Otherwise, you must port them for your platform-specific peripherals.
+ 6. Provide the path to the key and certificate chain that points to the host credentials in main.c as command-line arguments. You can provide debug link layer-specific parameters as additional command-line arguments.
## List of PAL APIs
Since the test suite is agnostic to various system platforms, you must port the following PAL APIs before building the tests. Implement these functions for your host platform. <br/>
| No | Prototype | Description | Parameters |
|----|-------------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------------------------------------|
-| 01 | int pal_print(char *str, int32_t data); | Parses the input string and writes bytes into the message interface | str: Input String<br/>data: Value for format specifier<br/> |
+| 01 | int pal_print(char *str, int32_t data); | Parses the input string and writes bytes into the message interface | str: Input string<br/>data: Value for format specifier<br/> |
| 02 | int pal_system_reset(void) | Resets the system and disconnects from device | None |
| 03 | int pal_msg_interface_init(void *ctx) | Initializes the message interface for debugging information | Handle for the communication interface |
| 04 | int pal_msg_interface_free(void *ctx) | Releases the message interface | Handle for the communication interface |
@@ -31,8 +31,8 @@
| 06 | int pal_message_receive(uint8_t buffer[], size_t size)| Reads the response data from the device | buffer_ptr for payload, transfer size in bytes |
## License
-Arm PSA test suite is distributed under Apache v2.0 License.
+Arm PSA test suite is distributed under Apache v2.0 license.
--------------
-*Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2021-2022 Arm Limited and Contributors. All rights reserved.*
diff --git a/secure-debug/docs/test_failure_analysis.md b/secure-debug/docs/test_failure_analysis.md
index a1d3532..180de1d 100644
--- a/secure-debug/docs/test_failure_analysis.md
+++ b/secure-debug/docs/test_failure_analysis.md
@@ -2,9 +2,9 @@
# Test failure analysis document
-----------------------------------------------------
-This file contains list of failures identified when testing the release of Alpha1 quality ADAC Test suite.
+This file contains list of failures identified when testing the release of Beta quality ADAC Test suite.
PSA-ADAC repository commit Hash - e91ebc4c06351e860b5c50dbdc2901a8260979a1
-along with the patch file adac_ats_alpha1.patch
+along with the patch file psa_adac_ats.patch
The reason for each failing test is listed here in this file.
## Known Failures
@@ -19,4 +19,4 @@
--------------
-*Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2022 Arm Limited and Contributors. All rights reserved.*
diff --git a/secure-debug/platform/common/src/adac_packet_util.c b/secure-debug/platform/common/src/adac_packet_util.c
index d9244fb..d3095b7 100644
--- a/secure-debug/platform/common/src/adac_packet_util.c
+++ b/secure-debug/platform/common/src/adac_packet_util.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -124,11 +124,7 @@
int msg_interface_init(void *ctx, uint8_t buffer[], size_t buffer_size)
{
- if (ctx == NULL)
- return -1;
- else
- pal_msg_interface_init(ctx);
-
+ pal_msg_interface_init(ctx);
return static_buffer_msg_init(buffer, buffer_size);
}
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt b/secure-debug/platform/hosts/emulation/unix_socket/CMakeLists.txt
similarity index 63%
copy from secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt
copy to secure-debug/platform/hosts/emulation/unix_socket/CMakeLists.txt
index f462094..b89d54a 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt
+++ b/secure-debug/platform/hosts/emulation/unix_socket/CMakeLists.txt
@@ -1,5 +1,5 @@
#/** @file
-# * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+# * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,18 +16,18 @@
# Set the minimum required version of CMake for the project
cmake_minimum_required(VERSION 3.10)
-PROJECT (platform_stdc)
+PROJECT (platform_host)
include_directories(
${CMAKE_SOURCE_DIR}/platform/common/include
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
)
-add_library(platform_stdc STATIC)
-target_sources(platform_stdc PUBLIC
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/pal_interfaces.c
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/unix_msg.c
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/main.c
+add_library(platform_host STATIC)
+target_sources(platform_host PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/pal_interfaces.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/unix_msg.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
)
-target_link_libraries(platform_stdc)
+target_link_libraries(platform_host)
diff --git a/secure-debug/platform/hosts/emulation/unix_socket/README.md b/secure-debug/platform/hosts/emulation/unix_socket/README.md
new file mode 100644
index 0000000..67e1463
--- /dev/null
+++ b/secure-debug/platform/hosts/emulation/unix_socket/README.md
@@ -0,0 +1,38 @@
+
+# Verifying test suite on emulation platform
+
+## Build steps for target image
+
+To generate the target image for the virtual target, follow these steps:
+~~~
+ cd psa-arch-tests/secure-debug/psa-adac
+ make native
+~~~
+
+## Build steps for host image
+
+To build ADAC test suite, execute the following commands: <br/>
+~~~
+ cd psa-arch-tests/secure-debug
+ mkdir <host_build_dir>
+ cd <host_build_dir>
+ cmake ../ -G"Unix Makefiles" -DTARGET=emulation -DSUITE=ADAC
+ cmake --build .
+~~~
+
+## Test Suite Execution
+
+The current release provides a reference implementation of ADAC target which communicates with the host platform using Unix sockets.
+To launch the target to run as a server instance, run the target executable in another terminal as shown:
+~~~
+ cd psa-arch-tests/secure-debug/psa-adac
+ ./build/native/Debug/psa_adac_server coms.socket tools/test/resources/chains/chain.EcdsaP256-3
+~~~
+
+To run the test suite, execute the following command from your host build directory <host_build_dir>:
+~~~
+ ./psa_adac_test ../psa-adac/tools/test/resources/keys/EcdsaP256Key-3.pem \../psa-adac/tools/test/resources/chains/chain.EcdsaP256-3 ../psa-adac/coms.socket
+~~~
+--------------
+
+*Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h b/secure-debug/platform/hosts/emulation/unix_socket/include/platform.h
similarity index 93%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h
rename to secure-debug/platform/hosts/emulation/unix_socket/include/platform.h
index 2df84d9..d7f789b 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h
+++ b/secure-debug/platform/hosts/emulation/unix_socket/include/platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h b/secure-debug/platform/hosts/emulation/unix_socket/include/psa_adac_platform.h
similarity index 92%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h
rename to secure-debug/platform/hosts/emulation/unix_socket/include/psa_adac_platform.h
index 5e4e272..aaad673 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h
+++ b/secure-debug/platform/hosts/emulation/unix_socket/include/psa_adac_platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/include/unix_msg.h b/secure-debug/platform/hosts/emulation/unix_socket/include/unix_msg.h
similarity index 94%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/include/unix_msg.h
rename to secure-debug/platform/hosts/emulation/unix_socket/include/unix_msg.h
index a21a165..5b1eff7 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/include/unix_msg.h
+++ b/secure-debug/platform/hosts/emulation/unix_socket/include/unix_msg.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/src/main.c b/secure-debug/platform/hosts/emulation/unix_socket/src/main.c
similarity index 94%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/src/main.c
rename to secure-debug/platform/hosts/emulation/unix_socket/src/main.c
index cae5882..6fdc3dd 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/src/main.c
+++ b/secure-debug/platform/hosts/emulation/unix_socket/src/main.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/src/pal_interfaces.c b/secure-debug/platform/hosts/emulation/unix_socket/src/pal_interfaces.c
similarity index 95%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/src/pal_interfaces.c
rename to secure-debug/platform/hosts/emulation/unix_socket/src/pal_interfaces.c
index 5c14d08..892c76f 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/src/pal_interfaces.c
+++ b/secure-debug/platform/hosts/emulation/unix_socket/src/pal_interfaces.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/src/unix_msg.c b/secure-debug/platform/hosts/emulation/unix_socket/src/unix_msg.c
similarity index 97%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/src/unix_msg.c
rename to secure-debug/platform/hosts/emulation/unix_socket/src/unix_msg.c
index 9a6e301..3a1d3de 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/src/unix_msg.c
+++ b/secure-debug/platform/hosts/emulation/unix_socket/src/unix_msg.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt b/secure-debug/platform/hosts/musca_b1/memw_pyocd/CMakeLists.txt
similarity index 63%
rename from secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt
rename to secure-debug/platform/hosts/musca_b1/memw_pyocd/CMakeLists.txt
index f462094..631a83e 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/CMakeLists.txt
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/CMakeLists.txt
@@ -1,5 +1,5 @@
#/** @file
-# * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+# * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,18 +16,17 @@
# Set the minimum required version of CMake for the project
cmake_minimum_required(VERSION 3.10)
-PROJECT (platform_stdc)
+PROJECT (platform_host)
include_directories(
${CMAKE_SOURCE_DIR}/platform/common/include
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
)
-add_library(platform_stdc STATIC)
-target_sources(platform_stdc PUBLIC
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/pal_interfaces.c
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/unix_msg.c
- ${CMAKE_SOURCE_DIR}/platform/hosts/hst_sdbg_stdc/src/main.c
+add_library(platform_host STATIC)
+target_sources(platform_host PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/pal_interfaces.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
)
-target_link_libraries(platform_stdc)
+target_link_libraries(platform_host)
diff --git a/secure-debug/platform/hosts/musca_b1/memw_pyocd/README.md b/secure-debug/platform/hosts/musca_b1/memw_pyocd/README.md
new file mode 100644
index 0000000..7e4b0e6
--- /dev/null
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/README.md
@@ -0,0 +1,47 @@
+
+# Verifying test suite on Musca-b1 hardware platform
+
+## Prerequisites
+
+Before executing the test suite on host, ensure that the following requirements are met:
+
+- Python 3.7.1 and above with pyOCD is installed.
+- Debug probe is connected from the target to the host system using a USB cable.
+- The target image is flashed onto the board.
+
+## Build steps for target image
+
+The steps to build and flash the image for the musca-b1 hardware target are described in the psa-adac repository in ports/targets/musca-b1/README.md.
+
+## Build steps for host image
+
+To build ADAC test suite, execute the following commands: <br/>
+~~~
+ cd psa-arch-tests/secure-debug
+ mkdir <host_build_dir>
+ cd <host_build_dir>
+ cmake ../ -G"Unix Makefiles" -DTARGET=musca_b1 -DSUITE=ADAC -DLINK_LAYER_COMM=memw_pyocd
+ cmake --build .
+~~~
+
+## Test Suite Execution
+
+Arm uses UDP sockets to transmit and receive test information from the host to pyOCD. pyOCD is used for communication with the target board. The pyOCD script communicates with the board using a memory window-based debug mailbox.
+To launch the pyOCD script, run the following in another terminal as shown:
+~~~
+ cd platform/hosts/musca_b1/mem_pyocd
+ python host_connect.py <port_no>
+ where:
+ - <port_no> - The port number for communicating between host and pyOCD. Default is 7777
+~~~
+
+To run the test suite, execute the following command from your host build directory <host_build_dir>:
+~~~
+ ./psa_adac_test ../psa-adac/tools/test/resources/keys/EcdsaP256Key-3.pem \../psa-adac/tools/test/resources/chains/chain.EcdsaP256-3 <ip_address> <port_no>
+ where:
+ - <ip_address> - The IP address of the network connection running the server instance
+ - <port_no> - The port number for communicating between host and pyOCD. Default is 7777
+~~~
+--------------
+
+*Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.*
diff --git a/secure-debug/platform/hosts/musca_b1/memw_pyocd/host_connect.py b/secure-debug/platform/hosts/musca_b1/memw_pyocd/host_connect.py
new file mode 100644
index 0000000..dda9fc5
--- /dev/null
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/host_connect.py
@@ -0,0 +1,142 @@
+#!/usr/bin/python
+#/** @file
+# * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
+# * SPDX-License-Identifier : Apache-2.0
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+#**/
+
+# install pyOCD --> pip install pyocd
+# install libusb --> see https://github.com/pyocd/pyOCD#libusb-installation
+
+import socket
+import sys
+import struct
+import time
+from pyocd.core.helpers import ConnectHelper
+from pyocd.utility.conversion import byte_list_to_u32le_list
+
+class ADAC_ACS():
+ """! @brief Main class for the adac acs script, acting as bridge between acs testcases & platform"""
+
+ def __init__(self, PORT=7777):
+ self.port = PORT
+ self.host = "0.0.0.0"
+ self.target = None
+ self.base = None
+ self.reset = None
+
+ def create_server_socket(self):
+ try:
+ print("Creating server socket ipaddress : %s, port : %d\n" % (self.host, self.port))
+ self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ self.server_socket.bind((self.host, self.port))
+ except socket.error as msg:
+ print('Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1])
+ sys.exit()
+
+ def parse_uint(self, s):
+ try:
+ return int(s, 16)
+ except:
+ print('self.parse_uint error : might be the number of arg and payload bytes mismatch\n')
+ return
+
+ def receive(self):
+ while self.target.read32(self.base + 0x0) != 0xEFEFEFEF:
+ time.sleep(0.1)
+ hl = 8
+ h = self.target.read_memory_block8(self.base + 0x10, hl)
+ (_ign, head, words) = struct.unpack("<HHL", bytes(h))
+
+ data = bytes([])
+ if words > 0:
+ data = bytearray(self.target.read_memory_block8(self.base + 0x10 + hl, words << 2))
+ self.received += hl + len(data)
+ return bytes(h), bytes(data)
+
+ def connect(self):
+ print("Reset device and request Connection")
+ self.target.reset_and_halt()
+ self.target.write32(self.base + 0x0, 0xFF00FF00)
+ self.target.write32(self.base + 0x4, 0x00FF00FF)
+ self.target.write32(self.base + 0x8, 0xFF00FF00)
+ self.target.write32(self.base + 0xC, 0x00FF00FF)
+ self.target.resume()
+
+ acknowledged = False
+ s = 0.1
+ while not acknowledged:
+ time.sleep(s)
+ s *= 2
+
+ m = [self.target.read32(self.base + 0x0), self.target.read32(self.base + 0x4),
+ self.target.read32(self.base + 0x8), self.target.read32(self.base + 0xC)]
+
+ print("MUSCA_B1_SRAM_S_BASE[0]: 0x%08X (0x%08X)" % (m[0], 0x00FF00FF))
+ print("MUSCA_B1_SRAM_S_BASE[1]: 0x%08X (0x%08X)" % (m[1], 0xFF00FF00))
+ print("MUSCA_B1_SRAM_S_BASE[2]: 0x%08X (0x%08X)" % (m[2], 0x00FF00FF))
+ print("MUSCA_B1_SRAM_S_BASE[3]: 0x%08X (0x%08X)" % (m[3], 0xFF00FF00))
+ acknowledged = (m[0] == 0x00FF00FF) and (m[2] == 0x00FF00FF) and (m[3] == 0xFF00FF00)
+
+ print("Acknowledged: %s" % ("True" if acknowledged else "False"))
+
+ self.sent = 0
+ self.received = 0
+
+ def close(self):
+ self.target.write32(self.base + 0x0, 0x00000000)
+ self.target.write32(self.base + 0x4, 0x00000000)
+ self.target.write32(self.base + 0x8, 0x00000000)
+ self.target.write32(self.base + 0xC, 0x00000000)
+ return self.sent, self.received
+
+ def send(self, data):
+ self.target.write_memory_block32(self.base + 0x10, byte_list_to_u32le_list(data))
+ self.target.write32(self.base + 0x0, 0x12121212)
+ self.sent += len(data)
+
+
+if __name__ == "__main__":
+ if len(sys.argv) > 1:
+ adac_acs = ADAC_ACS(PORT=int(sys.argv[1]))
+ else:
+ adac_acs = ADAC_ACS()
+ adac_acs.create_server_socket()
+ session_args = {
+ "unique_id": None,
+ "frequency": 10000000, # 10 MHz
+ }
+
+ adac_acs.base = 0x30000000
+ session_args['connect_mode'] = "pre-reset"
+
+ while True:
+ with ConnectHelper.session_with_chosen_probe(**session_args) as session:
+ adac_acs.target = session.board.target
+ adac_acs.connect()
+ while True:
+ try:
+ data_received, address = adac_acs.server_socket.recvfrom(4096)
+ length = len(data_received)
+ print("Data received from adac acs : length : %d, data : %s"%(length, str(data_received.hex())))
+ adac_acs.send(data_received)
+ head, data = adac_acs.receive()
+ adac_acs.server_socket.sendto(head, address)
+ print("Header sent to adac acs : length : %d, data : %s"%(len(head), str(head.hex())))
+ adac_acs.server_socket.sendto(data, address)
+ print("Data sent to adac acs : length : %d, data : %s"%(len(data), str(data.hex())))
+ except Exception as e:
+ continue
+
+ adac_acs.close()
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h b/secure-debug/platform/hosts/musca_b1/memw_pyocd/include/platform.h
similarity index 79%
copy from secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h
copy to secure-debug/platform/hosts/musca_b1/memw_pyocd/include/platform.h
index 2df84d9..d390ac9 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/include/platform.h
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/include/platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +15,8 @@
* limitations under the License.
**/
-#ifndef PSA_ADAC_PLATFORM_H
-#define PSA_ADAC_PLATFORM_H
+#ifndef PSA_ADAC_HOST_PLATFORM_H
+#define PSA_ADAC_HOST_PLATFORM_H
#include <stdint.h>
#include <stddef.h>
@@ -34,4 +34,9 @@
void platform_init(void);
void psa_adac_platform_init(void);
-#endif //PSA_ADAC_PLATFORM_H
+typedef struct {
+ char *hostname;
+ int port_num;
+} udp_socket_desc_t;
+
+#endif //PSA_HOST_ADAC_PLATFORM_H
diff --git a/secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h b/secure-debug/platform/hosts/musca_b1/memw_pyocd/include/psa_adac_platform.h
similarity index 92%
copy from secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h
copy to secure-debug/platform/hosts/musca_b1/memw_pyocd/include/psa_adac_platform.h
index 5e4e272..aaad673 100644
--- a/secure-debug/platform/hosts/hst_sdbg_stdc/include/psa_adac_platform.h
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/include/psa_adac_platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/main.c b/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/main.c
new file mode 100644
index 0000000..17a92cf
--- /dev/null
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/main.c
@@ -0,0 +1,56 @@
+/** @file
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+// Client side implementation of UDP client-server model
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "pal_interfaces.h"
+#include "platform.h"
+
+#define PORT 7777
+
+int32_t val_entry(void);
+
+extern uint8_t buffer[4096];
+uint8_t buffer[4096];
+char *key_file, *chain_file;
+
+// Driver code
+int main(int argc, char *argv[])
+{
+ char *hostname;
+ int portno;
+ udp_socket_desc_t sock_desc;
+
+ if (argc < 5) {
+ printf("Usage:\n\tpsa_adac_test <keyfile> <chainfile> <hostname> <port>\n\n");
+ exit(-1);
+ }
+
+ key_file = argv[1];
+ chain_file = argv[2];
+ sock_desc.hostname = argv[3];
+ sock_desc.port_num = atoi(argv[4]);
+
+ msg_interface_init((void *) &sock_desc, buffer, sizeof(buffer));
+
+ val_entry();
+ msg_interface_free(NULL);
+
+ return 0;
+}
diff --git a/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/pal_interfaces.c b/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/pal_interfaces.c
new file mode 100644
index 0000000..3a6c4d3
--- /dev/null
+++ b/secure-debug/platform/hosts/musca_b1/memw_pyocd/src/pal_interfaces.c
@@ -0,0 +1,128 @@
+/** @file
+ * Copyright (c) 2022, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "platform.h"
+#include <pal_interfaces.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !defined(_MSC_VER)
+ #include <unistd.h>
+#else // !defined(_MSC_VER)
+ #include <io.h>
+
+ // Disable warning about POSIX function names.
+ #pragma warning(disable : 4996)
+#endif // !defined(_MSC_VER)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+#define PAL_STATUS_UNSUPPORTED_FUNC 0xFF
+
+typedef enum {
+ PAL_STATUS_SUCCESS = 0x0,
+ PAL_STATUS_ERROR = 0x80
+} pal_status_t;
+
+static int sockfd;
+static struct sockaddr_in serveraddr;
+static struct hostent *server;
+
+int pal_print(const char *str, int32_t data)
+{
+ if (printf(str, data) < 0)
+ {
+ return PAL_STATUS_ERROR;
+ }
+ return PAL_STATUS_SUCCESS;
+}
+
+void pal_terminate_simulation(void)
+{
+ ;
+}
+
+int pal_system_reset(void)
+{
+ return PAL_STATUS_UNSUPPORTED_FUNC;
+}
+
+int pal_msg_interface_init(void *ctx)
+{
+ udp_socket_desc_t *desc = NULL;
+
+ if (ctx == NULL)
+ return -1;
+ else
+ desc = (udp_socket_desc_t *)(ctx);
+
+ // Creating socket file descriptor
+ sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sockfd < 0) {
+ perror("socket creation failed");
+ exit(-1);
+ }
+
+ // gethostbyname: get the server's DNS entry
+ server = gethostbyname(desc->hostname);
+ if (server == NULL) {
+ fprintf(stderr, "ERROR, no such host as %s\n", desc->hostname);
+ exit(-1);
+ }
+
+ // Build the server's Internet address
+ bzero((char *) &serveraddr, sizeof(serveraddr));
+ serveraddr.sin_family = AF_INET;
+ bcopy((char *)server->h_addr, (char *)&serveraddr.sin_addr.s_addr, server->h_length);
+ serveraddr.sin_port = htons(desc->port_num);
+
+ return 0;
+}
+
+int pal_msg_interface_free(void *ctx)
+{
+ close(sockfd);
+ return 0;
+}
+
+int pal_message_send(uint8_t buffer[], size_t size)
+{
+ sendto(sockfd, (const char *)buffer, size, 0, (const struct sockaddr *) &serveraddr,
+ sizeof(serveraddr));
+ return (int)size;
+}
+
+int pal_message_receive(uint8_t buffer[], size_t size)
+{
+ int n = 0, len = 0;
+ do {
+ n = recvfrom(sockfd, (char *)buffer, 4096, MSG_WAITALL,
+ (struct sockaddr *) &serveraddr, &len);
+ } while (n == 0);
+
+ if (len < 0) {
+ close(sockfd);
+ exit(-1);
+ }
+ return size;
+}
+
diff --git a/secure-debug/adac_ats_alpha1.patch b/secure-debug/psa_adac_ats.patch
similarity index 100%
rename from secure-debug/adac_ats_alpha1.patch
rename to secure-debug/psa_adac_ats.patch
diff --git a/secure-debug/val/include/val_entry.h b/secure-debug/val/include/val_entry.h
index 6484dc6..4403599 100644
--- a/secure-debug/val/include/val_entry.h
+++ b/secure-debug/val/include/val_entry.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
#include "val.h"
#define PSA_ACS_MAJOR_VER 0
-#define PSA_ACS_MINOR_VER 6
+#define PSA_ACS_MINOR_VER 8
/**
@brief - PSA Test Suite C main function, does VAL init and calls test dispatcher
diff --git a/secure-debug/val/src/val_entry.c b/secure-debug/val/src/val_entry.c
index fdfbcc9..4e18c68 100644
--- a/secure-debug/val/src/val_entry.c
+++ b/secure-debug/val/src/val_entry.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,7 +40,7 @@
/* Compliance header print */
if (test_id == VAL_INVALID_TEST_ID)
{
- val_print(PRINT_ALWAYS, "\n***** PSA Architecture Test Suite - Version %d.",
+ val_print(PRINT_ALWAYS, "\n***** PSA ADAC Architecture Test Suite - Version %d.",
PSA_ACS_MAJOR_VER);
val_print(PRINT_ALWAYS, "%d *****\n", PSA_ACS_MINOR_VER);
}
@@ -55,9 +55,3 @@
return status;
}
-
-//int main()
-//{
-// val_entry();
-// return 0;
-//}