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.
 
 
 
 

67 lines
2.5 KiB

  1. .\" Copyright (c) 2009, 2010 by Daniel Stenberg
  2. .\"
  3. .TH libssh2_knownhost_add 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
  4. .SH NAME
  5. libssh2_knownhost_add - add a known host
  6. .SH SYNOPSIS
  7. .nf
  8. #include <libssh2.h>
  9. int libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
  10. char *host, char *salt,
  11. char *key, size_t keylen,
  12. int typemask,
  13. struct libssh2_knownhost **store);
  14. .SH DESCRIPTION
  15. We discourage use of this function as of libssh2 1.2.5. Instead we strongly
  16. urge users to use \fIlibssh2_knownhost_addc(3)\fP instead, which as a more
  17. complete API. \fIlibssh2_knownhost_add(3)\fP is subject for removal in a
  18. future release.
  19. Adds a known host to the collection of known hosts identified by the 'hosts'
  20. handle.
  21. \fIhost\fP is a pointer the host name in plain text or hashed. If hashed, it
  22. must be provided base64 encoded. The host name can be the IP numerical address
  23. of the host or the full name.
  24. \fIsalt\P is a pointer to the salt used for the host hashing, if the host is
  25. provided hashed. If the host is provided in plain text, salt has no meaning.
  26. The salt has to be provided base64 encoded with a trailing zero byte.
  27. \fIkey\fP is a pointer to the key for the given host.
  28. \fIkeylen\fP is the total size in bytes of the key pointed to by the \fIkey\fP
  29. argument
  30. \fItypemask\fP is a bitmask that specifies format and info about the data
  31. passed to this function. Specifically, it details what format the host name is,
  32. what format the key is and what key type it is.
  33. The host name is given as one of the following types:
  34. LIBSSH2_KNOWNHOST_TYPE_PLAIN, LIBSSH2_KNOWNHOST_TYPE_SHA1 or
  35. LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
  36. The key is encoded using one of the following encodings:
  37. LIBSSH2_KNOWNHOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
  38. The key is using one of these algorithms:
  39. LIBSSH2_KNOWNHOST_KEY_RSA1, LIBSSH2_KNOWNHOST_KEY_SSHRSA or
  40. LIBSSH2_KNOWNHOST_KEY_SSHDSS.
  41. \fIstore\fP should point to a pointer that gets filled in to point to the
  42. known host data after the addition. NULL can be passed if you don't care about
  43. this pointer.
  44. .SH RETURN VALUE
  45. Returns a regular libssh2 error code, where negative values are error codes
  46. and 0 indicates success.
  47. .SH AVAILABILITY
  48. Added in libssh2 1.2, deprecated since libssh2 1.2.5. Use
  49. \fIlibssh2_knownhost_addc(3)\fP instead!
  50. .SH SEE ALSO
  51. .BR libssh2_knownhost_init(3)
  52. .BR libssh2_knownhost_free(3)
  53. .BR libssh2_knownhost_check(3)
  54. .BR libssh2_knownhost_addc(3)