Skip to content

Commit c1486ea

Browse files
committed
Fix enum type to align with psa-arch-tests
This is related to #11256 When TARGET_PSA is enabled on Cortex-A boards, the SECURE is redeclared. So to minimize the impact we can redeclare this in val.h which is used only by Mbed. And `security_t` itself is used in mbed-os\components\TARGET_PSA\TESTS, but the SECURE string is not used. Renamed to `caller_security_t` which aligns with https://github.com/ARM-software/psa-arch-tests
1 parent 31114ba commit c1486ea

File tree

24 files changed

+33
-33
lines changed

24 files changed

+33
-33
lines changed

components/TARGET_PSA/TESTS/compliance_attestation/test_a001/test_a001.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ client_test_t test_a001_attestation_list[] = {
2929

3030
static int g_test_count = 1;
3131

32-
int32_t psa_initial_attestation_get_token_test(security_t caller)
32+
int32_t psa_initial_attestation_get_token_test(caller_security_t caller)
3333
{
3434
int num_checks = sizeof(check1)/sizeof(check1[0]);
3535
uint32_t i, status, token_size;
@@ -75,7 +75,7 @@ int32_t psa_initial_attestation_get_token_test(security_t caller)
7575
return VAL_STATUS_SUCCESS;
7676
}
7777

78-
int32_t psa_initial_attestation_get_token_size_test(security_t caller)
78+
int32_t psa_initial_attestation_get_token_size_test(caller_security_t caller)
7979
{
8080
int num_checks = sizeof(check2)/sizeof(check2[0]);
8181
uint32_t i, status, token_size;

components/TARGET_PSA/TESTS/compliance_attestation/test_a001/test_a001.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ extern val_api_t *val;
2828
extern psa_api_t *psa;
2929
extern client_test_t test_a001_attestation_list[];
3030

31-
int32_t psa_initial_attestation_get_token_test(security_t caller);
32-
int32_t psa_initial_attestation_get_token_size_test(security_t caller);
31+
int32_t psa_initial_attestation_get_token_test(caller_security_t caller);
32+
int32_t psa_initial_attestation_get_token_size_test(caller_security_t caller);
3333
#endif /* _TEST_A001_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s001/test_s001.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int32_t sst_remove_stray_uid(psa_sst_uid_t p_uid)
141141
return VAL_STATUS_SUCCESS;
142142
}
143143

144-
int32_t psa_sst_uid_not_found(security_t caller)
144+
int32_t psa_sst_uid_not_found(caller_security_t caller)
145145
{
146146
int32_t test_status;
147147
psa_sst_uid_t uid = UID_BASE_VALUE + 6;

components/TARGET_PSA/TESTS/compliance_its/test_s001/test_s001.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s001_sst_list[];
3333

34-
int32_t psa_sst_uid_not_found(security_t caller);
34+
int32_t psa_sst_uid_not_found(caller_security_t caller);
3535
#endif /* _TEST_S001_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s002/test_s002.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ client_test_t test_s002_sst_list[] = {
3535
NULL,
3636
};
3737

38-
int32_t psa_sst_update_write_once_flag_after_create(security_t caller)
38+
int32_t psa_sst_update_write_once_flag_after_create(caller_security_t caller)
3939
{
4040
uint32_t status;
4141
psa_sst_uid_t uid = UID_WRITE_ONCE_1;
@@ -84,7 +84,7 @@ int32_t psa_sst_update_write_once_flag_after_create(security_t caller)
8484
}
8585

8686

87-
int32_t psa_sst_create_with_write_once_flag(security_t caller)
87+
int32_t psa_sst_create_with_write_once_flag(caller_security_t caller)
8888
{
8989
uint32_t status;
9090
psa_sst_uid_t uid = UID_WRITE_ONCE_2;

components/TARGET_PSA/TESTS/compliance_its/test_s002/test_s002.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s002_sst_list[];
3333

34-
int32_t psa_sst_update_write_once_flag_after_create(security_t caller);
35-
int32_t psa_sst_create_with_write_once_flag(security_t caller);
34+
int32_t psa_sst_update_write_once_flag_after_create(caller_security_t caller);
35+
int32_t psa_sst_create_with_write_once_flag(caller_security_t caller);
3636
#endif /* _TEST_S002_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s003/test_s003.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static char test_desc[2][80] = {
3939
"Overload storage space\n",
4040
"Overload storage again to verify all previous UID removed\n"};
4141

42-
int32_t psa_sst_insufficient_space(security_t caller)
42+
int32_t psa_sst_insufficient_space(caller_security_t caller)
4343
{
4444
uint32_t status = PSA_SST_SUCCESS;
4545
psa_sst_uid_t uid;

components/TARGET_PSA/TESTS/compliance_its/test_s003/test_s003.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s003_sst_list[];
3333

34-
int32_t psa_sst_insufficient_space(security_t caller);
34+
int32_t psa_sst_insufficient_space(caller_security_t caller);
3535
#endif /* _TEST_S003_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s004/test_s004.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static uint8_t read_buff[TEST_BUFF_SIZE] = {0};
3737
static uint8_t write_buff[TEST_BUFF_SIZE] = {0x99, 0x01, 0x30, 0x50, 0x04, 0x23, 0xF6, 0x07, 0x08, \
3838
0x0D, 0x70, 0xA1, 0xFF, 0xFF, 0x14, 0x73, 0x46, 0x97, 0xE8, 0xDD};
3939

40-
int32_t psa_sst_get_data_check(security_t caller)
40+
int32_t psa_sst_get_data_check(caller_security_t caller)
4141
{
4242
uint32_t status,j;
4343

components/TARGET_PSA/TESTS/compliance_its/test_s004/test_s004.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s004_sst_list[];
3333

34-
int32_t psa_sst_get_data_check(security_t caller);
34+
int32_t psa_sst_get_data_check(caller_security_t caller);
3535
#endif /* _TEST_S004_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s005/test_s005.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int32_t psa_sst_apis_check(psa_sst_uid_t uid, uint32_t data_len,
6464
return VAL_STATUS_SUCCESS;
6565
}
6666

67-
int32_t psa_sst_apis_check_success_case(security_t caller)
67+
int32_t psa_sst_apis_check_success_case(caller_security_t caller)
6868
{
6969
psa_sst_uid_t uid = UID_BASE_VALUE + 4;
7070
uint32_t data_len = 0, status = VAL_STATUS_SUCCESS;

components/TARGET_PSA/TESTS/compliance_its/test_s005/test_s005.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s005_sst_list[];
3333

34-
int32_t psa_sst_apis_check_success_case(security_t caller);
34+
int32_t psa_sst_apis_check_success_case(caller_security_t caller);
3535

3636
#endif /* _TEST_S005_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s006/test_s006.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int32_t psa_sst_remove_api(psa_sst_uid_t uid, uint32_t data_len,
5353
return VAL_STATUS_SUCCESS;
5454
}
5555

56-
int32_t psa_sst_flags_not_supported(security_t caller)
56+
int32_t psa_sst_flags_not_supported(caller_security_t caller)
5757
{
5858
psa_sst_create_flags_t flag = 0x80000000;
5959
uint32_t status = VAL_STATUS_SUCCESS;

components/TARGET_PSA/TESTS/compliance_its/test_s006/test_s006.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s006_sst_list[];
3333

34-
int32_t psa_sst_flags_not_supported(security_t caller);
34+
int32_t psa_sst_flags_not_supported(caller_security_t caller);
3535

3636
#endif /* _TEST_S006_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s007/test_s007.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static uint8_t write_buff[TEST_BUFF_SIZE] = {
3737
0x70, 0xA1, 0xFF, 0xFF, 0x14, 0x73, 0x46, 0x97, 0xE8, 0xDD, 0xCA, 0x0B, 0x3C, 0x0D, 0x2E};
3838
static uint8_t read_buff[TEST_BUFF_SIZE];
3939

40-
int32_t psa_sst_get_incorrect_size(security_t caller)
40+
int32_t psa_sst_get_incorrect_size(caller_security_t caller)
4141
{
4242
psa_sst_uid_t uid = UID_BASE_VALUE + 5;
4343
uint32_t status = VAL_STATUS_SUCCESS;

components/TARGET_PSA/TESTS/compliance_its/test_s007/test_s007.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s007_sst_list[];
3333

34-
int32_t psa_sst_get_incorrect_size(security_t caller);
34+
int32_t psa_sst_get_incorrect_size(caller_security_t caller);
3535

3636
#endif /* _TEST_S007_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s008/test_s008.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static uint8_t read_buff[TEST_BUFF_SIZE];
3939
static uint8_t write_buff[TEST_BUFF_SIZE] = {0x99, 0x01, 0x02, 0x03, 0x04, 0x23, 0xF6, 0x07, 0x08, \
4040
0x0D, 0x70, 0xA1, 0xFF, 0xFF, 0x14, 0x73, 0x46, 0x97, 0xE8, 0xDD};
4141

42-
int32_t psa_sst_invalid_offset_failure(security_t caller)
42+
int32_t psa_sst_invalid_offset_failure(caller_security_t caller)
4343
{
4444
uint32_t status, j;
4545

@@ -80,7 +80,7 @@ int32_t psa_sst_invalid_offset_failure(security_t caller)
8080
return VAL_STATUS_SUCCESS;
8181
}
8282

83-
int32_t psa_sst_valid_offset_success(security_t caller)
83+
int32_t psa_sst_valid_offset_success(caller_security_t caller)
8484
{
8585
uint32_t status, data_len, offset = TEST_BUFF_SIZE;
8686

components/TARGET_PSA/TESTS/compliance_its/test_s008/test_s008.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s008_sst_list[];
3333

34-
int32_t psa_sst_valid_offset_success(security_t caller);
35-
int32_t psa_sst_invalid_offset_failure(security_t caller);
34+
int32_t psa_sst_valid_offset_success(caller_security_t caller);
35+
int32_t psa_sst_invalid_offset_failure(caller_security_t caller);
3636

3737
#endif /* _TEST_S008_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s009/test_s009.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static psa_sst_uid_t uid = UID_BASE_VALUE + 5;
3636
static uint8_t write_buff[TEST_BUFF_SIZE] = {0x99, 0x01, 0x02, 0x03, 0x04, 0x23, 0xF6, 0x07, 0x08, \
3737
0x0D, 0x70, 0xA1, 0xFF, 0xFF, 0x14, 0x73, 0x46, 0x97, 0xE8, 0xDD};
3838

39-
int32_t psa_sst_zero_length_check(security_t caller)
39+
int32_t psa_sst_zero_length_check(caller_security_t caller)
4040
{
4141
uint32_t status;
4242

components/TARGET_PSA/TESTS/compliance_its/test_s009/test_s009.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s009_sst_list[];
3333

34-
int32_t psa_sst_zero_length_check(security_t caller);
34+
int32_t psa_sst_zero_length_check(caller_security_t caller);
3535

3636
#endif /* _TEST_S009_CLIENT_TESTS_H_ */

components/TARGET_PSA/TESTS/compliance_its/test_s010/test_s010.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ client_test_t test_s010_sst_list[] = {
3434

3535
static uint8_t write_buff[TEST_BUFF_SIZE] = {0xFF};
3636

37-
int32_t psa_sst_uid_value_zero_check(security_t caller)
37+
int32_t psa_sst_uid_value_zero_check(caller_security_t caller)
3838
{
3939
int32_t status;
4040
psa_sst_uid_t uid = 0;

components/TARGET_PSA/TESTS/compliance_its/test_s010/test_s010.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ extern val_api_t *val;
3131
extern psa_api_t *psa;
3232
extern client_test_t test_s010_sst_list[];
3333

34-
int32_t psa_sst_uid_value_zero_check(security_t caller);
34+
int32_t psa_sst_uid_value_zero_check(caller_security_t caller);
3535
#endif /* _TEST_S010_CLIENT_TESTS_H_ */

features/frameworks/TARGET_PSA/val.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@
169169

170170
/* enums */
171171
typedef enum {
172-
NONSECURE = 0x0,
173-
SECURE = 0x1,
174-
} security_t;
172+
CALLER_NONSECURE = 0x0,
173+
CALLER_SECURE = 0x1,
174+
} caller_security_t;
175175

176176
typedef enum {
177177
TEST_ISOLATION_L1 = 0x1,
@@ -272,6 +272,6 @@ typedef struct {
272272
uint8_t status;
273273
} test_status_buffer_t;
274274

275-
typedef int32_t (*client_test_t)(security_t caller);
275+
typedef int32_t (*client_test_t)(caller_security_t caller);
276276
typedef int32_t (*server_test_t)(void);
277277
#endif /* VAL_COMMON_H */

features/frameworks/TARGET_PSA/val_greentea.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ val_status_t mbed_val_execute_non_secure_tests(uint32_t test_num, client_test_t
8888
}
8989

9090
/* Execute client tests */
91-
test_status = tests_list[i](NONSECURE);
91+
test_status = tests_list[i](CALLER_NONSECURE);
9292

9393
if (server_hs == TRUE)
9494
{

0 commit comments

Comments
 (0)