From b68a1e782c4a4567dd5252fac1795804e2c20458 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 9 Jul 2020 23:01:34 +0200 Subject: ssh: Add userdata to sshnc hostkey checker --- ssh/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ssh/client.c') diff --git a/ssh/client.c b/ssh/client.c index b9bd52a..5c7f084 100644 --- a/ssh/client.c +++ b/ssh/client.c @@ -45,7 +45,8 @@ static bool prompt_yn(const char *text) { return response; } -static bool hostkey_checker(const unsigned char *hash, size_t length) { +static bool hostkey_checker(const unsigned char *hash, size_t length, void *userdata) { + (void)userdata; printf("Server host key hash: %s\n", sshnc_print_hash(hash, length)); bool response = prompt_yn( @@ -75,7 +76,7 @@ int main(int argc, char **argv) { struct sshnc_client *client; enum sshnc_retval ret = sshnc_connect( - server_host, port, "tomsg", "tomsg", hostkey_checker, &client); + server_host, port, "tomsg", "tomsg", hostkey_checker, NULL, &client); if (ret != SSHNC_OK) { fprintf(stderr, "Could not connect: %s\n", sshnc_strerror(ret)); -- cgit v1.2.3-54-g00ecf