|
16 | 16 | */
|
17 | 17 |
|
18 | 18 | #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 | + |
19 | 31 | #include <string.h>
|
20 | 32 | #include <randLIB.h>
|
21 | 33 | #include "ns_types.h"
|
|
25 | 37 | #include "common_functions.h"
|
26 | 38 | #include "Security/protocols/sec_prot_certs.h"
|
27 | 39 | #include "Security/protocols/tls_sec_prot/tls_sec_prot_lib.h"
|
| 40 | + |
| 41 | +#ifdef WS_MBEDTLS_SECURITY_ENABLED |
| 42 | + |
28 | 43 | #include "mbedtls/sha256.h"
|
29 | 44 | #include "mbedtls/error.h"
|
30 | 45 | #include "mbedtls/platform.h"
|
|
37 | 52 |
|
38 | 53 | #include "mbedtls/ssl_internal.h"
|
39 | 54 |
|
40 |
| -#ifdef HAVE_WS |
41 |
| - |
42 | 55 | #define TRACE_GROUP "tlsl"
|
43 | 56 |
|
44 | 57 | #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
|
460 | 473 | return (0);
|
461 | 474 | }
|
462 | 475 |
|
| 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 */ |
463 | 522 | #endif /* HAVE_WS */
|
464 | 523 |
|
0 commit comments