summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-29 19:38:11 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-29 19:38:11 +0200
commit2c8550f040185fd416eb116c1a043caa8e623ed3 (patch)
treede79403b99a68d31a5732db1341ab65abba491c6 /include
parent64be170d4786f5cc782d8d124cee0c1e2969d60a (diff)
parent8085adf82cbb57487d3ac9acdf0b5bcba92a9a66 (diff)
downloadlibgit2-2c8550f040185fd416eb116c1a043caa8e623ed3.tar.gz
Merge pull request #3157 from mgorny/ssh_memory_auth
Support getting SSH keys from memory, pt. 2
Diffstat (limited to 'include')
-rw-r--r--include/git2/transport.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 99fd09a1b..2eeebd565 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -108,6 +108,13 @@ typedef enum {
* it will ask via this credential type.
*/
GIT_CREDTYPE_USERNAME = (1u << 5),
+
+ /**
+ * Credentials read from memory.
+ *
+ * Only available for libssh2+OpenSSL for now.
+ */
+ GIT_CREDTYPE_SSH_MEMORY = (1u << 6),
} git_credtype_t;
/* The base structure for all credential types */
@@ -291,6 +298,23 @@ GIT_EXTERN(int) git_cred_default_new(git_cred **out);
GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username);
/**
+ * Create a new ssh key credential object reading the keys from memory.
+ *
+ * @param out The newly created credential object.
+ * @param username username to use to authenticate.
+ * @param publickey The public key of the credential.
+ * @param privatekey The private key of the credential.
+ * @param passphrase The passphrase of the credential.
+ * @return 0 for success or an error code for failure
+ */
+GIT_EXTERN(int) git_cred_ssh_key_memory_new(
+ git_cred **out,
+ const char *username,
+ const char *publickey,
+ const char *privatekey,
+ const char *passphrase);
+
+/**
* Signature of a function which acquires a credential object.
*
* - cred: The newly created credential object.