summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/vssh
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-27 20:58:44 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-27 20:58:44 (GMT)
commitf9f5957884c279af81766f3f339bdd0e768e814f (patch)
tree310f21f037896ac658f8d59e81fa671ee9dee1ef /Utilities/cmcurl/lib/vssh
parent39dcf9469d3dae1c319dbe9d1fbd86bef91b73e0 (diff)
parentdac458ddbf2b48168779821654a7e69cbd828c14 (diff)
downloadCMake-f9f5957884c279af81766f3f339bdd0e768e814f.zip
CMake-f9f5957884c279af81766f3f339bdd0e768e814f.tar.gz
CMake-f9f5957884c279af81766f3f339bdd0e768e814f.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2022-12-21 (c12fb3dd)
Diffstat (limited to 'Utilities/cmcurl/lib/vssh')
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh.c18
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh2.c28
-rw-r--r--Utilities/cmcurl/lib/vssh/wolfssh.c6
3 files changed, 22 insertions, 30 deletions
diff --git a/Utilities/cmcurl/lib/vssh/libssh.c b/Utilities/cmcurl/lib/vssh/libssh.c
index 0105e40..d9fa58a 100644
--- a/Utilities/cmcurl/lib/vssh/libssh.c
+++ b/Utilities/cmcurl/lib/vssh/libssh.c
@@ -51,11 +51,6 @@
#include <inet.h>
#endif
-#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
-#undef in_addr_t
-#define in_addr_t unsigned long
-#endif
-
#include <curl/curl.h>
#include "urldata.h"
#include "sendf.h"
@@ -71,6 +66,7 @@
#include "strdup.h"
#include "strcase.h"
#include "vtls/vtls.h"
+#include "cfilters.h"
#include "connect.h"
#include "inet_ntop.h"
#include "parsedate.h" /* for the week day and month names */
@@ -1415,7 +1411,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
case SSH_SFTP_READDIR_INIT:
Curl_pgrsSetDownloadSize(data, -1);
- if(data->set.opt_no_body) {
+ if(data->req.no_body) {
state(data, SSH_STOP);
break;
}
@@ -1662,13 +1658,13 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
CURLofft to_t;
CURLofft from_t;
- from_t = curlx_strtoofft(data->state.range, &ptr, 0, &from);
+ from_t = curlx_strtoofft(data->state.range, &ptr, 10, &from);
if(from_t == CURL_OFFT_FLOW) {
return CURLE_RANGE_ERROR;
}
while(*ptr && (ISBLANK(*ptr) || (*ptr == '-')))
ptr++;
- to_t = curlx_strtoofft(ptr, &ptr2, 0, &to);
+ to_t = curlx_strtoofft(ptr, &ptr2, 10, &to);
if(to_t == CURL_OFFT_FLOW) {
return CURLE_RANGE_ERROR;
}
@@ -2323,7 +2319,6 @@ CURLcode scp_perform(struct Curl_easy *data,
bool *connected, bool *dophase_done)
{
CURLcode result = CURLE_OK;
- struct connectdata *conn = data->conn;
DEBUGF(infof(data, "DO phase starts"));
@@ -2334,7 +2329,7 @@ CURLcode scp_perform(struct Curl_easy *data,
result = myssh_multi_statemach(data, dophase_done);
- *connected = conn->bits.tcpconnect[FIRSTSOCKET];
+ *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET);
if(*dophase_done) {
DEBUGF(infof(data, "DO phase is complete"));
@@ -2504,7 +2499,6 @@ CURLcode sftp_perform(struct Curl_easy *data,
bool *dophase_done)
{
CURLcode result = CURLE_OK;
- struct connectdata *conn = data->conn;
DEBUGF(infof(data, "DO phase starts"));
@@ -2516,7 +2510,7 @@ CURLcode sftp_perform(struct Curl_easy *data,
/* run the state-machine */
result = myssh_multi_statemach(data, dophase_done);
- *connected = conn->bits.tcpconnect[FIRSTSOCKET];
+ *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET);
if(*dophase_done) {
DEBUGF(infof(data, "DO phase is complete"));
diff --git a/Utilities/cmcurl/lib/vssh/libssh2.c b/Utilities/cmcurl/lib/vssh/libssh2.c
index 5a2c0f8..ce9229f 100644
--- a/Utilities/cmcurl/lib/vssh/libssh2.c
+++ b/Utilities/cmcurl/lib/vssh/libssh2.c
@@ -54,11 +54,6 @@
#include <inet.h>
#endif
-#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
-#undef in_addr_t
-#define in_addr_t unsigned long
-#endif
-
#include <curl/curl.h>
#include "urldata.h"
#include "sendf.h"
@@ -74,6 +69,7 @@
#include "strdup.h"
#include "strcase.h"
#include "vtls/vtls.h"
+#include "cfilters.h"
#include "connect.h"
#include "inet_ntop.h"
#include "parsedate.h" /* for the week day and month names */
@@ -83,7 +79,6 @@
#include "select.h"
#include "warnless.h"
#include "curl_path.h"
-#include "strcase.h"
#include <curl_base64.h> /* for base64 encoding/decoding */
#include <curl_sha256.h>
@@ -610,9 +605,9 @@ static CURLcode ssh_knownhost(struct Curl_easy *data)
/* remove old host+key that doesn't match */
if(host)
libssh2_knownhost_del(sshc->kh, host);
- /*FALLTHROUGH*/
+ /* FALLTHROUGH */
case CURLKHSTAT_FINE:
- /*FALLTHROUGH*/
+ /* FALLTHROUGH */
case CURLKHSTAT_FINE_ADD_TO_FILE:
/* proceed */
if(keycheck != LIBSSH2_KNOWNHOST_CHECK_MATCH) {
@@ -785,7 +780,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
size_t keylen = 0;
int sshkeytype = 0;
int rc = 0;
- /* we handle the process to the callback*/
+ /* we handle the process to the callback */
const char *remotekey = libssh2_session_hostkey(sshc->ssh_session,
&keylen, &sshkeytype);
if(remotekey) {
@@ -796,10 +791,14 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
Curl_set_in_callback(data, false);
if(rc!= CURLKHMATCH_OK) {
state(data, SSH_SESSION_FREE);
+ sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION;
+ return sshc->actualcode;
}
}
else {
state(data, SSH_SESSION_FREE);
+ sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION;
+ return sshc->actualcode;
}
return CURLE_OK;
}
@@ -2251,7 +2250,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
case SSH_SFTP_READDIR_INIT:
Curl_pgrsSetDownloadSize(data, -1);
- if(data->set.opt_no_body) {
+ if(data->req.no_body) {
state(data, SSH_STOP);
break;
}
@@ -2503,12 +2502,12 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
CURLofft to_t;
CURLofft from_t;
- from_t = curlx_strtoofft(data->state.range, &ptr, 0, &from);
+ from_t = curlx_strtoofft(data->state.range, &ptr, 10, &from);
if(from_t == CURL_OFFT_FLOW)
return CURLE_RANGE_ERROR;
while(*ptr && (ISBLANK(*ptr) || (*ptr == '-')))
ptr++;
- to_t = curlx_strtoofft(ptr, &ptr2, 0, &to);
+ to_t = curlx_strtoofft(ptr, &ptr2, 10, &to);
if(to_t == CURL_OFFT_FLOW)
return CURLE_RANGE_ERROR;
if((to_t == CURL_OFFT_INVAL) /* no "to" value given */
@@ -3375,7 +3374,6 @@ CURLcode scp_perform(struct Curl_easy *data,
bool *dophase_done)
{
CURLcode result = CURLE_OK;
- struct connectdata *conn = data->conn;
DEBUGF(infof(data, "DO phase starts"));
@@ -3387,7 +3385,7 @@ CURLcode scp_perform(struct Curl_easy *data,
/* run the state-machine */
result = ssh_multi_statemach(data, dophase_done);
- *connected = conn->bits.tcpconnect[FIRSTSOCKET];
+ *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET);
if(*dophase_done) {
DEBUGF(infof(data, "DO phase is complete"));
@@ -3576,7 +3574,7 @@ CURLcode sftp_perform(struct Curl_easy *data,
/* run the state-machine */
result = ssh_multi_statemach(data, dophase_done);
- *connected = data->conn->bits.tcpconnect[FIRSTSOCKET];
+ *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET);
if(*dophase_done) {
DEBUGF(infof(data, "DO phase is complete"));
diff --git a/Utilities/cmcurl/lib/vssh/wolfssh.c b/Utilities/cmcurl/lib/vssh/wolfssh.c
index c2f85f3..6a8fb56 100644
--- a/Utilities/cmcurl/lib/vssh/wolfssh.c
+++ b/Utilities/cmcurl/lib/vssh/wolfssh.c
@@ -31,6 +31,7 @@
#include <wolfssh/ssh.h>
#include <wolfssh/wolfsftp.h>
#include "urldata.h"
+#include "cfilters.h"
#include "connect.h"
#include "sendf.h"
#include "progress.h"
@@ -836,7 +837,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block)
case SSH_SFTP_READDIR_INIT:
Curl_pgrsSetDownloadSize(data, -1);
- if(data->set.opt_no_body) {
+ if(data->req.no_body) {
state(data, SSH_STOP);
break;
}
@@ -939,7 +940,6 @@ CURLcode wsftp_perform(struct Curl_easy *data,
bool *dophase_done)
{
CURLcode result = CURLE_OK;
- struct connectdata *conn = data->conn;
DEBUGF(infof(data, "DO phase starts"));
@@ -951,7 +951,7 @@ CURLcode wsftp_perform(struct Curl_easy *data,
/* run the state-machine */
result = wssh_multi_statemach(data, dophase_done);
- *connected = conn->bits.tcpconnect[FIRSTSOCKET];
+ *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET);
if(*dophase_done) {
DEBUGF(infof(data, "DO phase is complete"));