Skip to content

Commit d4285b0

Browse files
committed
Implement a generic client and server. Implement wh_Port API
1 parent 2a334a3 commit d4285b0

25 files changed

+2515
-14
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Run Generic Port
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
include:
14+
- name: "Standard"
15+
flags: ""
16+
- name: "ASAN"
17+
flags: "ASAN=1"
18+
- name: "DEBUG"
19+
flags: "DEBUG=1"
20+
- name: "DEBUG ASAN"
21+
flags: "DEBUG=1 ASAN=1"
22+
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
name: Generic Port (${{ matrix.name }})
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Checkout wolfssl
31+
uses: actions/checkout@v4
32+
with:
33+
repository: wolfssl/wolfssl
34+
path: wolfssl
35+
36+
- name: Build generic server
37+
run: cd port/posix/server && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
38+
39+
- name: Build generic client
40+
run: cd port/posix/client && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl

benchmark/wh_bench.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* You should have received a copy of the GNU General Public License
1717
* along with wolfHSM. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19+
20+
#include "wolfhsm/wh_settings.h"
21+
1922
#include <stdint.h>
2023
#include <string.h> /* For memset, memcpy */
2124

@@ -25,7 +28,6 @@
2528
#include <unistd.h> /* For sleep */
2629
#endif
2730

28-
#include "wolfhsm/wh_settings.h"
2931

3032
#include "wolfhsm/wh_error.h"
3133
#include "wolfhsm/wh_comm.h"
@@ -751,6 +753,7 @@ typedef struct {
751753
int transport;
752754
} whBenchClientTaskData;
753755

756+
#if defined(WOLFHSM_CFG_ENABLE_SERVER) && defined(WOLFHSM_CFG_ENABLE_CLIENT)
754757
static void* _whBenchClientTask(void* data)
755758
{
756759
whBenchClientTaskData* taskData = (whBenchClientTaskData*)data;
@@ -838,7 +841,8 @@ static void _whBenchClientServerThreadTest(whClientConfig* c_conf,
838841
}
839842
}
840843

841-
/* Global static variables for transport configurations */
844+
/* Global static variables for transport configurations (used by
845+
* wh_Bench_ClientServer_Posix which requires both client and server) */
842846
static uint8_t g_mem_req[BUFFER_SIZE] = {0};
843847
static uint8_t g_mem_resp[BUFFER_SIZE] = {0};
844848
static whTransportMemConfig g_mem_tmcf = {
@@ -1016,7 +1020,6 @@ static int _configureServerTransport(whBenchTransportType transport,
10161020
return ret;
10171021
}
10181022

1019-
10201023
/* transport is the type of transport to use */
10211024
int wh_Bench_ClientServer_Posix(int transport, int moduleIndex)
10221025
{
@@ -1131,6 +1134,7 @@ int wh_Bench_ClientServer_Posix(int transport, int moduleIndex)
11311134

11321135
return WH_ERROR_OK;
11331136
}
1137+
#endif /* WOLFHSM_CFG_ENABLE_SERVER && WOLFHSM_CFG_ENABLE_CLIENT */
11341138

11351139

11361140
#endif /* WOLFHSM_CFG_TEST_POSIX */

0 commit comments

Comments
 (0)