diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-06-06 18:43:12 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-06-06 18:46:43 +0200 |
commit | e9ed732affc0580ec0941178bf760a90e89c2201 (patch) | |
tree | 319061bd4972427dabb38b0d947683e287d4ae67 /lib/kx.c | |
parent | ff22daeca37be4c3c62e7095649243cb8d7a8454 (diff) | |
download | gnutls-e9ed732affc0580ec0941178bf760a90e89c2201.tar.gz |
keylogfile: only consider the SSLKEYLOGFILE variable
In addition do not check the environment in the constructor
but instead use static variables to save the key file name.
The GNUTLS_KEYLOGFILE environment variable is no longer used
since there is no reason to have a separate one.
Diffstat (limited to 'lib/kx.c')
-rw-r--r-- | lib/kx.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -100,11 +100,18 @@ static void write_nss_key_log(gnutls_session_t session, const gnutls_datum_t *pr char buf[512]; char buf2[512]; FILE *fp; + static const char *keylogfile = NULL; + static unsigned checked_env = 0; - if (_gnutls_keylogfile == NULL) + if (!checked_env) { + checked_env = 1; + keylogfile = secure_getenv("SSLKEYLOGFILE"); + } + + if (keylogfile == NULL) return; - fp = fopen(_gnutls_keylogfile, "a"); + fp = fopen(keylogfile, "a"); if (fp == NULL) return; |