Based on a patch brought by Johnny Luong, libcurl now offers
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and the curl tool --hostpubmd5. They both make the SCP or SFTP connection verify the remote host's md5 checksum of the public key before doing a connect, to reduce the risk of a man-in-the-middle attack.
This commit is contained in:
@@ -1836,7 +1836,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
result = Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
|
||||
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
|
||||
/*
|
||||
* Option to allow for the MD5 of the host public key to be checked
|
||||
* for validation purposes.
|
||||
*/
|
||||
result = Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
case CURLOPT_HTTP_TRANSFER_DECODING:
|
||||
/*
|
||||
* disable libcurl transfer encoding is used
|
||||
|
Reference in New Issue
Block a user