mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 15:33:51 +00:00
ssh: always declare the libssh2 types
This lets a user decide they do want to use keyboard-interactive after they've compiled.
This commit is contained in:
parent
eac63e6754
commit
00b8c216c2
@ -408,17 +408,6 @@ IF (SONAME)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
|
||||||
|
|
||||||
IF (LIBSSH2_FOUND)
|
|
||||||
SET(INCLUDE_LIBSSH2 "#include <libssh2.h>")
|
|
||||||
SET(GIT_SSH_PK_FUNC "typedef LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC((*git_cred_sign_callback));")
|
|
||||||
SET(GIT_SSH_KI_FUNC "typedef LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC((*git_cred_ssh_interactive_callback));")
|
|
||||||
ELSE ()
|
|
||||||
SET(GIT_SSH_PK_FUNC "typedef int (*git_cred_sign_callback)(void *, unsigned char **, size_t *, const unsigned char *, size_t, void **);")
|
|
||||||
SET(GIT_SSH_KI_FUNC "typedef int (*git_cred_ssh_interactive_callback)(const char *, int, const char *, int, int, const void *, void *, void **);")
|
|
||||||
ENDIF ()
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/include/git2/transport.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/git2/transport.h @ONLY)
|
|
||||||
|
|
||||||
|
|
||||||
IF (MSVC_IDE)
|
IF (MSVC_IDE)
|
||||||
# Precompiled headers
|
# Precompiled headers
|
||||||
SET_TARGET_PROPERTIES(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
|
SET_TARGET_PROPERTIES(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
@INCLUDE_LIBSSH2@
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file git2/transport.h
|
* @file git2/transport.h
|
||||||
* @brief Git transport interfaces and functions
|
* @brief Git transport interfaces and functions
|
||||||
@ -59,14 +57,19 @@ typedef struct {
|
|||||||
char *password;
|
char *password;
|
||||||
} git_cred_userpass_plaintext;
|
} git_cred_userpass_plaintext;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This defines the callbacks for custom public key signatures and
|
* If the user hasn't included libssh2.h before git2.h, we need to
|
||||||
* keyboard-interactive authentication. It is replaced at build-time
|
* define a few types for the callback signatures.
|
||||||
* with either the libssh2 signature or a dummy signature that's close
|
|
||||||
* enough but with void pointers instead of libssh2 structures.
|
|
||||||
*/
|
*/
|
||||||
@GIT_SSH_PK_FUNC@
|
#ifndef LIBSSH2_VERSION
|
||||||
@GIT_SSH_KI_FUNC@
|
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
|
* A ssh key from disk
|
Loading…
Reference in New Issue
Block a user