git/gpg-interface.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "commit.h"
#include "config.h"
#include "date.h"
#include "gettext.h"
#include "run-command.h"
#include "strbuf.h"
#include "dir.h"
#include "ident.h"
#include "gpg-interface.h"
#include "path.h"
#include "sigchain.h"
#include "tempfile.h"
#include "alias.h"

static int git_gpg_config(const char *, const char *,
			  const struct config_context *, void *);

static void gpg_interface_lazy_init(void)
{}

static char *configured_signing_key;
static char *ssh_default_key_command;
static char *ssh_allowed_signers;
static char *ssh_revocation_file;
static enum signature_trust_level configured_min_trust_level =;

struct gpg_format {};

static const char *openpgp_verify_args[] =;
static const char *openpgp_sigs[] =;

static const char *x509_verify_args[] =;
static const char *x509_sigs[] =;

static const char *ssh_verify_args[] =;
static const char *ssh_sigs[] =;

static int verify_gpg_signed_buffer(struct signature_check *sigc,
				    struct gpg_format *fmt,
				    const char *signature,
				    size_t signature_size);
static int verify_ssh_signed_buffer(struct signature_check *sigc,
				    struct gpg_format *fmt,
				    const char *signature,
				    size_t signature_size);
static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature,
			   const char *signing_key);
static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
			   const char *signing_key);

static char *get_default_ssh_signing_key(void);

static char *get_ssh_key_id(void);

static struct gpg_format gpg_format[] =;

static struct gpg_format *use_format =;

static struct gpg_format *get_format_by_name(const char *str)
{}

static struct gpg_format *get_format_by_sig(const char *sig)
{}

void signature_check_clear(struct signature_check *sigc)
{}

/* An exclusive status -- only one of them can appear in output */
#define GPG_STATUS_EXCLUSIVE
/* The status includes key identifier */
#define GPG_STATUS_KEYID
/* The status includes user identifier */
#define GPG_STATUS_UID
/* The status includes key fingerprints */
#define GPG_STATUS_FINGERPRINT
/* The status includes trust level */
#define GPG_STATUS_TRUST_LEVEL

/* Short-hand for standard exclusive *SIG status with keyid & UID */
#define GPG_STATUS_STDSIG

static struct {} sigcheck_gpg_status[] =;

/* Keep the order same as enum signature_trust_level */
static struct sigcheck_gpg_trust_level {} sigcheck_gpg_trust_level[] =;

static void replace_cstring(char **field, const char *line, const char *next)
{}

static int parse_gpg_trust_level(const char *level,
				 enum signature_trust_level *res)
{}

static void parse_gpg_output(struct signature_check *sigc)
{}

static int verify_gpg_signed_buffer(struct signature_check *sigc,
				    struct gpg_format *fmt,
				    const char *signature,
				    size_t signature_size)
{}

static void parse_ssh_output(struct signature_check *sigc)
{}

static int verify_ssh_signed_buffer(struct signature_check *sigc,
				    struct gpg_format *fmt,
				    const char *signature,
				    size_t signature_size)
{}

static int parse_payload_metadata(struct signature_check *sigc)
{}

int check_signature(struct signature_check *sigc,
		    const char *signature, size_t slen)
{}

void print_signature_buffer(const struct signature_check *sigc, unsigned flags)
{}

size_t parse_signed_buffer(const char *buf, size_t size)
{}

int parse_signature(const char *buf, size_t size, struct strbuf *payload, struct strbuf *signature)
{}

void set_signing_key(const char *key)
{}

static int git_gpg_config(const char *var, const char *value,
			  const struct config_context *ctx UNUSED,
			  void *cb UNUSED)
{}

/*
 * Returns 1 if `string` contains a literal ssh key, 0 otherwise
 * `key` will be set to the start of the actual key if a prefix is present.
 */
static int is_literal_ssh_key(const char *string, const char **key)
{}

static char *get_ssh_key_fingerprint(const char *signing_key)
{}

/* Returns the first public key from an ssh-agent to use for signing */
static char *get_default_ssh_signing_key(void)
{}

static char *get_ssh_key_id(void)
{}

/* Returns a textual but unique representation of the signing key */
char *get_signing_key_id(void)
{}

char *get_signing_key(void)
{}

const char *gpg_trust_level_to_str(enum signature_trust_level level)
{}

int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *signing_key)
{}

/*
 * Strip CR from the line endings, in case we are on Windows.
 * NEEDSWORK: make it trim only CRs before LFs and rename
 */
static void remove_cr_after(struct strbuf *buffer, size_t offset)
{}

static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature,
			  const char *signing_key)
{}

static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
			   const char *signing_key)
{}