[sr-dev] [kamailio/kamailio] tls: allow export session keys (#2785)

sergey-safarov notifications at github.com
Mon Jun 28 11:48:41 CEST 2021


To free memory applied patch
```diff
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -627,8 +627,9 @@ int prepare_keylog_file(str session_keylog_filename)
        * the tool is run multiple times.
        */
        bio_keylog = BIO_new_file(keylog_file, "a");
+       pkg_free(keylog_file);
        if (bio_keylog == NULL) {
-               LOG(tls_log, "Error writing keylog file: %s\n", keylog_file);
+               LOG(tls_log, "Error writing keylog file: %.*s\n", session_keylog_filename.len, session_keylog_filename.s);
                return 1;
        }
 
```
As session keys may be refreshed during TLS session, then the file open and close operation needs use on each `keylog_callback`.
Will it be trick on a server with a lot of connected TLS clients?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2785#issuecomment-869541733
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210628/d4ceb7b2/attachment.htm>


More information about the sr-dev mailing list