Files
libgit2/include/git2/transport.h
2019-09-13 16:54:40 +02:00

83 lines
1.7 KiB
C

/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_transport_h__
#define INCLUDE_git_transport_h__
#include "indexer.h"
#include "net.h"
#include "types.h"
#include "cred.h"
/**
* @file git2/transport.h
* @brief Git transport interfaces and functions
* @defgroup git_transport interfaces and functions
* @ingroup Git
* @{
*/
GIT_BEGIN_DECL
/** Signature of a function which creates a transport */
typedef int GIT_CALLBACK(git_transport_cb)(git_transport **out, git_remote *owner, void *param);
/**
* Type of SSH host fingerprint
*/
typedef enum {
/** MD5 is available */
GIT_CERT_SSH_MD5 = (1 << 0),
/** SHA-1 is available */
GIT_CERT_SSH_SHA1 = (1 << 1),
} git_cert_ssh_t;
/**
* Hostkey information taken from libssh2
*/
typedef struct {
git_cert parent; /**< The parent cert */
/**
* A hostkey type from libssh2, either
* `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
*/
git_cert_ssh_t type;
/**
* Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
* have the MD5 hash of the hostkey.
*/
unsigned char hash_md5[16];
/**
* Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
* have the SHA-1 hash of the hostkey.
*/
unsigned char hash_sha1[20];
} git_cert_hostkey;
/**
* X.509 certificate information
*/
typedef struct {
git_cert parent; /**< The parent cert */
/**
* Pointer to the X.509 certificate data
*/
void *data;
/**
* Length of the memory block pointed to by `data`.
*/
size_t len;
} git_cert_x509;
/** @} */
GIT_END_DECL
#endif