Re: Curl with rsa-sha2-256, rsa-sha2-512

João M. S. Silva via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <CAAv-bCzkCYaptb9PhMac874ucynSynoAQvTAWT+a1yYMpDdzug@mail.gmail.com>
>
> > Note that above I modified curl's source code to set:
>
> >    Set "rsa-sha2-256,rsa-sha2-512"
>
> I'm not sure that's the right move.
>

I have reverted it.


> Either way: a decent way to debug this would to first use the SSH library
> alone with an example program and make sure that works, as then we know
> for
> sure the issue is truly in curl.
>

libssh2 seems to support it since it's using openssl as a cryptographic
library and LIBSSH2_RSA_SHA2 is defined.

But when I upload a file to itself (localhost) it now fails with:

$ curl/src/curl -v -T A -u x:y scp://localhost:/home/shared/B
  % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                 Dload  Upload   Total   Spent    Left
 Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--
  0*   Trying 127.0.0.1:22...
* Connected to localhost (127.0.0.1) port 22 (#0)
* Found host localhost in /home/shared/.ssh/known_hosts
* Set "rsa-sha2-256,rsa-sha2-512,ssh-rsa" as SSH hostkey type
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--
  0* Failure establishing ssh session: -5, Unable to exchange encryption
keys
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--
  0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--
  0
* Closing connection 0
curl: (2) Failure establishing ssh session: -5, Unable to exchange
encryption keys

However, this works:

$ scp -oHostKeyAlgorithms=rsa-sha2-256 A localhost:B

Using the ECDSA key also works.

$ grep  HostKeyAlgorithms   /etc/ssh/sshd_config
HostKeyAlgorithms
rsa-sha2-256,rsa-sha2-512,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521

So, this must be debugged alone in libssh2 or can we get more info from
curl?

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.