When enabled, setting SSLKEYLOGFILE to a file path records the keys exchanged
during a TLS handshake for use in analysis tools like wireshark. Note that the
use of this mechanism allows for decryption of application payloads found in
-captured packets using keys from the key log file. See Section 3 of
-[the draft standard for SSLKEYLOGFILE](https://datatracker.ietf.org/doc/draft-thomson-tls-keylogfile/)
+captured packets using keys from the key log file and therefore has significant
+security consequences. See Section 3 of
+[the draft standard for SSLKEYLOGFILE](https://datatracker.ietf.org/doc/draft-ietf-tls-keylogfile/)
### no-ts
/**
* @brief records ssl secrets to a file
*/
-static void sslkeylogfile_cb(const SSL *ssl, const char *line)
+static void do_sslkeylogfile(const SSL *ssl, const char *line)
{
if (keylog_lock == NULL)
return;
goto out;
}
- /* Grab out global lock */
+ /* Grab our global lock */
if (!CRYPTO_THREAD_write_lock(keylog_lock)) {
OSSL_TRACE(TLS, "Unable to acquire keylog write lock\n");
goto out;
#ifndef OPENSSL_NO_SSLKEYLOG
if (sctx->do_sslkeylog == 1)
- sslkeylogfile_cb(SSL_CONNECTION_GET_SSL(sc), (const char *)out);
+ do_sslkeylogfile(SSL_CONNECTION_GET_SSL(sc), (const char *)out);
#endif
if (sctx->keylog_callback != NULL)
sctx->keylog_callback(SSL_CONNECTION_GET_SSL(sc), (const char *)out);
SSL_CTX_keylog_cb_func keylog_callback;
/*
- * Private callback for internal key logging based on SSLKEYLOG env
- * We don't want to create a chaining mechanism as we're never sure
- * if the application wants to set an additional callback or override
- * the one set via SSLKEYLOGFILE, so we just keep them separate
+ * Private flag for internal key logging based on SSLKEYLOG env
*/
# ifndef OPENSSL_NO_SSLKEYLOG
uint32_t do_sslkeylog;
"-cert", $server_pem, "-key", $server_key);
my $s_server_pid = open3(my $s_server_i, my $s_server_o, my $s_server_e, $shlib_wrap, $apps_openssl, @s_server_cmd);
-# ACCEPT 0.0.0.0:45921
-# ACCEPT [::]:45921
+# expected outputs from the server
+# ACCEPT 0.0.0.0:<port>
+# ACCEPT [::]:<port>
my $port = "0";
# Figure out what port its listening on
while (<$s_server_o>) {