Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: cert.h
/*
[0] Fix | Delete
* Copyright (C) the libgit2 contributors. All rights reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* This file is part of libgit2, distributed under the GNU GPL v2 with
[3] Fix | Delete
* a Linking Exception. For full terms see the included COPYING file.
[4] Fix | Delete
*/
[5] Fix | Delete
#ifndef INCLUDE_git_cert_h__
[6] Fix | Delete
#define INCLUDE_git_cert_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* @file git2/cert.h
[12] Fix | Delete
* @brief Git certificate objects
[13] Fix | Delete
* @defgroup git_cert Certificate objects
[14] Fix | Delete
* @ingroup Git
[15] Fix | Delete
* @{
[16] Fix | Delete
*/
[17] Fix | Delete
GIT_BEGIN_DECL
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Type of host certificate structure that is passed to the check callback
[21] Fix | Delete
*/
[22] Fix | Delete
typedef enum git_cert_t {
[23] Fix | Delete
/**
[24] Fix | Delete
* No information about the certificate is available. This may
[25] Fix | Delete
* happen when using curl.
[26] Fix | Delete
*/
[27] Fix | Delete
GIT_CERT_NONE,
[28] Fix | Delete
/**
[29] Fix | Delete
* The `data` argument to the callback will be a pointer to
[30] Fix | Delete
* the DER-encoded data.
[31] Fix | Delete
*/
[32] Fix | Delete
GIT_CERT_X509,
[33] Fix | Delete
/**
[34] Fix | Delete
* The `data` argument to the callback will be a pointer to a
[35] Fix | Delete
* `git_cert_hostkey` structure.
[36] Fix | Delete
*/
[37] Fix | Delete
GIT_CERT_HOSTKEY_LIBSSH2,
[38] Fix | Delete
/**
[39] Fix | Delete
* The `data` argument to the callback will be a pointer to a
[40] Fix | Delete
* `git_strarray` with `name:content` strings containing
[41] Fix | Delete
* information about the certificate. This is used when using
[42] Fix | Delete
* curl.
[43] Fix | Delete
*/
[44] Fix | Delete
GIT_CERT_STRARRAY,
[45] Fix | Delete
} git_cert_t;
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* Parent type for `git_cert_hostkey` and `git_cert_x509`.
[49] Fix | Delete
*/
[50] Fix | Delete
struct git_cert {
[51] Fix | Delete
/**
[52] Fix | Delete
* Type of certificate. A `GIT_CERT_` value.
[53] Fix | Delete
*/
[54] Fix | Delete
git_cert_t cert_type;
[55] Fix | Delete
};
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* Callback for the user's custom certificate checks.
[59] Fix | Delete
*
[60] Fix | Delete
* @param cert The host certificate
[61] Fix | Delete
* @param valid Whether the libgit2 checks (OpenSSL or WinHTTP) think
[62] Fix | Delete
* this certificate is valid
[63] Fix | Delete
* @param host Hostname of the host libgit2 connected to
[64] Fix | Delete
* @param payload Payload provided by the caller
[65] Fix | Delete
* @return 0 to proceed with the connection, < 0 to fail the connection
[66] Fix | Delete
* or > 0 to indicate that the callback refused to act and that
[67] Fix | Delete
* the existing validity determination should be honored
[68] Fix | Delete
*/
[69] Fix | Delete
typedef int GIT_CALLBACK(git_transport_certificate_check_cb)(git_cert *cert, int valid, const char *host, void *payload);
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* Type of SSH host fingerprint
[73] Fix | Delete
*/
[74] Fix | Delete
typedef enum {
[75] Fix | Delete
/** MD5 is available */
[76] Fix | Delete
GIT_CERT_SSH_MD5 = (1 << 0),
[77] Fix | Delete
/** SHA-1 is available */
[78] Fix | Delete
GIT_CERT_SSH_SHA1 = (1 << 1),
[79] Fix | Delete
/** SHA-256 is available */
[80] Fix | Delete
GIT_CERT_SSH_SHA256 = (1 << 2),
[81] Fix | Delete
} git_cert_ssh_t;
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Hostkey information taken from libssh2
[85] Fix | Delete
*/
[86] Fix | Delete
typedef struct {
[87] Fix | Delete
git_cert parent; /**< The parent cert */
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* A hostkey type from libssh2, either
[91] Fix | Delete
* `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
[92] Fix | Delete
*/
[93] Fix | Delete
git_cert_ssh_t type;
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
[97] Fix | Delete
* have the MD5 hash of the hostkey.
[98] Fix | Delete
*/
[99] Fix | Delete
unsigned char hash_md5[16];
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
[103] Fix | Delete
* have the SHA-1 hash of the hostkey.
[104] Fix | Delete
*/
[105] Fix | Delete
unsigned char hash_sha1[20];
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Hostkey hash. If type has `GIT_CERT_SSH_SHA256` set, this will
[109] Fix | Delete
* have the SHA-256 hash of the hostkey.
[110] Fix | Delete
*/
[111] Fix | Delete
unsigned char hash_sha256[32];
[112] Fix | Delete
} git_cert_hostkey;
[113] Fix | Delete
[114] Fix | Delete
/**
[115] Fix | Delete
* X.509 certificate information
[116] Fix | Delete
*/
[117] Fix | Delete
typedef struct {
[118] Fix | Delete
git_cert parent; /**< The parent cert */
[119] Fix | Delete
[120] Fix | Delete
/**
[121] Fix | Delete
* Pointer to the X.509 certificate data
[122] Fix | Delete
*/
[123] Fix | Delete
void *data;
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* Length of the memory block pointed to by `data`.
[127] Fix | Delete
*/
[128] Fix | Delete
size_t len;
[129] Fix | Delete
} git_cert_x509;
[130] Fix | Delete
[131] Fix | Delete
/** @} */
[132] Fix | Delete
GIT_END_DECL
[133] Fix | Delete
#endif
[134] Fix | Delete
[135] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function