Module: kamailio Branch: master Commit: fe56aa38a88a9961141bbcc2fc26d384af63734e URL: https://github.com/kamailio/kamailio/commit/fe56aa38a88a9961141bbcc2fc26d384...
Author: S-P Chan shihping.chan@gmail.com Committer: S-P Chan shihping.chan@gmail.com Date: 2024-07-30T19:47:06+08:00
tls_wolfssl: legacy clean-up
---
Modified: src/modules/tls_wolfssl/tls_init.c Modified: src/modules/tls_wolfssl/tls_wolfssl_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/fe56aa38a88a9961141bbcc2fc26d384... Patch: https://github.com/kamailio/kamailio/commit/fe56aa38a88a9961141bbcc2fc26d384...
---
diff --git a/src/modules/tls_wolfssl/tls_init.c b/src/modules/tls_wolfssl/tls_init.c index 2c8c4a4965c..8f2f994e961 100644 --- a/src/modules/tls_wolfssl/tls_init.c +++ b/src/modules/tls_wolfssl/tls_init.c @@ -221,7 +221,6 @@ static void *ser_realloc(void *ptr, size_t size, const char *file, int line) #endif return p; } - #else /*TLS_MALLOC_DBG */ static void *ser_malloc(size_t size) { @@ -234,6 +233,7 @@ static void *ser_realloc(void *ptr, size_t size) } #endif
+ static void ser_free(void *ptr) { if(ptr) { @@ -241,45 +241,6 @@ static void ser_free(void *ptr) } }
-#if 0 -// up align memory allocations to 16 bytes for -// wolfSSL --enable-aligndata=yes (the default) -static const int MAX_ALIGN = __alignof__(max_align_t); - -static void* ser_malloc(size_t size) -{ - char* ptr = shm_malloc(size + MAX_ALIGN); - int pad = MAX_ALIGN - ((long) ptr % MAX_ALIGN); // 8 or 16 bytes - - memset(ptr, pad, pad); - return ptr + pad; -} - -static void* ser_realloc(void *ptr, size_t new_size) -{ - if(!ptr) return ser_malloc(new_size); - - int pad = *((char*)ptr - 1); // 8 or 16 bytes - char *real_ptr = (char*)ptr - pad; - - char *new_ptr = shm_realloc(real_ptr, new_size+MAX_ALIGN); - int new_pad = MAX_ALIGN - ((long) new_ptr % MAX_ALIGN); - if (new_pad != pad) { - memmove(new_ptr + new_pad, new_ptr + pad, new_size); - memset(new_ptr, new_pad, new_pad); - } - - return new_ptr + new_pad; -} - -static void ser_free(void *ptr) -{ - if (ptr) { - int pad = *((unsigned char *)ptr - 1); - shm_free((unsigned char*)ptr - pad); - } -} -#endif
/* * Initialize TLS socket diff --git a/src/modules/tls_wolfssl/tls_wolfssl_mod.c b/src/modules/tls_wolfssl/tls_wolfssl_mod.c index e95cecb7be5..9a195b76b39 100644 --- a/src/modules/tls_wolfssl/tls_wolfssl_mod.c +++ b/src/modules/tls_wolfssl/tls_wolfssl_mod.c @@ -262,22 +262,6 @@ static struct tls_hooks tls_h = { };
-#if 0 -/* - * Create TLS configuration from modparams - */ -static tls_domains_cfg_t* tls_use_modparams(void) -{ - tls_domains_cfg_t* ret; - - ret = tls_new_cfg(); - if (!ret) return; - - -} -#endif - - static int mod_init(void) { int method;