aboutsummaryrefslogtreecommitdiff
path: root/ssh/sshnc.h
diff options
context:
space:
mode:
Diffstat (limited to 'ssh/sshnc.h')
-rw-r--r--ssh/sshnc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssh/sshnc.h b/ssh/sshnc.h
index 3e4bcfe..77edc8d 100644
--- a/ssh/sshnc.h
+++ b/ssh/sshnc.h
@@ -14,8 +14,10 @@
struct sshnc_client;
// Should return 'true' if the key is trusted, 'false' otherwise. The hash is
-// sha256 in byte form, not yet encoded in hexadecimal or similar.
-typedef bool (*sshnc_hostkey_checker_t)(const unsigned char *hash, size_t length);
+// sha256 in byte form, not yet encoded in hexadecimal or similar. The
+// 'userdata' pointer comes from the 'sshnc_connect' invocation.
+typedef bool (*sshnc_hostkey_checker_t)(
+ const unsigned char *hash, size_t length, void *userdata);
// Convenience function to convert a hash to a human-readable form. Returns a
// reference to an internal static buffer.
@@ -55,12 +57,14 @@ const char* sshnc_strerror(enum sshnc_retval code);
// If successful, stores a new connection structure in 'client' and returns
// SSHNC_OK. On error, stores NULL in 'client' and returns an error code.
+// The hostkey checker is invoked with the 'userdata' pointer.
enum sshnc_retval sshnc_connect(
const char *hostname,
int port,
const char *username,
const char *subsystem,
sshnc_hostkey_checker_t checker,
+ void *userdata,
struct sshnc_client **client // output
);