Skip to content

Commit 5894404

Browse files
authored
Merge branch 'wolfSSL:main' into fix_wextra
2 parents 1f31170 + e0b2019 commit 5894404

24 files changed

+524
-60
lines changed

examples/demo/client/wh_demo_client_all.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#include "wh_demo_client_all.h"
1+
#include "wh_demo_client_wctest.h"
2+
#include "wh_demo_client_wcbench.h"
23
#include "wh_demo_client_nvm.h"
34
#include "wh_demo_client_keystore.h"
45
#include "wh_demo_client_crypto.h"
5-
#include "wh_demo_client_wctest.h"
6-
#include "wh_demo_client_wcbench.h"
6+
#include "wh_demo_client_secboot.h"
7+
#include "wh_demo_client_all.h"
78

89
int wh_DemoClient_All(whClientContext* clientContext)
910
{
@@ -120,6 +121,20 @@ int wh_DemoClient_All(whClientContext* clientContext)
120121
if (rc != 0) {
121122
return rc;
122123
}
124+
125+
rc = wh_DemoClient_SecBoot_Provision(clientContext);
126+
if (rc != 0) {
127+
return rc;
128+
}
129+
rc = wh_DemoClient_SecBoot_Boot(clientContext);
130+
if (rc != 0) {
131+
return rc;
132+
}
133+
rc = wh_DemoClient_SecBoot_Zeroize(clientContext);
134+
if (rc != 0) {
135+
return rc;
136+
}
137+
123138
#endif /* WOLFSSL_CMAC */
124139

125140
return rc;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#ifndef CLIENT_DEMO_DRIVER_H_
2-
#define CLIENT_DEMO_DRIVER_H_
1+
#ifndef DEMO_CLIENT_ALL_H_
2+
#define DEMO_CLIENT_ALL_H_
33

44
#include "wolfhsm/wh_client.h"
55

66
int wh_DemoClient_All(whClientContext* clientContext);
77

8-
#endif /* CLIENT_DEMO_DRIVER_H_ */
8+
#endif /* !DEMO_CLIENT_ALL_H_ */

examples/demo/client/wh_demo_client_counter.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#include "wh_demo_client_counter.h"
21
#include "wolfhsm/wh_error.h"
2+
#include "wolfhsm/wh_client.h"
3+
#include "wh_demo_client_counter.h"
34

45
int wh_DemoClient_Counter(whClientContext* clientContext)
56
{
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#ifndef CLIENT_COUNTER_H
2-
#define CLIENT_COUNTER_H
1+
#ifndef DEMO_CLIENT_COUNTER_H_
2+
#define DEMO_CLIENT_COUNTER_H_
3+
34
#include "wolfhsm/wh_client.h"
45

56
int wh_DemoClient_Counter(whClientContext* clientContext);
67

7-
#endif /* CLIENT_COUNTER_H */
8+
#endif /* !DEMO_CLIENT_COUNTER_H_ */

examples/demo/client/wh_demo_client_crypto.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
#include <stdint.h>
22
#include <string.h>
33
#include <stddef.h>
4-
5-
64
#include <sys/types.h>
75
#include <sys/stat.h>
86
#include <fcntl.h>
97
#include <unistd.h>
108

119
#include "wolfhsm/wh_common.h"
10+
#include "wolfhsm/wh_error.h"
1211
#include "wolfhsm/wh_client.h"
1312
#include "wolfhsm/wh_client_crypto.h"
14-
#include "wolfhsm/wh_error.h"
15-
16-
#include "user_settings.h"
1713

1814
#include "wolfssl/wolfcrypt/settings.h"
1915
#include "wolfssl/wolfcrypt/types.h"
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
1-
#ifndef CLIENT_CRYPTO_H_
2-
#define CLIENT_CRYPTO_H_
1+
#ifndef DEMO_CLIENT_CRYPTO_H_
2+
#define DEMO_CLIENT_CRYPTO_H_
3+
34
#include "wolfhsm/wh_client.h"
45

5-
#if !defined(NO_RSA)
66
int wh_DemoClient_CryptoRsa(whClientContext* clientContext);
77
int wh_DemoClient_CryptoRsaImport(whClientContext* clientContext);
8-
#endif
98

10-
#ifdef HAVE_CURVE25519
119
int wh_DemoClient_CryptoCurve25519(whClientContext* clientContext);
1210
int wh_DemoClient_CryptoCurve25519Import(whClientContext* clientContext);
13-
#endif /* HAVE_CURVE25519 */
1411

15-
#if defined(HAVE_ECC)
1612
int wh_DemoClient_CryptoEcc(whClientContext* clientContext);
1713
int wh_DemoClient_CryptoEccImport(whClientContext* clientContext);
18-
#endif /* !NO_ECC && HAVE_ECC */
1914

20-
#if !defined(NO_AES) && defined(HAVE_AES_CBC)
2115
int wh_DemoClient_CryptoAesCbc(whClientContext* clientContext);
2216
int wh_DemoClient_CryptoAesCbcImport(whClientContext* clientContext);
23-
#endif /* !NO_AES && HAVE_AES */
2417

25-
#if !defined(NO_AES) && defined(HAVE_AESGCM)
2618
int wh_DemoClient_CryptoAesGcm(whClientContext* clientContext);
2719
int wh_DemoClient_CryptoAesGcmImport(whClientContext* clientContext);
28-
#endif /* !NOAES && HAVE_AES && HAVE_ASEGCM */
2920

30-
#ifdef WOLFSSL_CMAC
3121
int wh_DemoClient_CryptoCmac(whClientContext* clientContext);
3222
int wh_DemoClient_CryptoCmacImport(whClientContext* clientContext);
3323
int wh_DemoClient_CryptoCmacOneshotImport(whClientContext* clientContext);
34-
#endif /* WOLFSSL_CMAC */
3524

36-
#endif /* CLIENT_CRYPTO_H_ */
25+
#endif /* !DEMO_CLIENT_CRYPTO_H_ */

examples/demo/client/wh_demo_client_keystore.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
#include <stdio.h>
33
#include <string.h>
44

5+
#include "wolfhsm/wh_common.h"
6+
#include "wolfhsm/wh_error.h"
57
#include "wolfhsm/wh_client.h"
68
#include "wolfhsm/wh_client_crypto.h"
7-
#include "wolfhsm/wh_error.h"
89

910
#include "wolfssl/wolfcrypt/settings.h"
1011
#include "wolfssl/wolfcrypt/aes.h"
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#ifndef CLIENT_KEYSTORE_H_
2-
#define CLIENT_KEYSTORE_H_
1+
#ifndef DEMO_CLIENT_KEYSTORE_H_
2+
#define DEMO_CLIENT_KEYSTORE_H_
3+
34
#include "wolfhsm/wh_client.h"
45

56
int wh_DemoClient_KeystoreBasic(whClientContext* clientContext);
67
int wh_DemoClient_KeystoreCommitKey(whClientContext* clientContext);
78
int wh_DemoClient_KeystoreAes(whClientContext* clientContext);
89

9-
#endif /* CLIENT_KEYSTORE_H_ */
10+
#endif /* !DEMO_CLIENT_KEYSTORE_H_ */

examples/demo/client/wh_demo_client_nvm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#include "wh_demo_client_nvm.h"
2-
31
#include <stdio.h>
42
#include <stdint.h>
53
#include <string.h>
64

7-
#include "wolfhsm/wh_client.h"
5+
#include "wolfhsm/wh_common.h"
86
#include "wolfhsm/wh_error.h"
7+
#include "wolfhsm/wh_client.h"
8+
9+
#include "wh_demo_client_nvm.h"
910

1011
/**
1112
* @brief Demonstrates use of client NVM API
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#ifndef CLIENT_NVM_H_
2-
#define CLIENT_NVM_H_
1+
#ifndef DEMO_CLIENT_NVM_H_
2+
#define DEMO_CLIENT_NVM_H_
33

44
#include "wolfhsm/wh_client.h"
55

66
int wh_DemoClient_Nvm(whClientContext* clientContext);
77

8-
#endif /* CLIENT_NVM_H_ */
8+
#endif /* !DEMO_CLIENT_NVM_H_ */

0 commit comments

Comments
 (0)