Skip to content

Commit 334e110

Browse files
authored
Merge pull request #353 from ARM-software/release
Release
2 parents dd609f3 + 0cb6224 commit 334e110

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1268
-884
lines changed

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
[submodule "secure-debug/psa-adac"]
3+
path = secure-debug/psa-adac
4+
url = https://git.trustedfirmware.org/shared/psa-adac.git
5+
[submodule "secure-debug/external/mbedtls"]
6+
path = secure-debug/external/mbedtls
7+
url = https://github.com/Mbed-TLS/mbedtls.git

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ For more information, visit the [PSA webpage](https://developer.arm.com/products
1313
API specifications are placed in [PSA API github site](https://github.com/ARM-software/psa-api/).
1414

1515
### PSA Certified API Compliance
16-
The [PSA Certified API tests](api-tests/dev_apis) are the basis for validating compliance with PSA Certified APIs. For more information on the certification program, see [psacertified.org](https://www.psacertified.org/functional-api-certification/)
16+
The [PSA Certified API tests](api-tests/dev_apis) are the basis for validating compliance with PSA Certified APIs. For more information on the certification program, see [psacertified.org](https://www.psacertified.org/functional-api-certification/)
1717

1818
## GitHub branch
1919
- For API certification, use the release branch and pick the appropriate release tag.
2020
- To get the latest version of the code with bug fixes and new features, use the master branch.
21-
21+
2222
## Architecture test suite
2323

2424
The current implementation of the Architecture test suite contains tests for following PSA Certified specifications. Arm licensees may contact their partner manager to obtain a copy of this specification. <br />
@@ -46,7 +46,7 @@ Arm PSA test suite is distributed under Apache v2.0 License.
4646
- For feedback, use the GitHub Issue Tracker that is associated with this repository.
4747
- For support, send an email to support-psa-arch-tests@arm.com with details.
4848
- Arm licensees can contact Arm directly through their partner managers.
49-
- Arm welcomes code contributions through GitHub pull requests.
49+
- Arm welcomes code contributions through GitHub pull requests.
5050

5151
--------------
5252

api-tests/dev_apis/crypto/common/test_crypto_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2020-2022, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2020-2023, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
Binary file not shown.

secure-debug/CMakeLists.txt

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
#/** @file
2-
# * Copyright (c) 2021-2022, Arm Limited or its affiliates. All rights reserved.
3-
# * SPDX-License-Identifier : Apache-2.0
4-
# *
5-
# * Licensed under the Apache License, Version 2.0 (the "License");
6-
# * you may not use this file except in compliance with the License.
7-
# * You may obtain a copy of the License at
8-
# *
9-
# * http://www.apache.org/licenses/LICENSE-2.0
10-
# *
11-
# * Unless required by applicable law or agreed to in writing, software
12-
# * distributed under the License is distributed on an "AS IS" BASIS,
13-
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# * See the License for the specific language governing permissions and
15-
# * limitations under the License.
1+
# @file
2+
# Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier : Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
1617

1718
# Set the minimum required version of CMake for the project
1819
cmake_minimum_required(VERSION 3.10)
@@ -39,6 +40,11 @@ if (NOT EXISTS ${DEPENDS_INC_PATH})
3940
Message(FATAL_ERROR "Link layer ${LINK_LAYER_COMM} not supported for target ${TARGET}.")
4041
endif()
4142

43+
set(PSA_ADAC_MBEDTLS_INCLUDE ${PSA_ROOT_DIR}/external/mbedtls/include)
44+
if (NOT EXISTS ${PSA_ADAC_MBEDTLS_INCLUDE})
45+
Message(FATAL_ERROR "Does not exist: ${PSA_ADAC_MBEDTLS_INCLUDE}")
46+
endif()
47+
4248
if(NOT DEFINED PSA_ADAC_ROOT)
4349
get_filename_component(PSA_ADAC_ROOT ${CMAKE_SOURCE_DIR}/psa-adac ABSOLUTE)
4450
endif()
@@ -49,10 +55,10 @@ include_directories (
4955
${DEPENDS_INC_PATH}
5056
${CMAKE_BINARY_DIR}
5157
${PSA_ADAC_ROOT}/psa-adac/core/include
52-
${PSA_ADAC_ROOT}/ports/include
58+
${PSA_ADAC_MBEDTLS_INCLUDE}
5359
)
5460

55-
set(MBEDTLS_CONFIG_FILE "${PSA_ADAC_ROOT}/ports/crypto/manager-crypto-config.h")
61+
set(MBEDTLS_CONFIG_FILE "${CMAKE_SOURCE_DIR}/crypto/manager-crypto-config.h")
5662
add_compile_options(-DMBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
5763
if (UNIX)
5864
add_compile_options(-fPIC -fpic)
@@ -64,7 +70,7 @@ endif ()
6470
# Generate ADAC LIB
6571
add_subdirectory(${PSA_ADAC_ROOT}/psa-adac/core adac_core)
6672
add_subdirectory(${PSA_ADAC_ROOT}/psa-adac/sdm adac_sdm)
67-
add_subdirectory(${PSA_ADAC_ROOT}/ports/crypto/psa-crypto psa_adac_psa_crypto)
73+
add_subdirectory(${CMAKE_SOURCE_DIR}/crypto/psa-crypto psa_adac_psa_crypto)
6874

6975
set(ADAC_LIBS psa_adac_sdm psa_adac_core psa_adac_psa_crypto mbedcrypto)
7076

secure-debug/README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
### ADAC Specification
77

8-
The [ADAC specification](https://developer.arm.com/documentation/den0101/0001) defines the protocol that allows a target to securely authenticate a debug host. The specification targets software-only layers that are above the physical debug link.
8+
The [ADAC specification](https://developer.arm.com/documentation/den0101/1) defines the protocol that allows a target to securely authenticate a debug host. The specification targets software-only layers that are above the physical debug link.
99

1010
### ADAC test suite
1111

@@ -17,10 +17,10 @@ The ADAC test suite checks if a device-side implementation conforms to the behav
1717
- And the corresponding abstraction layers are available with an Apache v2.0 license allowing for external contribution.
1818

1919
## Release details
20-
- Release Version - 0.8
21-
- Code Quality: Beta <br/>
20+
- Release Version - 1.0
21+
- Code Quality: EAC <br/>
2222

23-
- The ADAC tests are written for version beta of the ADAC specification.
23+
- The ADAC tests are written for EAC version of the ADAC specification.
2424
- This test suite is not a substitute for design verification.
2525

2626
## Layers
@@ -34,7 +34,7 @@ These tests are written on top of VAL and PAL.
3434

3535
The abstraction layers provide platform information and runtime environment to enable execution of the tests.
3636

37-
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.
37+
In this release, Arm 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.
3838

3939
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.
4040

@@ -46,7 +46,7 @@ The mapping of the rules to the test cases and the steps followed in the tests a
4646

4747

4848
Follow the instructions in the subsequent sections to get a copy of the source code on your local machine and build the tests. <br/>
49-
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.
49+
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 running the test suite on your platform.
5050
This test suite is provided as a separate directory within the psa-arch-tests repository.
5151

5252
### Prerequisites
@@ -60,18 +60,11 @@ Before starting the test suite build, ensure that the following requirements are
6060

6161

6262
## Download source
63+
This repository uses git submodules. Either add the --recurse-submodules argument when running git clone, or run git submodule update --init after cloning.
6364
To download the main branch of the repository, type the following command:
6465

6566
git clone https://github.com/ARM-software/psa-arch-tests.git
6667

67-
To download the main branch of the psa-adac repository, navigate to the secure debug directory and type the following command:
68-
69-
git clone git@github.com:ARMmbed/psa-adac.git
70-
71-
Note:
72-
To receive access to the psa-adac repository and some of its dependent submodules, Arm licensees may contact Arm through their partner managers.
73-
74-
7568
## Porting steps
7669

7770
See the [Porting Guide](docs/porting_guide_adac_host.md) for porting steps for your host platform.
@@ -82,10 +75,9 @@ See the [User Guide](docs/Arm_Authenticated_Debug_Access_Control_Test_Suite_User
8275
To build ADAC test suite for a given host platform, execute the following commands: <br/>
8376
~~~
8477
cd psa-arch-tests/secure-debug
85-
git clone git@github.com:ARMmbed/psa-adac.git --recurse-submodules
86-
cp psa_adac_ats.patch psa-adac/.
78+
cp psa_adac_acs_host.patch psa-adac/.
8779
cd psa-adac/
88-
git apply psa_adac_ats.patch
80+
git apply psa_adac_acs_host.patch
8981
cd ..
9082
mkdir <host_build_dir>
9183
cd <host_build_dir>
@@ -95,7 +87,7 @@ To build ADAC test suite for a given host platform, execute the following comman
9587
"MinGW Makefiles" - to generate Makefiles for cmd.exe on Windows
9688
- <target-name> target to build, as created in the platform/hosts directory
9789
- <suite-selection> ADAC - specify the ADAC suite
98-
- <link-layer> link layer for the host platform, optional for emulation target
90+
- <link-layer> "memw_pyocd" - link layer protocol used by host, more options can be specified if supported by host platform
9991
10092
To build project
10193
cmake --build .
@@ -113,12 +105,9 @@ The following ADAC test suite build outputs are available under host build direc
113105
- psa_adac_test executable
114106
- val and platform layer libraries
115107

116-
For running the test suite on the emulation platform, see the [Readme](platform/hosts/emulation/unix_socket/README.md).<br/>
117108
For running the test suite on the Musca-b1 hardware platform, see the [Readme](platform/hosts/musca_b1/memw_pyocd/README.md).<br/>
118109

119110
Note:
120-
- See the psa-adac directory for information on other target platforms.
121-
- The keys and the certificate credentials for a supported cryptosystem can be generated using the tools provided in the psa-adac repository.
122111
- 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.
123112

124113
## Security implication
@@ -129,6 +118,7 @@ ADAC test suite may run at higher privilege level. An attacker can utilize these
129118

130119
Arm ADAC Architecture test suite is distributed under Apache v2.0 license.
131120
The psa-adac code repository is distributed under BSD-3-Clause license.
121+
The mbedtls code repository is distributed under Apache v2.0 license.
132122

133123
## Feedback, contributions, and support
134124

@@ -139,4 +129,4 @@ The psa-adac code repository is distributed under BSD-3-Clause license.
139129

140130
--------------
141131

142-
*Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.*
132+
*Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.*
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/** @file
2+
* Copyright (c) 2023, Arm Limited or its affiliates. All rights reserved.
3+
* SPDX-License-Identifier : Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
**/
17+
18+
#ifndef MANAGER_CRYPTO_CONFIG_H
19+
#define MANAGER_CRYPTO_CONFIG_H
20+
21+
#include <psa_adac_config.h>
22+
23+
#define MBEDTLS_PSA_CRYPTO_C
24+
25+
/* System support */
26+
#define MBEDTLS_PLATFORM_C
27+
#define MBEDTLS_PLATFORM_MEMORY
28+
#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
29+
30+
#if defined(PSA_ADAC_RSA3072) || defined(PSA_ADAC_RSA4096)
31+
#define MBEDTLS_RSA_C
32+
#define MBEDTLS_PKCS1_V21
33+
#define MBEDTLS_OID_C
34+
#define MBEDTLS_BIGNUM_C
35+
#define MBEDTLS_GENPRIME
36+
37+
/* Support RSA key sizes up to 4096 bit */
38+
#define MBEDTLS_MPI_MAX_SIZE 512
39+
#endif
40+
41+
/* PSA ADAC */
42+
#if defined(PSA_ADAC_EC_P256) || defined(PSA_ADAC_EC_P521)
43+
#define MBEDTLS_ECDSA_C
44+
#define MBEDTLS_ECDSA_DETERMINISTIC
45+
#define MBEDTLS_ECP_C
46+
#define MBEDTLS_ASN1_PARSE_C
47+
#define MBEDTLS_ASN1_WRITE_C
48+
#define MBEDTLS_HMAC_DRBG_C
49+
#if defined(PSA_ADAC_EC_P256)
50+
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
51+
#endif
52+
#if defined(PSA_ADAC_EC_P521)
53+
#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
54+
#endif
55+
#endif
56+
57+
#ifdef PSA_ADAC_CMAC
58+
#define MBEDTLS_CMAC_C
59+
#endif
60+
61+
#ifdef PSA_ADAC_HMAC
62+
#define MBEDTLS_HKDF_C
63+
#endif
64+
65+
/* Needed by PSA Crypto API Implementation */
66+
#define MBEDTLS_CTR_DRBG_C
67+
#define MBEDTLS_ENTROPY_C
68+
#define MBEDTLS_AES_C
69+
70+
#define MBEDTLS_MD_C
71+
#define MBEDTLS_SHA256_C
72+
#define MBEDTLS_SHA512_C
73+
74+
/* Add CCM on Windows */
75+
#if defined(_MSC_VER)
76+
#define MBEDTLS_CCM_C
77+
#endif
78+
79+
/* Needed by manager */
80+
#define MBEDTLS_ASN1_PARSE_C
81+
#define MBEDTLS_ASN1_WRITE_C
82+
#define MBEDTLS_PK_WRITE_C
83+
#define MBEDTLS_PK_PARSE_C
84+
#define MBEDTLS_PK_C
85+
#define MBEDTLS_PEM_PARSE_C
86+
#define MBEDTLS_BASE64_C
87+
#define MBEDTLS_CIPHER_C
88+
#define MBEDTLS_FS_IO
89+
90+
/* Optimizations */
91+
#define MBEDTLS_AESNI_C
92+
#define MBEDTLS_HAVE_ASM
93+
94+
#include "mbedtls/check_config.h"
95+
96+
#endif /* MBEDTLS_CONFIG_BOOT_H */
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#/** @file
2+
# * Copyright (c) 2023, Arm Limited or its affiliates. All rights reserved.
3+
# * SPDX-License-Identifier : Apache-2.0
4+
# *
5+
# * Licensed under the Apache License, Version 2.0 (the "License");
6+
# * you may not use this file except in compliance with the License.
7+
# * You may obtain a copy of the License at
8+
# *
9+
# * http://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * Unless required by applicable law or agreed to in writing, software
12+
# * distributed under the License is distributed on an "AS IS" BASIS,
13+
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# * See the License for the specific language governing permissions and
15+
# * limitations under the License.
16+
#**/
17+
18+
if(NOT DEFINED SECURE_DEBUG_ROOT)
19+
get_filename_component(SECURE_DEBUG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
20+
endif()
21+
22+
include_directories(${SECURE_DEBUG_ROOT}/external/mbedtls/include)
23+
24+
set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "Disable fatal warnings" FORCE)
25+
set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable PROGRAMS" FORCE)
26+
set(ENABLE_TESTING OFF CACHE BOOL "Disable TESTING" FORCE)
27+
add_subdirectory(${SECURE_DEBUG_ROOT}/external/mbedtls mbedcrypto)
28+
29+
set_target_properties(mbedtls mbedx509 PROPERTIES
30+
EXCLUDE_FROM_ALL 1
31+
EXCLUDE_FROM_DEFAULT_BUILD 1)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# @file
2+
# Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier : Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
if(NOT DEFINED SECURE_DEBUG_ROOT)
19+
get_filename_component(SECURE_DEBUG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../.. ABSOLUTE)
20+
endif()
21+
22+
if(NOT DEFINED PSA_ADAC_ROOT)
23+
get_filename_component(PSA_ADAC_ROOT ${SECURE_DEBUG_ROOT}/psa-adac ABSOLUTE)
24+
endif()
25+
26+
include_directories(${PSA_ADAC_ROOT}/psa-adac/core/include)
27+
include(${SECURE_DEBUG_ROOT}/crypto/mbedcrypto.cmake)
28+
29+
add_library(psa_adac_psa_crypto STATIC)
30+
31+
set(PSA_CRYPTO_SRC
32+
${SECURE_DEBUG_ROOT}/crypto/psa-crypto/adac_crypto_psa.c
33+
${SECURE_DEBUG_ROOT}/crypto/psa-crypto/adac_crypto_psa_hash.c
34+
${SECURE_DEBUG_ROOT}/crypto/psa-crypto/adac_crypto_psa_mac.c
35+
${SECURE_DEBUG_ROOT}/crypto/psa-crypto/adac_crypto_psa_pk.c)
36+
37+
target_sources(psa_adac_psa_crypto PUBLIC ${PSA_CRYPTO_SRC})

0 commit comments

Comments
 (0)