summaryrefslogtreecommitdiff
path: root/include/git2/transport.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-09-16 01:47:30 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-09-16 17:02:32 +0200
commit0782fc43f809b1c2a5001453ccb064a4afcfc2b9 (patch)
tree8eb9d299dbafc3e44f5e2251cc464b622319cbba /include/git2/transport.h
parent0fef38999abc74b8237971f96295f461631d9d1d (diff)
downloadlibgit2-0782fc43f809b1c2a5001453ccb064a4afcfc2b9.tar.gz
net: use only structs to pass information about cert
Instead of spreading the data in function arguments, some of which aren't used for ssh and having a struct only for ssh, use a struct for both, using a common parent to pass to the callback.
Diffstat (limited to 'include/git2/transport.h')
-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 06d090f4a..4fa637292 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -24,6 +24,11 @@ GIT_BEGIN_DECL
* Hostkey information taken from libssh2
*/
typedef struct {
+ /**
+ * Type of certificate. Here to share the header with
+ * `git_cert`.
+ */
+ git_cert_t cert_type;
/**
* A hostkey type from libssh2, either
* `LIBSSH2_HOSTKEY_HASH_MD5` or `LIBSSH2_HOSTKEY_HASH_SHA1`
@@ -36,6 +41,25 @@ typedef struct {
unsigned char hash[20];
} git_cert_hostkey;
+/**
+ * X.509 certificate information
+ */
+typedef struct {
+ /**
+ * Type of certificate. Here to share the header with
+ * `git_cert`.
+ */
+ git_cert_t cert_type;
+ /**
+ * Pointer to the X.509 certificate data
+ */
+ void *data;
+ /**
+ * Length of the memory block pointed to by `data`.
+ */
+ size_t len;
+} git_cert_x509;
+
/*
*** Begin interface for credentials acquisition ***
*/