Skip to content

Commit 190eb9a

Browse files
author
Arto Kinnunen
committed
Merge remote-tracking branch 'upstream/mbed-os-5.15' into feature-wisun
* upstream/mbed-os-5.15: (45 commits) Revert "Backport ARMmbed#12603: Add CYSBSYSKIT_01" Update STM32 EMAC driver based on review Update STM32 EMAC driver - limit RX frame length WHD: Remove an assert from get_rssi() crypto: Use updated ECC curve macros crypto: Update the service for Mbed Crypto 3.x crypto: Upgrade to Mbed Crypto 3.1.0 tls: Upgrade to Mbed TLS 2.20.0 Backport ARMmbed#12701: Custom BT Firmware for CYW9P62S1_43012EVB_01 Backport ARMmbed#12603: Add CYSBSYSKIT_01 Backport ARMmbed#12492: Update psoc6cm0p to version 1.1.1. Backport ARMmbed#12422: Cypress Asset Update Backport ARMmbed#12421: Cypress target reorganization Backport ARMmbed#12394: Fix Cypress 1M SDIO + other minor bugs Backport ARMmbed#12097: Cypress: Fix IAR Warnings Backport ARMmbed#12052: Fix for ARM issue 11859. Backport ARMmbed#12038: Remove qspi_frequency() call. Backport ARMmbed#12019: rework cypress lptimer hal Cellular: ALT1250 PPP cellular driver for mbed-os 5.15 RZ_A1H and GR_LYCHEE: Enable bootloader support (Mbed OS 5.15) ...
2 parents 04dacfa + 565ab14 commit 190eb9a

File tree

514 files changed

+42780
-20242
lines changed

Some content is hidden

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

514 files changed

+42780
-20242
lines changed

TESTS/mbed-crypto/sanity/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ void test_crypto_asymmetric_sign_verify(void)
262262
psa_set_key_algorithm(&attributes, alg);
263263
psa_set_key_type(&attributes, key_type);
264264
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_import_key(&attributes, key, sizeof(key), &key_handle));
265-
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_asymmetric_sign(key_handle, alg, input, sizeof(input),
266-
signature, sizeof(signature), &signature_len));
265+
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_sign_hash(key_handle, alg, input, sizeof(input),
266+
signature, sizeof(signature), &signature_len));
267267
TEST_ASSERT_EQUAL(sizeof(signature), signature_len);
268268
TEST_ASSERT_EQUAL_HEX8_ARRAY(expected_signature, signature, signature_len);
269269

