aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/tls/mbedtls/mbedtls.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-11-09 09:36:52 -0800
committerGarrett D'Amore <garrett@damore.org>2025-11-10 05:26:05 -0800
commitc9e4b41e109b03ca9ffcf789f8278705451026c7 (patch)
tree335fcfc1218cda1344de8031ea9b352bece525ed /src/supplemental/tls/mbedtls/mbedtls.c
parentfcd1adbb6d4d0307aacdd56034695a6083429163 (diff)
downloadnng-c9e4b41e109b03ca9ffcf789f8278705451026c7.tar.gz
nng-c9e4b41e109b03ca9ffcf789f8278705451026c7.tar.bz2
nng-c9e4b41e109b03ca9ffcf789f8278705451026c7.zip
refactor/dtls: Use message oriented send/receive for DTLS.
The protocol here needs to know and respect message boundaries.
Diffstat (limited to 'src/supplemental/tls/mbedtls/mbedtls.c')
-rw-r--r--src/supplemental/tls/mbedtls/mbedtls.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/supplemental/tls/mbedtls/mbedtls.c b/src/supplemental/tls/mbedtls/mbedtls.c
index 87a8bd96..32ff3c59 100644
--- a/src/supplemental/tls/mbedtls/mbedtls.c
+++ b/src/supplemental/tls/mbedtls/mbedtls.c
@@ -211,8 +211,8 @@ tls_mk_err(int err)
static int
net_send(void *tls, const unsigned char *buf, size_t len)
{
- size_t sz = len;
- int rv;
+ size_t sz = len;
+ nng_err rv;
rv = nng_tls_engine_send(tls, buf, &sz);
switch (rv) {
@@ -228,8 +228,8 @@ net_send(void *tls, const unsigned char *buf, size_t len)
static int
net_recv(void *tls, unsigned char *buf, size_t len)
{
- size_t sz = len;
- int rv;
+ size_t sz = len;
+ nng_err rv;
rv = nng_tls_engine_recv(tls, buf, &sz);
switch (rv) {
@@ -993,7 +993,7 @@ tls_engine_init(void)
#endif
// Uncomment the following to have noisy debug from mbedTLS.
// This may be useful when trying to debug failures.
- // mbedtls_debug_set_threshold(9);
+ mbedtls_debug_set_threshold(1);
mbedtls_ssl_cookie_init(&mbed_ssl_cookie_ctx);
rv = mbedtls_ssl_cookie_setup(&mbed_ssl_cookie_ctx, tls_random, NULL);