diff options
author | Daiki Ueno <dueno@redhat.com> | 2020-02-02 08:13:50 +0100 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2020-02-07 18:03:45 +0100 |
commit | 9711755641cd9b6de323676abeab6cc80ea13e4b (patch) | |
tree | 95b303ea614c67994905ee5e18d4c9d2bcd0bcbe /lib/state.c | |
parent | ee43a212b6bde870bf0800329972f3cab24715ec (diff) | |
download | gnutls-tmp-keylog-hook.tar.gz |
keylogfile: generalize with a callbacktmp-keylog-hook
This refactors the keylogfile mechanism by adding a callback to get
notified when a new secret is derived and installed. That way,
consumers can implement custom logging feature per session, which is
particularly useful in QUIC implementation.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'lib/state.c')
-rw-r--r-- | lib/state.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/state.c b/lib/state.c index dff7312a87..f33cd5a8bc 100644 --- a/lib/state.c +++ b/lib/state.c @@ -54,6 +54,7 @@ #include "tls13/session_ticket.h" #include "ext/cert_types.h" #include "locks.h" +#include "kx.h" /* to be used by supplemental data support to disable TLS1.3 * when supplemental data have been globally registered */ @@ -587,6 +588,10 @@ int gnutls_init(gnutls_session_t * session, unsigned int flags) if (_gnutls_disable_tls13 != 0) (*session)->internals.flags |= INT_FLAG_NO_TLS13; + /* Install the default secret function */ + gnutls_handshake_set_secret_function(*session, + _gnutls_nss_keylog_secret_func); + return 0; } |