Skip to content

Commit 08dfcfc

Browse files
author
Arto Kinnunen
committed
Merge branch 'release_internal'
* release_internal: Fix Mbed-OS test compilation error Fix issues found by coverity Fix NUCLEO_F401RE compilation issue
2 parents 4edc186 + d1e0074 commit 08dfcfc

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

source/Security/protocols/tls_sec_prot/tls_sec_prot_lib.c

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
*/
1717

1818
#include "nsconfig.h"
19+
20+
#ifdef HAVE_WS
21+
#if !defined(MBEDTLS_CONFIG_FILE)
22+
#include "mbedtls/config.h"
23+
#else
24+
#include MBEDTLS_CONFIG_FILE
25+
#endif
26+
27+
#if defined(MBEDTLS_SSL_TLS_C)
28+
#define WS_MBEDTLS_SECURITY_ENABLED
29+
#endif
30+
1931
#include <string.h>
2032
#include <randLIB.h>
2133
#include "ns_types.h"
@@ -25,6 +37,9 @@
2537
#include "common_functions.h"
2638
#include "Security/protocols/sec_prot_certs.h"
2739
#include "Security/protocols/tls_sec_prot/tls_sec_prot_lib.h"
40+
41+
#ifdef WS_MBEDTLS_SECURITY_ENABLED
42+
2843
#include "mbedtls/sha256.h"
2944
#include "mbedtls/error.h"
3045
#include "mbedtls/platform.h"
@@ -37,8 +52,6 @@
3752

3853
#include "mbedtls/ssl_internal.h"
3954

40-
#ifdef HAVE_WS
41-
4255
#define TRACE_GROUP "tlsl"
4356

4457
#define TLS_HANDSHAKE_TIMEOUT_MIN 25000
@@ -460,5 +473,51 @@ static int tls_sec_lib_entropy_poll(void *ctx, unsigned char *output, size_t len
460473
return (0);
461474
}
462475

476+
#else /* WS_MBEDTLS_SECURITY_ENABLED */
477+
478+
int8_t tls_sec_prot_lib_connect(tls_security_t *sec, bool is_server, const sec_prot_certs_t *certs)
479+
{
480+
(void)sec;
481+
(void)is_server;
482+
(void)certs;
483+
return 0;
484+
}
485+
486+
void tls_sec_prot_lib_free(tls_security_t *sec)
487+
{
488+
(void)sec;
489+
}
490+
491+
int8_t tls_sec_prot_lib_init(tls_security_t *sec)
492+
{
493+
(void)sec;
494+
return 0;
495+
}
496+
497+
int8_t tls_sec_prot_lib_process(tls_security_t *sec)
498+
{
499+
(void)sec;
500+
return 0;
501+
}
502+
503+
void tls_sec_prot_lib_set_cb_register(tls_security_t *sec, void *handle,
504+
tls_sec_prot_lib_send *send, tls_sec_prot_lib_receive *receive,
505+
tls_sec_prot_lib_export_keys *export_keys, tls_sec_prot_lib_set_timer *set_timer,
506+
tls_sec_prot_lib_get_timer *get_timer)
507+
{
508+
(void)sec;
509+
(void)handle;
510+
(void)send;
511+
(void)receive;
512+
(void)export_keys;
513+
(void)set_timer;
514+
(void)get_timer;
515+
}
516+
517+
uint16_t tls_sec_prot_lib_size(void)
518+
{
519+
return 0;
520+
}
521+
#endif /* WS_MBEDTLS_SECURITY_ENABLED */
463522
#endif /* HAVE_WS */
464523

0 commit comments

Comments
 (0)