270-
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_asymmetric_verify(key_handle, alg, input, sizeof(input),
271-
signature, signature_len));
270+
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_verify_hash(key_handle, alg, input, sizeof(input),
271+
signature, signature_len));
272272
TEST_ASSERT_EQUAL(PSA_SUCCESS, psa_destroy_key(key_handle));
273273
}
274274

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i
133133
serial_set_flow_control_direct(&serial, FlowControlRTSCTS, &pinmap);
134134
#else
135135
//skip this test case if static pinmap is not supported
136+
// Cleanup uart to be able execute next test case
137+
serial_free(&serial);
138+
tester.reset();
136139
return;
137140
#endif
138141
} else {

TESTS/mbedtls/multi/main.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
using namespace utest::v1;
3434

3535
#if defined(MBEDTLS_SHA256_C)
36-
/* Tests several call to mbedtls_sha256_update function that are not modulo 64 bytes */
36+
/* Tests several call to mbedtls_sha256_update_ret function that are not modulo 64 bytes */
3737
void test_case_sha256_split()
3838
{
3939
const unsigned char test_buf[] = {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqabcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqabcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"};
@@ -50,18 +50,18 @@ void test_case_sha256_split()
5050
mbedtls_sha256_context ctx;
5151
printf("test sha256\n");
5252
mbedtls_sha256_init(&ctx);
53-
mbedtls_sha256_starts(&ctx, 0);
53+
(void)mbedtls_sha256_starts_ret(&ctx, 0);
5454
#if 0
5555
printf("test not splitted\n");
56-
mbedtls_sha256_update(&ctx, test_buf, 168);
56+
(void)mbedtls_sha256_update_ret(&ctx, test_buf, 168);
5757
#else
5858
printf("test splitted into 3 pieces\n");
59-
mbedtls_sha256_update(&ctx, test_buf, 2);
60-
mbedtls_sha256_update(&ctx, test_buf + 2, 66);
61-
mbedtls_sha256_update(&ctx, test_buf + 68, 100);
59+
(void)mbedtls_sha256_update_ret(&ctx, test_buf, 2);
60+
(void)mbedtls_sha256_update_ret(&ctx, test_buf + 2, 66);
61+
(void)mbedtls_sha256_update_ret(&ctx, test_buf + 68, 100);
6262
#endif
6363

64-
mbedtls_sha256_finish(&ctx, outsum);
64+
(void)mbedtls_sha256_finish_ret(&ctx, outsum);
6565
mbedtls_sha256_free(&ctx);
6666

6767
printf("\nreceived result : ");
@@ -113,29 +113,29 @@ void test_case_sha256_multi()
113113
mbedtls_sha256_init(&ctx2);
114114
mbedtls_sha256_init(&ctx3);
115115
//Start both contexts
116-
mbedtls_sha256_starts(&ctx1, 0);
117-
mbedtls_sha256_starts(&ctx2, 0);
116+
(void)mbedtls_sha256_starts_ret(&ctx1, 0);
117+
(void)mbedtls_sha256_starts_ret(&ctx2, 0);
118118

119119
printf("upd ctx1\n");
120-
mbedtls_sha256_update(&ctx1, test_buf, 56);
120+
(void)mbedtls_sha256_update_ret(&ctx1, test_buf, 56);
121121
printf("upd ctx2\n");
122-
mbedtls_sha256_update(&ctx2, test_buf, 66);
122+
(void)mbedtls_sha256_update_ret(&ctx2, test_buf, 66);
123123
printf("finish ctx1\n");
124-
mbedtls_sha256_finish(&ctx1, outsum1);
124+
(void)mbedtls_sha256_finish_ret(&ctx1, outsum1);
125125
printf("upd ctx2\n");
126-
mbedtls_sha256_update(&ctx2, test_buf + 66, 46);
126+
(void)mbedtls_sha256_update_ret(&ctx2, test_buf + 66, 46);
127127
printf("clone ctx2 in ctx3\n");
128128
mbedtls_sha256_clone(&ctx3, (const mbedtls_sha256_context *)&ctx2);
129129
printf("free ctx1\n");
130130
mbedtls_sha256_free(&ctx1);
131131
printf("upd ctx2\n");
132-
mbedtls_sha256_update(&ctx2, test_buf + 112, 56);
132+
(void)mbedtls_sha256_update_ret(&ctx2, test_buf + 112, 56);
133133
printf("upd ctx3 with different values than ctx2\n");
134-
mbedtls_sha256_update(&ctx3, test_buf2, 56);
134+
(void)mbedtls_sha256_update_ret(&ctx3, test_buf2, 56);
135135
printf("finish ctx2\n");
136-
mbedtls_sha256_finish(&ctx2, outsum2);
136+
(void)mbedtls_sha256_finish_ret(&ctx2, outsum2);
137137
printf("finish ctx3\n");
138-
mbedtls_sha256_finish(&ctx3, outsum3);
138+
(void)mbedtls_sha256_finish_ret(&ctx3, outsum3);
139139
printf("free ctx2\n");
140140
mbedtls_sha256_free(&ctx2);
141141
printf("free ctx3\n");

TESTS/psa/attestation/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void check_initial_attestation_get_token()
9898
TEST_ASSERT_EQUAL(status, PSA_SUCCESS);
9999
status = psa_attestation_inject_key(private_key_data,
100100
sizeof(private_key_data),
101-
PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP256R1),
101+
PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP_R1),
102102
exported,
103103
sizeof(exported),
104104
&exported_length);

TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void test_use_other_partition_key_aead(void)
348348
void test_use_other_partition_key_asymmetric_sign_verify(void)
349349
{
350350
static const psa_key_id_t key_id = 999;
351-
static const psa_key_type_t key_type = PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP256R1);
351+
static const psa_key_type_t key_type = PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP_R1);
352352
static const psa_algorithm_t key_alg = PSA_ALG_ECDSA(PSA_ALG_SHA_256);
353353
static const psa_key_usage_t key_usage = PSA_KEY_USAGE_SIGN | PSA_KEY_USAGE_VERIFY;
354354
static const size_t key_bits = 256;
@@ -373,12 +373,12 @@ void test_use_other_partition_key_asymmetric_sign_verify(void)
373373
TEST_ASSERT_NOT_EQUAL(0, key_handle);
374374

375375
/* try to asymmetric sign using the key that was created by the test partition */
376-
TEST_ASSERT_EQUAL(PSA_ERROR_INVALID_HANDLE, psa_asymmetric_sign(key_handle, key_alg, input, sizeof(input),
377-
signature, sizeof(signature), &len));
376+
TEST_ASSERT_EQUAL(PSA_ERROR_INVALID_HANDLE, psa_sign_hash(key_handle, key_alg, input, sizeof(input),
377+
signature, sizeof(signature), &len));
378378

379379
/* try to asymmetric verify using the key that was created by the test partition */
380-
TEST_ASSERT_EQUAL(PSA_ERROR_INVALID_HANDLE, psa_asymmetric_verify(key_handle, key_alg, input, sizeof(input),
381-
signature, sizeof(signature)));
380+
TEST_ASSERT_EQUAL(PSA_ERROR_INVALID_HANDLE, psa_verify_hash(key_handle, key_alg, input, sizeof(input),
381+
signature, sizeof(signature)));
382382

383383
/* via test partition - destroy the key created by the test partition */
384384
TEST_ASSERT_EQUAL(PSA_SUCCESS, test_partition_crypto_destroy_key(key_handle));

components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ t_cose_crypto_pub_key_sign(int32_t cose_alg_id,
5858
return T_COSE_ERR_NO_KID;
5959
}
6060

