Add SSL_CTX_get_keylog_callback.

Conscrypt would like to write a CTS test that the callback isn't set
unexpectedly.

Change-Id: I11f987422daf0544e90f5cff4d7aaf557ac1f5a2
Reviewed-on: https://boringssl-review.googlesource.com/11060
Reviewed-by: Kenny Root <kroot@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
David Benjamin 2016-09-14 14:43:14 -04:00 committed by CQ bot account: commit-bot@chromium.org
parent bb5484049d
commit 6e3f5cc7e1
2 changed files with 10 additions and 0 deletions

View File

@ -2847,6 +2847,11 @@ OPENSSL_EXPORT void SSL_set_msg_callback_arg(SSL *ssl, void *arg);
OPENSSL_EXPORT void SSL_CTX_set_keylog_callback( OPENSSL_EXPORT void SSL_CTX_set_keylog_callback(
SSL_CTX *ctx, void (*cb)(const SSL *ssl, const char *line)); SSL_CTX *ctx, void (*cb)(const SSL *ssl, const char *line));
/* SSL_CTX_get_keylog_callback returns the callback configured by
* |SSL_CTX_set_keylog_callback|. */
OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(
const SSL *ssl, const char *line);
/* SSL_CTX_set_current_time_cb configures a callback to retrieve the current /* SSL_CTX_set_current_time_cb configures a callback to retrieve the current
* time, which should be set in |*out_clock|. This can be used for testing * time, which should be set in |*out_clock|. This can be used for testing
* purposes; for example, a callback can be configured that returns a time * purposes; for example, a callback can be configured that returns a time

View File

@ -2524,6 +2524,11 @@ void SSL_CTX_set_keylog_callback(SSL_CTX *ctx,
ctx->keylog_callback = cb; ctx->keylog_callback = cb;
} }
void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(const SSL *ssl,
const char *line) {
return ctx->keylog_callback;
}
void SSL_CTX_set_current_time_cb(SSL_CTX *ctx, void SSL_CTX_set_current_time_cb(SSL_CTX *ctx,
void (*cb)(const SSL *ssl, void (*cb)(const SSL *ssl,
struct timeval *out_clock)) { struct timeval *out_clock)) {