curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: Unable to parse ECDSA and ed25519 keys

From: Santino KEUPP via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 12 Dec 2019 15:51:37 +0000

It looks like I can fix my problem with the following patch:

diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c
index c71cfbc9f..f13196f55 100644
--- a/lib/vssh/libssh2.c
+++ b/lib/vssh/libssh2.c
@@ -466,8 +466,29 @@ static CURLcode ssh_knownhost(struct connectdata *conn)
      struct curl_khkey *knownkeyp = NULL;
      struct curl_khkey foundkey;

- keybit = (keytype == LIBSSH2_HOSTKEY_TYPE_RSA)?
- LIBSSH2_KNOWNHOST_KEY_SSHRSA:LIBSSH2_KNOWNHOST_KEY_SSHDSS;
+ switch(keytype) {
+ case LIBSSH2_HOSTKEY_TYPE_RSA:
+ keybit = LIBSSH2_KNOWNHOST_KEY_SSHRSA;
+ break;
+ case LIBSSH2_HOSTKEY_TYPE_DSS:
+ keybit = LIBSSH2_KNOWNHOST_KEY_SSHDSS;
+ break;
+ case LIBSSH2_HOSTKEY_TYPE_ECDSA_256:
+ keybit = LIBSSH2_KNOWNHOST_KEY_ECDSA_256;
+ break;
+ case LIBSSH2_HOSTKEY_TYPE_ECDSA_384:
+ keybit = LIBSSH2_KNOWNHOST_KEY_ECDSA_384;
+ break;
+ case LIBSSH2_HOSTKEY_TYPE_ECDSA_521:
+ keybit = LIBSSH2_KNOWNHOST_KEY_ECDSA_521;
+ break;
+ case LIBSSH2_HOSTKEY_TYPE_ED25519:
+ keybit = LIBSSH2_KNOWNHOST_KEY_ED25519;
+ break;
+ default:
+ keybit = LIBSSH2_KNOWNHOST_KEY_UNKNOWN;
+ break;
+ }

#ifdef HAVE_LIBSSH2_KNOWNHOST_CHECKP
      keycheck = libssh2_knownhost_checkp(sshc->kh,


Kind regards,
Santino Keupp

______________________________________________________________________________________________________
Vertraulichkeit
Die uebermittelten Informationen sind ausschliesslich fuer den oben genannten Adressaten bestimmt. Jede Verwendung, Veroeffentlichung, Vervielfaeltigung ist untersagt. Falls diese Mitteilung bei Ihnen irrtuemlich eingegangen ist, geben Sie uns bitte sofort Bescheid.
Confidentiality
The information contained in these documents is intended for the exclusive use of the addressee designated above. Each disclosure, reproduction, distribution is strictly prohibited. If you have received this transmission in error please contact us immediately.
Diehl Metering GmbH
Donaustrasse 120
90451 Nuernberg
Sitz der Gesellschaft: Ansbach, Registergericht: Ansbach HRB 69
Geschäftsführer: Dr. Christof Bosbach (Sprecher), Thomas Gastner, Jean-François Marguet
Informationen zum Datenschutz finden Sie auf unserer Homepage.
https://www.diehl.com/metering/de/diehl-metering/data-protection
Information about data protection can be found on our homepage.
https://www.diehl.com/metering/en/diehl-metering/data-protection

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-12-12