diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-01-28 22:52:48 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-01-28 22:52:48 +0100 |
commit | 768ee4b69ac8e83b37b1e22a90c7cb6da5796720 (patch) | |
tree | 194caad1e4b79e811f8a35b84a073af6b429d037 /src | |
parent | c160a89f8d74bfaac0a171c570b847516f484b22 (diff) | |
download | wireshark-notes-768ee4b69ac8e83b37b1e22a90c7cb6da5796720.tar.gz |
sslkeylog: rename key_logfile to keylog_file
This follows the preference name ssl.keylog_file.
Diffstat (limited to 'src')
-rw-r--r-- | src/sslkeylog.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sslkeylog.c b/src/sslkeylog.c index ade40cb..861c314 100644 --- a/src/sslkeylog.c +++ b/src/sslkeylog.c @@ -22,7 +22,7 @@ #define FIRSTLINE_LEN (sizeof(FIRSTLINE) - 1) static int (*_SSL_connect)(SSL *ssl); -static int key_logfile_fd = -1; +static int keylog_file_fd = -1; static inline void put_hex(char *buffer, int pos, char c) { @@ -57,17 +57,17 @@ static void dump_to_fd(SSL *ssl, int fd) write(fd, line, pos); } -static void init_key_logfile(void) +static void init_keylog_file(void) { - if (key_logfile_fd >= 0) + if (keylog_file_fd >= 0) return; const char *filename = getenv("SSLKEYLOGFILE"); if (filename) { - key_logfile_fd = open(filename, O_WRONLY | O_APPEND | O_CREAT, 0644); - if (key_logfile_fd >= 0 && lseek(key_logfile_fd, 0, SEEK_END) == 0) { + keylog_file_fd = open(filename, O_WRONLY | O_APPEND | O_CREAT, 0644); + if (keylog_file_fd >= 0 && lseek(keylog_file_fd, 0, SEEK_END) == 0) { /* file is opened successfully and there is no data (pos == 0) */ - write(key_logfile_fd, FIRSTLINE, FIRSTLINE_LEN); + write(keylog_file_fd, FIRSTLINE, FIRSTLINE_LEN); } } } @@ -79,9 +79,9 @@ int SSL_connect(SSL *ssl) } int ret = _SSL_connect(ssl); if (ret >= 0) { - init_key_logfile(); - if (key_logfile_fd >= 0) { - dump_to_fd(ssl, key_logfile_fd); + init_keylog_file(); + if (keylog_file_fd >= 0) { + dump_to_fd(ssl, keylog_file_fd); } } return ret; |