mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:17:28 +03:00
libssh2: show crypto backend in the verbose connect log
With libssh2 1.11.0 or newer. Different crypto backends may offer different features, e.g. in the keys and algos they support. Examples: ``` * Trying 127.0.0.1:22... * Connected to localhost (127.0.0.1) port 22 * libssh2 crypto backend: openssl compatible [or] * libssh2 crypto backend: WinCNG ``` Also fix indentation and drop redundant curly braces. Closes #16790
This commit is contained in:
parent
b4dc529fc4
commit
1dd361cde8
1 changed files with 35 additions and 9 deletions
|
|
@ -2030,13 +2030,13 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block)
|
|||
break;
|
||||
}
|
||||
|
||||
/* This is the last step in the SFTP connect phase. Do note that while
|
||||
we get the homedir here, we get the "workingpath" in the DO action
|
||||
since the homedir will remain the same between request but the
|
||||
working path will not. */
|
||||
DEBUGF(infof(data, "SSH CONNECT phase done"));
|
||||
state(data, SSH_STOP);
|
||||
break;
|
||||
/* This is the last step in the SFTP connect phase. Do note that while
|
||||
we get the homedir here, we get the "workingpath" in the DO action
|
||||
since the homedir will remain the same between request but the
|
||||
working path will not. */
|
||||
DEBUGF(infof(data, "SSH CONNECT phase done"));
|
||||
state(data, SSH_STOP);
|
||||
break;
|
||||
|
||||
case SSH_SFTP_QUOTE_INIT:
|
||||
|
||||
|
|
@ -2299,7 +2299,6 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block)
|
|||
}
|
||||
|
||||
case SSH_SFTP_GETINFO:
|
||||
{
|
||||
if(data->set.get_filetime) {
|
||||
state(data, SSH_SFTP_FILETIME);
|
||||
}
|
||||
|
|
@ -2307,7 +2306,6 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block)
|
|||
state(data, SSH_SFTP_TRANS_INIT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SSH_SFTP_FILETIME:
|
||||
{
|
||||
|
|
@ -3110,6 +3108,34 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done)
|
|||
CURLcode result;
|
||||
struct connectdata *conn = data->conn;
|
||||
|
||||
#if LIBSSH2_VERSION_NUM >= 0x010b00
|
||||
{
|
||||
const char *crypto_str;
|
||||
switch(libssh2_crypto_engine()) {
|
||||
case libssh2_gcrypt:
|
||||
crypto_str = "libgcrypt";
|
||||
break;
|
||||
case libssh2_mbedtls:
|
||||
crypto_str = "mbedTLS";
|
||||
break;
|
||||
case libssh2_openssl:
|
||||
crypto_str = "openssl compatible";
|
||||
break;
|
||||
case libssh2_os400qc3:
|
||||
crypto_str = "OS400QC3";
|
||||
break;
|
||||
case libssh2_wincng:
|
||||
crypto_str = "WinCNG";
|
||||
break;
|
||||
default:
|
||||
crypto_str = NULL;
|
||||
break;
|
||||
}
|
||||
if(crypto_str)
|
||||
infof(data, "libssh2 cryptography backend: %s", crypto_str);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* initialize per-handle data if not already */
|
||||
if(!data->req.p.ssh) {
|
||||
result = ssh_setup_connection(data, conn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue