Skip to content

Commit 35a9eeb

Browse files
schveiguyGeod24
authored andcommitted
Add keylog callback support (added in openssl 1.1.1)
1 parent 836c22a commit 35a9eeb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

source/deimos/openssl/ssl.di

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,30 @@ auto SSL_want_x509_lookup()(const(SSL)* s) { return (SSL_want(s) == SSL_X509_LOO
12001200
enum SSL_MAC_FLAG_READ_MAC_STREAM = 1;
12011201
enum SSL_MAC_FLAG_WRITE_MAC_STREAM = 2;
12021202

1203+
static if (OPENSSL_VERSION_AT_LEAST(1, 1, 1))
1204+
{
1205+
/*
1206+
* A callback for logging out TLS key material. This callback should log out
1207+
* |line| followed by a newline.
1208+
*/
1209+
alias SSL_CTX_keylog_cb_func = ExternC!(void function(
1210+
const SSL *ssl, const char *line));
1211+
1212+
/*
1213+
* SSL_CTX_set_keylog_callback configures a callback to log key material. This
1214+
* is intended for debugging use with tools like Wireshark. The cb function
1215+
* should log line followed by a newline.
1216+
*/
1217+
void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb);
1218+
1219+
/*
1220+
* SSL_CTX_get_keylog_callback returns the callback configured by
1221+
* SSL_CTX_set_keylog_callback.
1222+
*/
1223+
SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx);
1224+
}
1225+
1226+
12031227
version(OPENSSL_NO_SSL_INTERN) {} else {
12041228

12051229
struct ssl_st

0 commit comments

Comments
 (0)