Skip to content

Commit 76b2902

Browse files
authored
Merge pull request #14354 from ARMmbed/feature-tf-m-1.2-integration
Update TF-M support to v1.2
2 parents 87ceded + 62c8379 commit 76b2902

File tree

303 files changed

+8733
-5279
lines changed

Some content is hidden

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

303 files changed

+8733
-5279
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ test_suite.json
9999
DELIVERY/
100100

101101
# Directory used to clone and build TF-M
102-
features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_IGNORE/
102+
platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_IGNORE/
103+
platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/TARGET_IGNORE/
103104

104105
# CMake
105106
CMakeCache.txt

connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/ecp_alt.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,44 @@ int mbedtls_ecp_read_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
26192619
return( ret );
26202620
}
26212621

2622+
/*
2623+
* Write a private key.
2624+
*/
2625+
int mbedtls_ecp_write_key( mbedtls_ecp_keypair *key,
2626+
unsigned char *buf, size_t buflen )
2627+
{
2628+
int ret = MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE;
2629+
2630+
ECP_VALIDATE_RET( key != NULL );
2631+
ECP_VALIDATE_RET( buf != NULL );
2632+
2633+
#if defined(ECP_MONTGOMERY)
2634+
if( mbedtls_ecp_get_type( &key->grp ) == MBEDTLS_ECP_TYPE_MONTGOMERY )
2635+
{
2636+
if( key->grp.id == MBEDTLS_ECP_DP_CURVE25519 )
2637+
{
2638+
if( buflen < ECP_CURVE25519_KEY_SIZE )
2639+
return MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL;
2640+
2641+
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary_le( &key->d, buf, buflen ) );
2642+
}
2643+
else
2644+
ret = MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE;
2645+
}
2646+
2647+
#endif
2648+
#if defined(ECP_SHORTWEIERSTRASS)
2649+
if( mbedtls_ecp_get_type( &key->grp ) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS )
2650+
{
2651+
MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &key->d, buf, buflen ) );
2652+
}
2653+
2654+
#endif
2655+
cleanup:
2656+
2657+
return( ret );
2658+
}
2659+
26222660
/*
26232661
* Check a public-private key pair
26242662
*/

