1libssh2_knownhost_checkp(3)         libssh2        libssh2_knownhost_checkp(3)
2
3
4

NAME

6       libssh2_knownhost_checkp  -  check a host+key against the list of known
7       hosts
8

SYNOPSIS

10       #include <libssh2.h>
11
12       int
13       libssh2_knownhost_checkp(LIBSSH2_KNOWNHOSTS *hosts,
14                                const char *host, int port,
15                                const char *key, size_t keylen,
16                                int typemask,
17                                struct libssh2_knownhost **knownhost);
18

DESCRIPTION

20       Checks a host and its associated key against the  collection  of  known
21       hosts, and returns info back about the (partially) matched entry.
22
23       host is a pointer the host name in plain text. The host name can be the
24       IP numerical address of the host or the full name.
25
26       port is the port number used by the host (or a negative number to check
27       the  generic host). If the port number is given, libssh2 will check the
28       key for the specific host + port number combination in addition to  the
29       plain host name only check.
30
31       key is a pointer to the key for the given host.
32
33       keylen  is the total size in bytes of the key pointed to by the key ar‐
34       gument
35
36       typemask is a bitmask that specifies format and  info  about  the  data
37       passed  to this function. Specifically, it details what format the host
38       name is, what format the key is and what key type it is.
39
40       The host name is given as one of the  following  types:  LIBSSH2_KNOWN‐
41       HOST_TYPE_PLAIN or LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
42
43       The key is encoded using one of the following encodings: LIBSSH2_KNOWN‐
44       HOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
45
46       knownhost if set to non-NULL, it must be a pointer to  a  'struct  lib‐
47       ssh2_knownhost'  pointer  that  gets filled in to point to info about a
48       known host that matches or partially matches.
49

RETURN VALUE

51       libssh2_knownhost_check(3) returns info about  how  well  the  provided
52       host + key pair matched one of the entries in the list of known hosts.
53
54       LIBSSH2_KNOWNHOST_CHECK_FAILURE  -  something prevented the check to be
55       made
56
57       LIBSSH2_KNOWNHOST_CHECK_NOTFOUND - no host match was found
58
59       LIBSSH2_KNOWNHOST_CHECK_MATCH - hosts and keys match.
60
61       LIBSSH2_KNOWNHOST_CHECK_MISMATCH - host was found, but the keys did not
62       match!
63

AVAILABILITY

65       Added in libssh2 1.2.6
66

EXAMPLE

68       See the ssh2_exec.c example as provided in the tarball.
69

SEE ALSO

71       libssh2_knownhost_init(3)    libssh2_knownhost_free(3)   libssh2_known‐
72       host_add(3)
73
74
75
76libssh2                           1 May 2010       libssh2_knownhost_checkp(3)
Impressum