blob: 1905070060fd87c64581b8cbdebc21870a6c28e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
#include "tls_test_frame.h"
extern TLS_TEST_SEMAPHORE* semaphore_echo_server_prepared;
/* Openssl echo server entry. */
INT openssl_echo_server_entry(TLS_TEST_INSTANCE* instance_ptr)
{
#if !defined(NX_SECURE_TLS_CLIENT_DISABLED) && defined(NX_SECURE_ENABLE_DTLS)
INT status, exit_status;
/* Added -rev option to send reverse text received from clients back to the client. Added -naccept 1 to close the server after one tls session. */
CHAR* external_cmd[] = { "openssl_echo_server.sh", "../key.pem", "../cert.pem", "-port", DEVICE_SERVER_PORT_STRING, "-dtls1_2", (CHAR*)NULL};
/* Post the semaphore to notify that the reverse echo server is prepared. */
tls_test_semaphore_post(semaphore_echo_server_prepared);
/* Launch the openssl server. */
tls_test_launch_external_test_process(&exit_status, external_cmd);
#if 0 /* openssl exit with 0 no matter TLS session is established or not. */
/* Check for the exit status of external program. */
return_value_if_fail(0 == exit_status, TLS_TEST_INSTANCE_EXTERNAL_PROGRAM_FAILED);
#endif
return TLS_TEST_SUCCESS;
#else /* ifndef NX_SECURE_TLS_CLIENT_DISABLED */
return TLS_TEST_NOT_AVAILABLE;
#endif /* ifndef NX_SECURE_TLS_CLIENT_DISABLED */
}
|