Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for SSL_get_server_tmp_key is not available for openssl < 1.0.2 #1530

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ static void ssl_info(const SSL *ssl, int where, int ret)
#endif
SSL_CIPHER *cipher;
int secret, processed, i;
EVP_PKEY *key;

if (!(data = (ssl_appdata *) SSL_get_app_data(ssl)))
return;
Expand Down Expand Up @@ -783,11 +782,14 @@ static void ssl_info(const SSL *ssl, int where, int ret)
buf[i - 1] = 0;
debug1("TLS: cipher details: %s", buf);

#if OPENSSL_VERSION_NUMBER >= 0x10002000L /* 1.0.2 */
EVP_PKEY *key;
if (SSL_get_server_tmp_key((SSL *) ssl, &key)) {
putlog(LOG_DEBUG, "*", "TLS: diffie–hellman ephemeral key used: %s, bits %d",
OBJ_nid2sn(EVP_PKEY_id(key)), EVP_PKEY_bits(key));
EVP_PKEY_free(key);
}
#endif
} else if (where & SSL_CB_ALERT) {
if (strcmp(SSL_alert_type_string(ret), "W") ||
strcmp(SSL_alert_desc_string(ret), "CN")) {
Expand Down