cURL / Mailing Lists / curl-library / Single Mail


Re: Getting empty key on CURLOPT_SSH_KEYFUNCTION callback

From: Rubén Durán Balda <>
Date: Fri, 21 Nov 2014 10:35:55 +0100

I forgot to say that I understood this behavior was correct. I had misread
the documentation and was expecting a string, so sorry for the noise.


2014-11-11 10:45 GMT+01:00 Rubén Durán Balda <>:

> Hi,
> I'm trying to write a tests program that is able to show the remote key
> provided by an SSH server and will eventually ask the user to accept or
> decline it. You'll find attached a really simplified version that only
> lists the root folder of a server and tries to print the remote key on
> screen. I'm just telling curl to use a known_host file and to use my custom
> CURLOPT_SSH_KEYFUNCTION (which in the attachment only prints the remote key
> and accepts it).
> I debugged it and the values provided to ssh_keycallback are:
> * match is CURLKHMATCH_MISSING, which is correct since my known_host file
> is empty
> * knownkey is a null pointer, which is correct for the same reason
> * foundkey points to a structure with keytype set to CURLKHTYPE_RSA, len
> set to 0x117 and key set to ""
> I've got this behaviour both with libcurl 7.38.0 and 7.39.0 in Windows and
> with 7.26 en Linux.
> Am I doing anything wrong or is it a bug? If I can provide you with more
> information just ask for it, I tried debugging libcurl and libssh2 but I
> eventually got lost.
> Regards,
> Rubén

*Rubén Durán Balda*Software Engineer
Skype rduran_scati
* ------------------------------* [image:]
T +34 902 116 095
F +34 976 466 580
* ------------------------------*
Bari, 23
Plataforma Logística PLAZA
50.197 Zaragoza (Spain)
* <>*
* ------------------------------*
This e-mail (including any attached documents) is proprietary and
confidential and may contain legally privileged information. It is intended
for the named recipient(s) only. If you are not the intended recipient, you
may not review, retain, copy or distribute this message, and we kindly ask
you to notify the sender by e-mail immediately and delete this message from
your system.
*Please consider your environmental responsibility before printing this

List admin:

Received on 2014-11-21