diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-01-29 10:31:13 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-01-29 10:31:13 +0100 |
commit | 3620d1c0c0e3083608e334a94b09d0b14e8e4c74 (patch) | |
tree | 3cd6dbe58364630e3dab2e704aa158a5c229bc79 /src | |
parent | cdbf377eab497d18b12641ca7c968b121af84436 (diff) | |
download | wireshark-notes-3620d1c0c0e3083608e334a94b09d0b14e8e4c74.tar.gz |
sslkeylog: interpose SSL_read and SSL_write
These functions can trigger a renegotiation which changes the key
material (detected by using `curl` and `openssl s_server` and pressing
`R` in `openssl s_server`).
Diffstat (limited to 'src')
-rw-r--r-- | src/sslkeylog.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/sslkeylog.c b/src/sslkeylog.c index 065a717..bf5dca4 100644 --- a/src/sslkeylog.c +++ b/src/sslkeylog.c @@ -147,3 +147,27 @@ int SSL_accept(SSL *ssl) tap_ssl_key(ssl, &state); return ret; } + +int SSL_read(SSL *ssl, void *buf, int num) +{ + static int (*func)(); + if (!func) { + func = dlsym(RTLD_NEXT, __func__); + } + SSL_TAP_STATE(state, ssl); + int ret = func(ssl, buf, num); + tap_ssl_key(ssl, &state); + return ret; +} + +int SSL_write(SSL *ssl, const void *buf, int num) +{ + static int (*func)(); + if (!func) { + func = dlsym(RTLD_NEXT, __func__); + } + SSL_TAP_STATE(state, ssl); + int ret = func(ssl, buf, num); + tap_ssl_key(ssl, &state); + return ret; +} |