61-
crypto_ret = psa_asymmetric_sign(handle,
62-
PSA_ALG_DETERMINISTIC_ECDSA(PSA_ALG_SHA_256),
63-
hash_to_sign.ptr,
64-
hash_to_sign.len,
65-
signature_buffer.ptr,
66-
signature_buffer.len,
67-
&(signature->len));
61+
crypto_ret = psa_sign_hash(handle,
62+
PSA_ALG_DETERMINISTIC_ECDSA(PSA_ALG_SHA_256),
63+
hash_to_sign.ptr,
64+
hash_to_sign.len,
65+
signature_buffer.ptr,
66+
signature_buffer.len,
67+
&(signature->len));
6868

6969

7070
if (crypto_ret != PSA_SUCCESS)

components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto_keys.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,12 @@ static psa_status_t get_curve(psa_key_type_t type, enum ecc_curve_t *curve_type)
4848
{
4949
psa_ecc_curve_t curve = PSA_KEY_TYPE_GET_CURVE(type);
5050
switch (curve) {
51-
case PSA_ECC_CURVE_SECP256R1:
51+
case PSA_ECC_CURVE_SECP_R1:
5252
*curve_type = P_256;
5353
break;
54-
case PSA_ECC_CURVE_SECP384R1:
55-
*curve_type = P_384;
56-
break;
57-
case PSA_ECC_CURVE_SECP521R1:
58-
*curve_type = P_521;
59-
break;
60-
case PSA_ECC_CURVE_CURVE25519:
54+
case PSA_ECC_CURVE_MONTGOMERY:
6155
*curve_type = X25519;
6256
break;
63-
case PSA_ECC_CURVE_CURVE448:
64-
*curve_type = X448;
65-
break;
6657
default:
6758
return (PSA_ERROR_NOT_SUPPORTED);
6859
}

components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/attestation_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ attest_create_token(struct useful_buf_c *challenge,
942942

943943
/* Limitations of the current implementation:
944944
* - Token is not signed yet properly, just a fake signature is added to the
945-
* token due to lack of psa_asymmetric_sign() implementation in crypto
945+
* token due to lack of psa_sign_hash() implementation in crypto
946946
* service.
947947
*/
948948
enum psa_attest_err_t

components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/crypto_platform_spe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ typedef enum psa_sec_function_s {
8787
PSA_AEAD_FINISH,
8888
PSA_AEAD_VERIFY,
8989
PSA_AEAD_ABORT,
90-
PSA_ASYMMETRIC_SIGN,
91-
PSA_ASYMMETRIC_VERIFY,
90+
PSA_SIGN_HASH,
91+
PSA_VERIFY_HASH,
9292
PSA_ASYMMETRIC_ENCRYPT,
9393
PSA_ASYMMETRIC_DECRYPT,
9494
PSA_KEY_DERIVATION_SETUP,

components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,16 +1216,16 @@ psa_status_t psa_aead_abort(psa_aead_operation_t *operation)
12161216
return ipc_call(&operation->handle, &in_vec, 1, NULL, 0, true);
12171217
}
12181218

1219-
psa_status_t psa_asymmetric_sign(psa_key_handle_t handle,
1220-
psa_algorithm_t alg,
1221-
const uint8_t *hash,
1222-
size_t hash_length,
1223-
uint8_t *signature,
1224-
size_t signature_size,
1225-
size_t *signature_length)
1219+
psa_status_t psa_sign_hash(psa_key_handle_t handle,
1220+
psa_algorithm_t alg,
1221+
const uint8_t *hash,
1222+
size_t hash_length,
1223+
uint8_t *signature,
1224+
size_t signature_size,
1225+
size_t *signature_length)
12261226
{
12271227
psa_crypto_ipc_asymmetric_t psa_crypto_ipc = {
1228-
.func = PSA_ASYMMETRIC_SIGN,
1228+
.func = PSA_SIGN_HASH,
12291229
.handle = handle,
12301230
.alg = alg,
12311231
.input_length = 0,
@@ -1246,15 +1246,15 @@ psa_status_t psa_asymmetric_sign(psa_key_handle_t handle,
12461246
return (status);
12471247
}
12481248

1249-
psa_status_t psa_asymmetric_verify(psa_key_handle_t handle,
1250-
psa_algorithm_t alg,
1251-
const uint8_t *hash,
1252-
size_t hash_length,
1253-
const uint8_t *signature,
1254-
size_t signature_size)
1249+
psa_status_t psa_verify_hash(psa_key_handle_t handle,
1250+
psa_algorithm_t alg,
1251+
const uint8_t *hash,
1252+
size_t hash_length,
1253+
const uint8_t *signature,
1254+
size_t signature_size)
12551255
{
12561256
psa_crypto_ipc_asymmetric_t psa_crypto_ipc = {
1257-
.func = PSA_ASYMMETRIC_VERIFY,
1257+
.func = PSA_VERIFY_HASH,
12581258
.handle = handle,
12591259
.alg = alg,
12601260
.input_length = 0,

0 commit comments

Comments
 (0)