aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/libssh.h
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-16 18:53:18 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-16 18:53:18 +0200
commit25a21088090dcb18ef6f0b12a47bd1db6b871153 (patch)
tree53ce5494c0dc3157fb445aa6f0ab4b89142553b8 /include/libssh/libssh.h
parent9b84464748d5d4cd67b7868a6cfba5664a169503 (diff)
downloadlibssh-25a21088090dcb18ef6f0b12a47bd1db6b871153.tar.gz
libssh-25a21088090dcb18ef6f0b12a47bd1db6b871153.tar.xz
libssh-25a21088090dcb18ef6f0b12a47bd1db6b871153.zip
pki: Remove session from ssh_pki_import_privkey_* functions.
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r--include/libssh/libssh.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index de3480e..3acb5ae 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -417,6 +417,22 @@ LIBSSH_API int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename);
LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey);
+/**
+ * @brief SSH authentication callback.
+ *
+ * @param prompt Prompt to be displayed.
+ * @param buf Buffer to save the password. You should null-terminate it.
+ * @param len Length of the buffer.
+ * @param echo Enable or disable the echo of what you type.
+ * @param verify Should the password be verified?
+ * @param userdata Userdata to be passed to the callback function. Useful
+ * for GUI applications.
+ *
+ * @return 0 on success, < 0 on error.
+ */
+typedef int (*ssh_auth_callback) (const char *prompt, char *buf, size_t len,
+ int echo, int verify, void *userdata);
+
LIBSSH_API ssh_key ssh_key_new(void);
LIBSSH_API void ssh_key_free (ssh_key key);
LIBSSH_API enum ssh_keytypes_e ssh_key_type(const ssh_key key);
@@ -425,14 +441,17 @@ LIBSSH_API enum ssh_keytypes_e ssh_key_type_from_name(const char *name);
LIBSSH_API int ssh_key_is_public(const ssh_key k);
LIBSSH_API int ssh_key_is_private(const ssh_key k);
-LIBSSH_API int ssh_pki_import_privkey_base64(ssh_session session,
- const char *b64_key,
+LIBSSH_API int ssh_pki_import_privkey_base64(const char *b64_key,
const char *passphrase,
+ ssh_auth_callback auth_fn,
+ void *auth_data,
ssh_key *pkey);
-LIBSSH_API int ssh_pki_import_privkey_file(ssh_session session,
- const char *filename,
- const char *passphrase,
- ssh_key *pkey);
+LIBSSH_API int ssh_pki_import_privkey_file(const char *filename,
+ const char *passphrase,
+ ssh_auth_callback auth_fn,
+ void *auth_data,
+ ssh_key *pkey);
+
LIBSSH_API int ssh_pki_import_pubkey_base64(ssh_session session,
const char *b64_key,
enum ssh_keytypes_e type,