Skip to content

Commit 1a5ac9a

Browse files
fix macro guards for no crypto build
1 parent a53cc21 commit 1a5ac9a

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

examples/posix/wh_posix_client/wh_posix_client_cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static unsigned int psk_tls12_client_cb(WOLFSSL* ssl, const char* hint,
199199
unsigned int key_max_len)
200200
{
201201
memset(key, 0, key_max_len);
202-
const char* exampleIdentity = "PSK_EXAMLE_CLIENT_IDENTITY";
202+
const char* exampleIdentity = "PSK_EXAMPLE_CLIENT_IDENTITY";
203203

204204
printf("PSK server identity hint: %s\n", hint);
205205
printf("PSK using identity: %s\n", exampleIdentity);

examples/posix/wh_posix_server/wh_posix_server_cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ wh_PosixServer_ExampleTlsContextSetup(posixTransportTlsServerContext* ctx)
292292
return WH_ERROR_ABORTED;
293293
}
294294

295-
/* Setup server for mutal authentication. It will try to verify the clients
295+
/* Setup server for mutual authentication. It will try to verify the clients
296296
* certificate so both the client and server authenticate the peer
297297
* connecting with. */
298298
wolfSSL_CTX_set_verify(ctx->ssl_ctx, WOLFSSL_VERIFY_PEER, NULL);

port/posix/posix_transport_tls.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "posix_transport_tls.h"
2929
#include "wolfhsm/wh_error.h"
3030

31+
#if !defined(NO_TLS) && !defined(WOLFCRYPT_ONLY)
32+
3133
#include <stdio.h>
3234
#include <stdlib.h>
3335
#include <string.h>
@@ -40,13 +42,15 @@
4042
#include <poll.h>
4143

4244

45+
#ifndef WOLFHSM_CFG_NO_CRYPTO
4346
/* returns 1 (true) if the error passed in is a notice for non blocking
4447
* 0 if the error is a fatal error */
4548
static int NonBlockingError(int err)
4649
{
4750
return (err == WOLFSSL_ERROR_WANT_READ) ||
4851
(err == WOLFSSL_ERROR_WANT_WRITE);
4952
}
53+
#endif /* WOLFHSM_CFG_NO_CRYPTO */
5054

5155
/** Client-side TLS transport functions */
5256

@@ -475,4 +479,5 @@ int posixTransportTls_GetAcceptFd(posixTransportTlsServerContext* context,
475479
ret = WH_ERROR_NOTREADY;
476480
}
477481
return ret;
478-
}
482+
}
483+
#endif /* !defined(NO_TLS) && !defined(WOLFCRYPT_ONLY) */

tools/whnvmtool/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ analyze: $(SRC)
104104
scan:
105105
@echo "Running scan-build static analysis"
106106
@mkdir -p $(WOLFHSM_DIR)/scan_out/
107-
@scan-build --status-bugs $(MAKE) analyze 2> $(WOLFHSM_DIR)/scan_out/$(SCAN_LOG)
107+
@scan-build --exclude $(WOLFSSL_DIR)/wolfcrypt \
108+
--exclude $(WOLFSSL_DIR)/src \
109+
--status-bugs $(MAKE) analyze 2> $(WOLFHSM_DIR)/scan_out/$(SCAN_LOG)
108110

109111
clean: clean-test
110112
rm -f whNvmImage.bin whNvmImage.hex

0 commit comments

Comments
 (0)