Skip to content

Commit 5486a38

Browse files
author
Arto Kinnunen
committed
Merge commit 'b182455f1947ff8fa48f37ad5fde17d89d67efa5'
* commit 'b182455f1947ff8fa48f37ad5fde17d89d67efa5': Squashed 'features/nanostack/sal-stack-nanostack/' changes from 2cd155b..76da6a5
2 parents 650f9d9 + b182455 commit 5486a38

File tree

1 file changed

+59
-0
lines changed
  • features/nanostack/sal-stack-nanostack/source/Security/protocols/tls_sec_prot

1 file changed

+59
-0
lines changed

features/nanostack/sal-stack-nanostack/source/Security/protocols/tls_sec_prot/tls_sec_prot_lib.c

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
*/
1717

1818
#include "nsconfig.h"
19+
1920
#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
2030

2131
#include <string.h>
2232
#include <randLIB.h>
@@ -27,6 +37,9 @@
2737
#include "common_functions.h"
2838
#include "Security/protocols/sec_prot_certs.h"
2939
#include "Security/protocols/tls_sec_prot/tls_sec_prot_lib.h"
40+
41+
#ifdef WS_MBEDTLS_SECURITY_ENABLED
42+
3043
#include "mbedtls/sha256.h"
3144
#include "mbedtls/error.h"
3245
#include "mbedtls/platform.h"
@@ -438,5 +451,51 @@ static int tls_sec_lib_entropy_poll(void *ctx, unsigned char *output, size_t len
438451
return (0);
439452
}
440453

454+
#else /* WS_MBEDTLS_SECURITY_ENABLED */
455+
456+
int8_t tls_sec_prot_lib_connect(tls_security_t *sec, bool is_server, const sec_prot_certs_t *certs)
457+
{
458+
(void)sec;
459+
(void)is_server;
460+
(void)certs;
461+
return 0;
462+
}
463+
464+
void tls_sec_prot_lib_free(tls_security_t *sec)
465+
{
466+
(void)sec;
467+
}
468+
469+
int8_t tls_sec_prot_lib_init(tls_security_t *sec)
470+
{
471+
(void)sec;
472+
return 0;
473+
}
474+
475+
int8_t tls_sec_prot_lib_process(tls_security_t *sec)
476+
{
477+
(void)sec;
478+
return 0;
479+
}
480+
481+
void tls_sec_prot_lib_set_cb_register(tls_security_t *sec, void *handle,
482+
tls_sec_prot_lib_send *send, tls_sec_prot_lib_receive *receive,
483+
tls_sec_prot_lib_export_keys *export_keys, tls_sec_prot_lib_set_timer *set_timer,
484+
tls_sec_prot_lib_get_timer *get_timer)
485+
{
486+
(void)sec;
487+
(void)handle;
488+
(void)send;
489+
(void)receive;
490+
(void)export_keys;
491+
(void)set_timer;
492+
(void)get_timer;
493+
}
494+
495+
uint16_t tls_sec_prot_lib_size(void)
496+
{
497+
return 0;
498+
}
499+
#endif /* WS_MBEDTLS_SECURITY_ENABLED */
441500
#endif /* HAVE_WS */
442501

0 commit comments

Comments
 (0)