From 09aa807240b9dcde78a919ff712316a1daf0655e Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sun, 23 Feb 2020 18:37:09 -0500 Subject: libssh: Fix matching user-specified MD5 hex key Prior to this change a match would never be successful because it was mistakenly coded to compare binary data from libssh to a user-specified hex string (ie CURLOPT_SSH_HOST_PUBLIC_KEY_MD5). Reported-by: fds242@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4971 Closes https://github.com/curl/curl/pull/4974 --- tests/data/Makefile.inc | 2 +- tests/data/test664 | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/data/test665 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 tests/data/test664 create mode 100644 tests/data/test665 (limited to 'tests/data') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index dfc74320e..9afbf7437 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -85,7 +85,7 @@ test626 test627 test628 test629 test630 test631 test632 test633 test634 \ test635 test636 test637 test638 test639 test640 test641 test642 \ test643 test644 test645 test646 test647 test648 test649 test650 test651 \ test652 test653 test654 test655 test656 test658 test659 test660 test661 \ -test662 test663 \ +test662 test663 test664 test665 \ \ test700 test701 test702 test703 test704 test705 test706 test707 test708 \ test709 test710 test711 test712 test713 test714 test715 test716 test717 \ diff --git a/tests/data/test664 b/tests/data/test664 new file mode 100644 index 000000000..cb73b248b --- /dev/null +++ b/tests/data/test664 @@ -0,0 +1,44 @@ + + + +SFTP +server key check + + + +# +# Server-side + + +test + + + +# +# Client-side + + +sftp + + +SFTP correct host key + + +--hostpubmd5 %SSHSRVMD5 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%POSIX_PWD/log/file664.txt + + +test + + + +# +# Verify data after the test has been "shot" + + +0 + + +disable + + + diff --git a/tests/data/test665 b/tests/data/test665 new file mode 100644 index 000000000..830adb8f6 --- /dev/null +++ b/tests/data/test665 @@ -0,0 +1,44 @@ + + + +SCP +server key check + + + +# +# Server-side + + +test + + + +# +# Client-side + + +scp + + +SCP correct host key + + +--hostpubmd5 %SSHSRVMD5 --key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%POSIX_PWD/log/file665.txt + + +test + + + +# +# Verify data after the test has been "shot" + + +0 + + +disable + + + -- cgit v1.2.3