geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

64 lines
2.4 KiB

  1. .\"
  2. .\" Copyright (c) 2009-2010 by Daniel Stenberg
  3. .\"
  4. .TH libssh2_knownhost_check 3 "1 May 2010" "libssh2 1.2.6" "libssh2 manual"
  5. .SH NAME
  6. libssh2_knownhost_checkp - check a host+key against the list of known hosts
  7. .SH SYNOPSIS
  8. #include <libssh2.h>
  9. int libssh2_knownhost_checkp(LIBSSH2_KNOWNHOSTS *hosts,
  10. const char *host, int port,
  11. const char *key, size_t keylen,
  12. int typemask,
  13. struct libssh2_knownhost **knownhost);
  14. .SH DESCRIPTION
  15. Checks a host and its associated key against the collection of known hosts,
  16. and returns info back about the (partially) matched entry.
  17. \fIhost\fP is a pointer the host name in plain text. The host name can be the
  18. IP numerical address of the host or the full name.
  19. \fIport\fP is the port number used by the host (or a negative number
  20. to check the generic host). If the port number is given, libssh2 will
  21. check the key for the specific host + port number combination in
  22. addition to the plain host name only check.
  23. \fIkey\fP is a pointer to the key for the given host.
  24. \fIkeylen\fP is the total size in bytes of the key pointed to by the \fIkey\fP
  25. argument
  26. \fItypemask\fP is a bitmask that specifies format and info about the data
  27. passed to this function. Specifically, it details what format the host name is,
  28. what format the key is and what key type it is.
  29. The host name is given as one of the following types:
  30. LIBSSH2_KNOWNHOST_TYPE_PLAIN or LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
  31. The key is encoded using one of the following encodings:
  32. LIBSSH2_KNOWNHOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
  33. \fIknownhost\fP if set to non-NULL, it must be a pointer to a 'struct
  34. libssh2_knownhost' pointer that gets filled in to point to info about a known
  35. host that matches or partially matches.
  36. .SH RETURN VALUE
  37. \fIlibssh2_knownhost_check(3)\fP returns info about how well the provided
  38. host + key pair matched one of the entries in the list of known hosts.
  39. LIBSSH2_KNOWNHOST_CHECK_FAILURE - something prevented the check to be made
  40. LIBSSH2_KNOWNHOST_CHECK_NOTFOUND - no host match was found
  41. LIBSSH2_KNOWNHOST_CHECK_MATCH - hosts and keys match.
  42. LIBSSH2_KNOWNHOST_CHECK_MISMATCH - host was found, but the keys didn't match!
  43. .SH AVAILABILITY
  44. Added in libssh2 1.2.6
  45. .SH EXAMPLE
  46. See the ssh2_exec.c example as provided in the tarball.
  47. .SH SEE ALSO
  48. .BR libssh2_knownhost_init(3)
  49. .BR libssh2_knownhost_free(3)
  50. .BR libssh2_knownhost_add(3)