gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 167/220: ngtcp2: add support for SSLKEYLOGFILE


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 167/220: ngtcp2: add support for SSLKEYLOGFILE
Date: Thu, 12 Sep 2019 17:28:47 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit aae22fdbd51cf344fe30d7c53fe98238545a53aa
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sat Aug 24 19:11:25 2019 +0200

    ngtcp2: add support for SSLKEYLOGFILE
    
    Closes #4260
---
 lib/vquic/ngtcp2.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index e3af71e94..6abbfa2ab 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -285,9 +285,19 @@ static int transport_params_parse_cb(SSL *ssl, unsigned 
int ext_type,
   return 1;
 }
 
+static FILE *keylog_file; /* not thread-safe */
+static void keylog_callback(const SSL *ssl, const char *line)
+{
+  (void)ssl;
+  fputs(line, keylog_file);
+  fputc('\n', keylog_file);
+  fflush(keylog_file);
+}
+
 static SSL_CTX *quic_ssl_ctx(struct Curl_easy *data)
 {
   SSL_CTX *ssl_ctx = SSL_CTX_new(TLS_method());
+  const char *keylog_filename;
 
   SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_3_VERSION);
   SSL_CTX_set_max_proto_version(ssl_ctx, TLS1_3_VERSION);
@@ -323,6 +333,14 @@ static SSL_CTX *quic_ssl_ctx(struct Curl_easy *data)
     return NULL;
   }
 
+  keylog_filename = getenv("SSLKEYLOGFILE");
+  if(keylog_filename) {
+    keylog_file = fopen(keylog_filename, "wb");
+    if(keylog_file) {
+      SSL_CTX_set_keylog_callback(ssl_ctx, keylog_callback);
+    }
+  }
+
   return ssl_ctx;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]