aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-06-05 10:50:59 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-06-05 10:50:59 +0200
commit9e4f9a26d484354d6b7481b5c9bf5b9c7a36f01a (patch)
tree157bba20528e2f0148cda03f4667b296e5683b17
parentf5f8c0fc76890dcf3a6bd32db34e0c8b9110ee19 (diff)
downloadlibssh-9e4f9a26d484354d6b7481b5c9bf5b9c7a36f01a.tar.gz
libssh-9e4f9a26d484354d6b7481b5c9bf5b9c7a36f01a.tar.xz
libssh-9e4f9a26d484354d6b7481b5c9bf5b9c7a36f01a.zip
tests: Allow knownhosts verify test to validate ed25519 and ecdsa
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--tests/client/torture_knownhosts_verify.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/client/torture_knownhosts_verify.c b/tests/client/torture_knownhosts_verify.c
index 323b8e2b..89bb4362 100644
--- a/tests/client/torture_knownhosts_verify.c
+++ b/tests/client/torture_knownhosts_verify.c
@@ -85,12 +85,14 @@ static int session_teardown(void **state)
return 0;
}
-#define KNOWN_HOST_ENTRY "127.0.0.10 ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHOg+9vHW2kJB50j7c7WkcCcOtwgZdeXMpAeEl17sFnTTrT8wYo1FCzE07wV262vIC+AE3fXUJ7sJ/CkFIdk/8/gQEY1jyoXB3Bsee16VwhJGsMzGGh1FJ0XXhRJjUbG18qbH9JiSgE1N4fIM0zJG68fAyUxRxCI1wUobOOB7EmFZd18g==\n"
+#define KNOWN_HOST_ENTRY_ECDSA "127.0.0.10 ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHOg+9vHW2kJB50j7c7WkcCcOtwgZdeXMpAeEl17sFnTTrT8wYo1FCzE07wV262vIC+AE3fXUJ7sJ/CkFIdk/8/gQEY1jyoXB3Bsee16VwhJGsMzGGh1FJ0XXhRJjUbG18qbH9JiSgE1N4fIM0zJG68fAyUxRxCI1wUobOOB7EmFZd18g==\n"
+#define KNOWN_HOST_ENTRY_ED25519 "127.0.0.10 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBWWnxuCYiOyvMYLtkgoEyEKlLV+klM+BU6Nh3PmAiqX"
static void torture_knownhosts_export(void **state)
{
struct torture_state *s = *state;
ssh_session session = s->ssh.session;
char *entry = NULL;
+ char *p = NULL;
int rc;
rc = ssh_connect(session);
@@ -99,7 +101,12 @@ static void torture_knownhosts_export(void **state)
rc = ssh_session_export_known_hosts_entry(session, &entry);
assert_int_equal(rc, SSH_OK);
- assert_string_equal(entry, KNOWN_HOST_ENTRY);
+ p = strstr(entry, "ssh-ed25519");
+ if (p != NULL) {
+ assert_string_equal(entry, KNOWN_HOST_ENTRY_ED25519);
+ } else {
+ assert_string_equal(entry, KNOWN_HOST_ENTRY_ECDSA);
+ }
SAFE_FREE(entry);
}