connectivity/mbedtls/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ target_include_directories(mbed-mbedtls
1212

1313
target_sources(mbed-mbedtls
1414
INTERFACE
15+
platform/src/hash_wrappers.c
1516
platform/src/mbed_trng.cpp
1617
platform/src/platform_alt.cpp
1718
platform/src/shared_rng.cpp
@@ -46,7 +47,6 @@ target_sources(mbed-mbedtls
4647
source/entropy_poll.c
4748
source/error.c
4849
source/gcm.c
49-
source/hash_wrappers.c
5050
source/havege.c
5151
source/hkdf.c
5252
source/hmac_drbg.c

connectivity/mbedtls/include/mbedtls/aes.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* <https://ieeexplore.ieee.org/servlet/opac?punumber=4375278>.
2121
*/
2222

23-
/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
23+
/*
24+
* Copyright The Mbed TLS Contributors
2425
* SPDX-License-Identifier: Apache-2.0
2526
*
2627
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -34,8 +35,6 @@
3435
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3536
* See the License for the specific language governing permissions and
3637
* limitations under the License.
37-
*
38-
* This file is part of Mbed TLS (https://tls.mbed.org)
3938
*/
4039

4140
#ifndef MBEDTLS_AES_H

connectivity/mbedtls/include/mbedtls/aesni.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* functions; you must not call them directly.
88
*/
99
/*
10-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
10+
* Copyright The Mbed TLS Contributors
1111
* SPDX-License-Identifier: Apache-2.0
1212
*
1313
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -21,8 +21,6 @@
2121
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2222
* See the License for the specific language governing permissions and
2323
* limitations under the License.
24-
*
25-
* This file is part of mbed TLS (https://tls.mbed.org)
2624
*/
2725
#ifndef MBEDTLS_AESNI_H
2826
#define MBEDTLS_AESNI_H

connectivity/mbedtls/include/mbedtls/arc4.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* security risk. We recommend considering stronger ciphers instead.
88
*/
99
/*
10-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
10+
* Copyright The Mbed TLS Contributors
1111
* SPDX-License-Identifier: Apache-2.0
1212
*
1313
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -22,8 +22,6 @@
2222
* See the License for the specific language governing permissions and
2323
* limitations under the License.
2424
*
25-
* This file is part of mbed TLS (https://tls.mbed.org)
26-
*
2725
*/
2826
#ifndef MBEDTLS_ARC4_H
2927
#define MBEDTLS_ARC4_H

connectivity/mbedtls/include/mbedtls/aria.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* Korean, but see http://210.104.33.10/ARIA/index-e.html in English)
1010
* and also described by the IETF in <em>RFC 5794</em>.
1111
*/
12-
/* Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
12+
/*
13+
* Copyright The Mbed TLS Contributors
1314
* SPDX-License-Identifier: Apache-2.0
1415
*
1516
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -23,8 +24,6 @@
2324
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2425
* See the License for the specific language governing permissions and
2526
* limitations under the License.
26-
*
27-
* This file is part of mbed TLS (https://tls.mbed.org)
2827
*/
2928

3029
#ifndef MBEDTLS_ARIA_H

connectivity/mbedtls/include/mbedtls/asn1.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Generic ASN.1 parsing
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_ASN1_H
2523
#define MBEDTLS_ASN1_H

connectivity/mbedtls/include/mbedtls/asn1write.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief ASN.1 buffer writing functionality
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_ASN1_WRITE_H
2523
#define MBEDTLS_ASN1_WRITE_H

connectivity/mbedtls/include/mbedtls/base64.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief RFC 1521 base64 encoding/decoding
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_BASE64_H
2523
#define MBEDTLS_BASE64_H

connectivity/mbedtls/include/mbedtls/bignum.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Multi-precision integer library
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_BIGNUM_H
2523
#define MBEDTLS_BIGNUM_H

connectivity/mbedtls/include/mbedtls/blowfish.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Blowfish block cipher
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_BLOWFISH_H
2523
#define MBEDTLS_BLOWFISH_H

connectivity/mbedtls/include/mbedtls/bn_mul.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Multi-precision integer library
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
/*
2523
* Multiply source vector [s] with b, add result

connectivity/mbedtls/include/mbedtls/camellia.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Camellia block cipher
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_CAMELLIA_H
2523
#define MBEDTLS_CAMELLIA_H

connectivity/mbedtls/include/mbedtls/ccm.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* consistent with RFC 3610.
2929
*/
3030
/*
31-
* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
31+
* Copyright The Mbed TLS Contributors
3232
* SPDX-License-Identifier: Apache-2.0
3333
*
3434
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -42,8 +42,6 @@
4242
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4343
* See the License for the specific language governing permissions and
4444
* limitations under the License.
45-
*
46-
* This file is part of Mbed TLS (https://tls.mbed.org)
4745
*/
4846

4947
#ifndef MBEDTLS_CCM_H

connectivity/mbedtls/include/mbedtls/certs.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \brief Sample certificates and DHM parameters for testing
55
*/
66
/*
7-
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7+
* Copyright The Mbed TLS Contributors
88
* SPDX-License-Identifier: Apache-2.0
99
*
1010
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -18,8 +18,6 @@
1818
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
21-
*
22-
* This file is part of mbed TLS (https://tls.mbed.org)
2321
*/
2422
#ifndef MBEDTLS_CERTS_H
2523
#define MBEDTLS_CERTS_H

connectivity/mbedtls/include/mbedtls/chacha20.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
* \author Daniel King <[email protected]>
1313
*/
1414

15-
/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
15+
/*
16+
* Copyright The Mbed TLS Contributors
1617
* SPDX-License-Identifier: Apache-2.0
1718
*
1819
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -26,8 +27,6 @@
2627
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2728
* See the License for the specific language governing permissions and
2829
* limitations under the License.
29-
*
30-
* This file is part of Mbed TLS (https://tls.mbed.org)
3130
*/
3231

3332
#ifndef MBEDTLS_CHACHA20_H

connectivity/mbedtls/include/mbedtls/chachapoly.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
* \author Daniel King <[email protected]>
1313
*/
1414

15-
/* Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
15+
/*
16+
* Copyright The Mbed TLS Contributors
1617
* SPDX-License-Identifier: Apache-2.0
1718
*
1819
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -26,8 +27,6 @@
2627
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2728
* See the License for the specific language governing permissions and
2829
* limitations under the License.
29-
*
30-
* This file is part of Mbed TLS (https://tls.mbed.org)
3130
*/
3231

3332
#ifndef MBEDTLS_CHACHAPOLY_H

0 commit comments

Comments
 (0)