sftp: add the option CURLKHSTAT_FINE_REPLACE

Replace the old fingerprint of the host with a new.

Closes #5685
This commit is contained in:
Michael Musset 2020-07-15 16:39:40 +02:00 committed by Daniel Stenberg
parent ddf47bbc0a
commit ebc6c54c74
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 20 additions and 4 deletions

View file

@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@ -35,6 +35,7 @@ enum curl_khstat {
now so this causes a CURLE_DEFER error but
otherwise the connection will be left intact
etc */
CURLKHSTAT_FINE_REPLACE
};
enum curl_khmatch {
@ -72,7 +73,13 @@ known_hosts file \fIknownkey\fP, the key from the remote site \fIfoundkey\fP,
info from libcurl on the matching status and a custom pointer (set with
\fICURLOPT_SSH_KEYDATA(3)\fP). It MUST return one of the following return
codes to tell libcurl how to act:
.IP CURLKHSTAT_FINE_REPLACE
The new host+key is accepted and libcurl will replace the old host+key into
the known_hosts file before continuing with the connection. This will also
add the new host+key combo to the known_host pool kept in memory if it wasn't
already present there. The adding of data to the file is done by completely
replacing the file with a new copy, so the permissions of the file must allow
this. (Added in 7.73.0)
.IP CURLKHSTAT_FINE_ADD_TO_FILE
The host+key is accepted and libcurl will append it to the known_hosts file
before continuing with the connection. This will also add the host+key combo

View file

@ -311,6 +311,7 @@ CURLKHMATCH_OK 7.19.6
CURLKHSTAT_DEFER 7.19.6
CURLKHSTAT_FINE 7.19.6
CURLKHSTAT_FINE_ADD_TO_FILE 7.19.6
CURLKHSTAT_FINE_REPLACE 7.73.0
CURLKHSTAT_REJECT 7.19.6
CURLKHTYPE_DSS 7.19.6
CURLKHTYPE_ECDSA 7.58.0