Blob Blame History Raw
From a57cd03551cb373bd69278d7281026ac147bb4b4 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 7 Nov 2016 12:54:40 +0100
Subject: [PATCH 1/2] ssh: check md5 fingerprints case insensitively
 (regression)

Revert the change from ce8d09483eea but use the new function

Reported-by: Kamil Dudka
Bug: https://github.com/curl/curl/commit/ce8d09483eea2fcb1b50e323e1a8ed1f3613b2e3#commitcomment-19666146

Upstream-commit: 50aded1cd4bb751cad52c39c4fa1f06ebc5e133e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
 lib/ssh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ssh.c b/lib/ssh.c
index 43c8283..0df030d 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -676,7 +676,7 @@ static CURLcode ssh_check_fingerprint(struct connectdata *conn)
    * against a known fingerprint, if available.
    */
   if(pubkey_md5 && strlen(pubkey_md5) == 32) {
-    if(!fingerprint || strcmp(md5buffer, pubkey_md5)) {
+    if(!fingerprint || !strcasecompare(md5buffer, pubkey_md5)) {
       if(fingerprint)
         failf(data,
             "Denied establishing ssh session: mismatch md5 fingerprint. "
-- 
2.7.4