Gabor Toth | 70cb3c6 | 2023-05-10 12:40:24 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <app/ts-demo/ts-demo.h> |
| 8 | #include <stdio.h> |
| 9 | #include <string.h> |
| 10 | #include <unistd.h> |
| 11 | |
| 12 | #include "libpsa.h" |
| 13 | |
| 14 | int main(int argc, char *argv[]) |
| 15 | { |
| 16 | psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR; |
| 17 | const char *service_name = "sn:trustedfirmware.org:crypto:0"; |
| 18 | |
| 19 | if (argc > 1) |
| 20 | service_name = argv[1]; |
| 21 | |
| 22 | psa_status = libpsa_init_crypto_context(service_name); |
| 23 | |
| 24 | if (psa_status) { |
| 25 | printf("libpsa_init_crypto_context failed: %d\n", psa_status); |
| 26 | return psa_status; |
| 27 | } |
| 28 | |
| 29 | psa_status = run_ts_demo(true); |
| 30 | |
| 31 | libpsa_deinit_its_context(); |
| 32 | |
| 33 | if (psa_status) |
| 34 | printf("\n*** ts-demo failed ***\n\n"); |
| 35 | else |
| 36 | printf("\n*** ts-demo was successful ***\n\n"); |
| 37 | |
| 38 | return psa_status; |
| 39 | } |