summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-07-02 16:45:02 +0200
committerVicent Marti <vicent@github.com>2014-07-02 16:45:02 +0200
commitcb6e68c7e6dc2b87f742f0ea24704fe38d007578 (patch)
tree20e67c8145b52849c82c056456552b568ceff695 /include
parentc1bf2942fcdc90883987c37a782b599d8969e747 (diff)
parent00b8c216c2349d1f5901e9412d95f83c7d043e72 (diff)
downloadlibgit2-cb6e68c7e6dc2b87f742f0ea24704fe38d007578.tar.gz
Merge pull request #2449 from libgit2/cmn/maint-21
Maint fixes for ssl initing and ssh exposure
Diffstat (limited to 'include')
-rw-r--r--include/git2/transport.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h
index af7812b5d..944072632 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -11,10 +11,6 @@
#include "net.h"
#include "types.h"
-#ifdef GIT_SSH
-#include <libssh2.h>
-#endif
-
/**
* @file git2/transport.h
* @brief Git transport interfaces and functions
@@ -61,14 +57,20 @@ typedef struct {
char *password;
} git_cred_userpass_plaintext;
-#ifdef GIT_SSH
-typedef LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC((*git_cred_sign_callback));
-typedef LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC((*git_cred_ssh_interactive_callback));
-#else
-typedef int (*git_cred_sign_callback)(void *, ...);
-typedef int (*git_cred_ssh_interactive_callback)(void *, ...);
+
+/*
+ * If the user hasn't included libssh2.h before git2.h, we need to
+ * define a few types for the callback signatures.
+ */
+#ifndef LIBSSH2_VERSION
+typedef struct _LIBSSH2_SESSION LIBSSH2_SESSION;
+typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT;
+typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE LIBSSH2_USERAUTH_KBDINT_RESPONSE;
#endif
+typedef int (*git_cred_sign_callback)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract);
+typedef int (*git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
+
/**
* A ssh key from disk
*/