Jens Wiklander | 2932647 | 2018-04-20 11:22:15 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* Copyright (c) 2018, Linaro Limited */ |
| 3 | |
| 4 | #include "xtest_test.h" |
| 5 | #include "xtest_helpers.h" |
| 6 | |
| 7 | #include <ta_crypt.h> |
| 8 | #include <tee_api_types.h> |
| 9 | #include <compiler.h> |
| 10 | |
| 11 | static void test_8101(ADBG_Case_t *c __maybe_unused) |
| 12 | { |
| 13 | #ifdef CFG_TA_MBEDTLS_SELF_TEST |
| 14 | TEEC_Session session = { 0 }; |
| 15 | uint32_t ret_orig; |
| 16 | |
| 17 | if (!ADBG_EXPECT_TEEC_SUCCESS(c, xtest_teec_open_session( |
| 18 | &session, &crypt_user_ta_uuid, |
| 19 | NULL, &ret_orig))) |
| 20 | return; |
| 21 | ADBG_EXPECT_TEEC_SUCCESS(c, |
| 22 | TEEC_InvokeCommand(&session, TA_CRYPT_CMD_MBEDTLS_SELF_TESTS, |
| 23 | NULL, &ret_orig)); |
| 24 | TEEC_CloseSession(&session); |
| 25 | #else |
| 26 | Do_ADBG_Log("CFG_TA_MBEDTLS_SELF_TEST not set, test skipped"); |
| 27 | #endif |
| 28 | } |
| 29 | ADBG_CASE_DEFINE(regression, 8101, test_8101, "TA mbedTLS self tests"); |