2003-06-05 09:14:21 +02:00
|
|
|
/* gpgv.c - The GnuPG signature verify utility
|
2020-02-20 14:59:58 +01:00
|
|
|
* Copyright (C) 1998-2020 Free Software Foundation, Inc.
|
|
|
|
* Copyright (C) 1997-2019 Werner Koch
|
|
|
|
* Copyright (C) 2015-2020 g10 Code GmbH
|
2003-06-05 09:14:21 +02:00
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-04 21:49:40 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-06-05 09:14:21 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GnuPG is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2016-11-05 12:02:19 +01:00
|
|
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
2020-02-20 14:59:58 +01:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2003-06-05 09:14:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <unistd.h>
|
2016-04-06 11:34:11 +02:00
|
|
|
#ifdef HAVE_DOSISH_SYSTEM
|
|
|
|
#include <fcntl.h> /* for setmode() */
|
|
|
|
#endif
|
2006-04-19 13:26:11 +02:00
|
|
|
#ifdef HAVE_LIBREADLINE
|
2006-09-21 15:30:45 +02:00
|
|
|
#define GNUPG_LIBREADLINE_H_INCLUDED
|
2006-04-19 13:26:11 +02:00
|
|
|
#include <readline/readline.h>
|
|
|
|
#endif
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
#define INCLUDED_BY_MAIN_MODULE 1
|
2003-06-18 21:56:13 +02:00
|
|
|
#include "gpg.h"
|
2017-03-07 12:21:23 +01:00
|
|
|
#include "../common/util.h"
|
2003-06-05 09:14:21 +02:00
|
|
|
#include "packet.h"
|
2017-03-07 12:21:23 +01:00
|
|
|
#include "../common/iobuf.h"
|
2003-06-05 09:14:21 +02:00
|
|
|
#include "main.h"
|
|
|
|
#include "options.h"
|
|
|
|
#include "keydb.h"
|
|
|
|
#include "trustdb.h"
|
|
|
|
#include "filter.h"
|
2017-03-07 12:21:23 +01:00
|
|
|
#include "../common/ttyio.h"
|
|
|
|
#include "../common/i18n.h"
|
|
|
|
#include "../common/sysutils.h"
|
|
|
|
#include "../common/status.h"
|
2006-08-16 12:47:53 +02:00
|
|
|
#include "call-agent.h"
|
2012-02-06 20:50:47 +01:00
|
|
|
#include "../common/init.h"
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
enum cmd_and_opt_values {
|
|
|
|
aNull = 0,
|
|
|
|
oQuiet = 'q',
|
|
|
|
oVerbose = 'v',
|
2016-09-08 10:50:51 +02:00
|
|
|
oOutput = 'o',
|
2008-11-13 13:37:45 +01:00
|
|
|
oBatch = 500,
|
|
|
|
oKeyring,
|
2011-02-04 12:57:53 +01:00
|
|
|
oIgnoreTimeConflict,
|
2008-11-13 13:37:45 +01:00
|
|
|
oStatusFD,
|
|
|
|
oLoggerFD,
|
2017-02-24 10:20:41 +01:00
|
|
|
oLoggerFile,
|
2008-11-13 13:37:45 +01:00
|
|
|
oHomedir,
|
2015-10-18 23:35:32 +02:00
|
|
|
oWeakDigest,
|
2016-11-15 20:11:40 +01:00
|
|
|
oEnableSpecialFilenames,
|
2017-02-24 10:20:41 +01:00
|
|
|
oDebug,
|
2024-02-10 14:24:50 +01:00
|
|
|
oAssertPubkeyAlgo,
|
2008-11-13 13:37:45 +01:00
|
|
|
aTest
|
|
|
|
};
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
|
2020-02-20 14:59:58 +01:00
|
|
|
static gpgrt_opt_t opts[] = {
|
2008-11-13 13:37:45 +01:00
|
|
|
ARGPARSE_group (300, N_("@\nOptions:\n ")),
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
|
|
|
|
ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")),
|
2011-02-04 12:57:53 +01:00
|
|
|
ARGPARSE_s_s (oKeyring, "keyring",
|
2008-11-13 13:37:45 +01:00
|
|
|
N_("|FILE|take the keys from the keyring FILE")),
|
2016-09-08 10:50:51 +02:00
|
|
|
ARGPARSE_s_s (oOutput, "output", N_("|FILE|write output to FILE")),
|
2008-11-13 13:37:45 +01:00
|
|
|
ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict",
|
|
|
|
N_("make timestamp conflicts only a warning")),
|
|
|
|
ARGPARSE_s_i (oStatusFD, "status-fd",
|
|
|
|
N_("|FD|write status info to this FD")),
|
|
|
|
ARGPARSE_s_i (oLoggerFD, "logger-fd", "@"),
|
2017-02-24 10:20:41 +01:00
|
|
|
ARGPARSE_s_s (oLoggerFile, "log-file", "@"),
|
2008-11-13 13:37:45 +01:00
|
|
|
ARGPARSE_s_s (oHomedir, "homedir", "@"),
|
2016-05-18 17:00:03 +02:00
|
|
|
ARGPARSE_s_s (oWeakDigest, "weak-digest",
|
|
|
|
N_("|ALGO|reject signatures made with ALGO")),
|
2016-11-15 20:11:40 +01:00
|
|
|
ARGPARSE_s_n (oEnableSpecialFilenames, "enable-special-filenames", "@"),
|
2017-02-24 10:20:41 +01:00
|
|
|
ARGPARSE_s_s (oDebug, "debug", "@"),
|
2024-02-10 14:24:50 +01:00
|
|
|
ARGPARSE_s_s (oAssertPubkeyAlgo,"assert-pubkey-algo", "@"),
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
ARGPARSE_end ()
|
|
|
|
};
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
|
2017-02-24 10:20:41 +01:00
|
|
|
/* The list of supported debug flags. */
|
|
|
|
static struct debug_flags_s debug_flags [] =
|
|
|
|
{
|
|
|
|
{ DBG_PACKET_VALUE , "packet" },
|
|
|
|
{ DBG_MPI_VALUE , "mpi" },
|
|
|
|
{ DBG_CRYPTO_VALUE , "crypto" },
|
|
|
|
{ DBG_FILTER_VALUE , "filter" },
|
|
|
|
{ DBG_IOBUF_VALUE , "iobuf" },
|
|
|
|
{ DBG_MEMORY_VALUE , "memory" },
|
|
|
|
{ DBG_CACHE_VALUE , "cache" },
|
|
|
|
{ DBG_MEMSTAT_VALUE, "memstat" },
|
|
|
|
{ DBG_TRUST_VALUE , "trust" },
|
|
|
|
{ DBG_HASHING_VALUE, "hashing" },
|
|
|
|
{ DBG_IPC_VALUE , "ipc" },
|
|
|
|
{ DBG_CLOCK_VALUE , "clock" },
|
|
|
|
{ DBG_LOOKUP_VALUE , "lookup" },
|
|
|
|
{ DBG_EXTPROG_VALUE, "extprog" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
|
|
|
|
int g10_errors_seen = 0;
|
2023-04-05 21:32:23 +02:00
|
|
|
int assert_signer_true = 0;
|
2024-02-10 14:24:50 +01:00
|
|
|
int assert_pubkey_algo_false = 0;
|
2008-11-13 13:37:45 +01:00
|
|
|
|
2008-11-18 19:01:03 +01:00
|
|
|
static char *
|
|
|
|
make_libversion (const char *libname, const char *(*getfnc)(const char*))
|
|
|
|
{
|
|
|
|
const char *s;
|
|
|
|
char *result;
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2008-11-18 19:01:03 +01:00
|
|
|
s = getfnc (NULL);
|
|
|
|
result = xmalloc (strlen (libname) + 1 + strlen (s) + 1);
|
|
|
|
strcpy (stpcpy (stpcpy (result, libname), " "), s);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2003-06-18 21:56:13 +02:00
|
|
|
static const char *
|
|
|
|
my_strusage( int level )
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2008-11-18 19:01:03 +01:00
|
|
|
static char *ver_gcry;
|
2008-11-13 13:37:45 +01:00
|
|
|
const char *p;
|
2008-11-18 19:01:03 +01:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
switch (level)
|
|
|
|
{
|
2020-02-20 14:59:58 +01:00
|
|
|
case 9: p = "GPL-3.0-or-later"; break;
|
2013-11-18 14:09:47 +01:00
|
|
|
case 11: p = "@GPG@v (GnuPG)";
|
2008-11-13 13:37:45 +01:00
|
|
|
break;
|
|
|
|
case 13: p = VERSION; break;
|
2020-02-20 14:59:58 +01:00
|
|
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
2008-11-13 13:37:45 +01:00
|
|
|
case 17: p = PRINTABLE_OS_NAME; break;
|
2009-07-21 16:21:05 +02:00
|
|
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
case 1:
|
2009-03-17 13:13:32 +01:00
|
|
|
case 40: p = _("Usage: gpgv [options] [files] (-h for help)");
|
2008-11-13 13:37:45 +01:00
|
|
|
break;
|
2009-03-17 13:13:32 +01:00
|
|
|
case 41: p = _("Syntax: gpgv [options] [files]\n"
|
2008-11-13 13:37:45 +01:00
|
|
|
"Check signatures against known trusted keys\n");
|
2003-06-05 09:14:21 +02:00
|
|
|
break;
|
|
|
|
|
2008-11-18 19:01:03 +01:00
|
|
|
case 20:
|
|
|
|
if (!ver_gcry)
|
|
|
|
ver_gcry = make_libversion ("libgcrypt", gcry_check_version);
|
|
|
|
p = ver_gcry;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
default: p = NULL;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
2008-11-13 13:37:45 +01:00
|
|
|
return p;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
int
|
|
|
|
main( int argc, char **argv )
|
|
|
|
{
|
2020-02-20 14:59:58 +01:00
|
|
|
gpgrt_argparse_t pargs;
|
2008-11-13 13:37:45 +01:00
|
|
|
int rc=0;
|
|
|
|
strlist_t sl;
|
2010-10-01 22:33:53 +02:00
|
|
|
strlist_t nrings = NULL;
|
|
|
|
ctrl_t ctrl;
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2015-01-28 19:57:22 +01:00
|
|
|
early_system_init ();
|
2020-02-20 10:03:11 +01:00
|
|
|
gpgrt_set_strusage (my_strusage);
|
Call log_set_prefix() with human-readable labels.
* agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c
* dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c
* g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c
* tests/gpgscm/main.c, tools/gpg-check-pattern.c
* tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c
* tools/symcryptrun.c: Invoke log_set_prefix() with
human-readable labels.
--
Some invocations of log_set_prefix() were done with raw numeric values
instead of values that humans can understand. Use symbolic
representations instead of numeric for better readability.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-08-12 07:37:57 +02:00
|
|
|
log_set_prefix ("gpgv", GPGRT_LOG_WITH_PREFIX);
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
/* Make sure that our subsystems are ready. */
|
2008-12-09 09:58:02 +01:00
|
|
|
i18n_init();
|
2010-03-22 13:46:05 +01:00
|
|
|
init_common_subsystems (&argc, &argv);
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2013-08-19 11:22:11 +02:00
|
|
|
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
gnupg_init_signals (0, NULL);
|
|
|
|
|
|
|
|
opt.command_fd = -1; /* no command fd */
|
2013-08-19 11:22:11 +02:00
|
|
|
opt.keyserver_options.options |= KEYSERVER_AUTO_KEY_RETRIEVE;
|
2008-11-13 13:37:45 +01:00
|
|
|
opt.trust_model = TM_ALWAYS;
|
2016-07-09 03:20:02 +02:00
|
|
|
opt.no_sig_cache = 1;
|
|
|
|
opt.flags.require_cross_cert = 1;
|
2008-11-13 13:37:45 +01:00
|
|
|
opt.batch = 1;
|
2016-09-08 14:34:07 +02:00
|
|
|
opt.answer_yes = 1;
|
2008-11-13 13:37:45 +01:00
|
|
|
|
2015-10-23 23:46:57 +02:00
|
|
|
opt.weak_digests = NULL;
|
2008-11-13 13:37:45 +01:00
|
|
|
|
|
|
|
tty_no_terminal(1);
|
|
|
|
tty_batchmode(1);
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_disable ();
|
2013-08-19 11:22:11 +02:00
|
|
|
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
2015-10-23 23:46:57 +02:00
|
|
|
additional_weak_digest("MD5");
|
2017-09-13 09:18:15 +02:00
|
|
|
gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
pargs.argc = &argc;
|
|
|
|
pargs.argv = &argv;
|
2020-02-20 14:59:58 +01:00
|
|
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
|
|
|
while (gpgrt_argparser (&pargs, opts, NULL))
|
2008-11-13 13:37:45 +01:00
|
|
|
{
|
|
|
|
switch (pargs.r_opt)
|
|
|
|
{
|
2020-02-20 14:59:58 +01:00
|
|
|
case ARGPARSE_CONFFILE: break;
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
case oQuiet: opt.quiet = 1; break;
|
2011-02-04 12:57:53 +01:00
|
|
|
case oVerbose:
|
|
|
|
opt.verbose++;
|
2008-11-13 13:37:45 +01:00
|
|
|
opt.list_sigs=1;
|
|
|
|
gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
|
|
|
|
break;
|
2017-02-24 10:20:41 +01:00
|
|
|
case oDebug:
|
|
|
|
if (parse_debug_flag (pargs.r.ret_str, &opt.debug, debug_flags))
|
|
|
|
{
|
|
|
|
pargs.r_opt = ARGPARSE_INVALID_ARG;
|
|
|
|
pargs.err = ARGPARSE_PRINT_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
2008-11-13 13:37:45 +01:00
|
|
|
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
|
2016-09-08 10:50:51 +02:00
|
|
|
case oOutput: opt.outfile = pargs.r.ret_str; break;
|
2017-02-28 09:35:41 +01:00
|
|
|
case oStatusFD:
|
|
|
|
set_status_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
|
|
|
|
break;
|
2011-02-04 12:57:53 +01:00
|
|
|
case oLoggerFD:
|
2008-11-13 13:37:45 +01:00
|
|
|
log_set_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
|
|
|
|
break;
|
2017-02-24 10:20:41 +01:00
|
|
|
case oLoggerFile:
|
|
|
|
log_set_file (pargs.r.ret_str);
|
|
|
|
log_set_prefix (NULL, (GPGRT_LOG_WITH_PREFIX
|
|
|
|
| GPGRT_LOG_WITH_TIME
|
|
|
|
| GPGRT_LOG_WITH_PID) );
|
|
|
|
break;
|
2016-06-07 10:59:46 +02:00
|
|
|
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
2015-10-18 23:35:32 +02:00
|
|
|
case oWeakDigest:
|
|
|
|
additional_weak_digest(pargs.r.ret_str);
|
|
|
|
break;
|
2008-11-13 13:37:45 +01:00
|
|
|
case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break;
|
2016-11-15 20:11:40 +01:00
|
|
|
case oEnableSpecialFilenames:
|
2016-11-29 16:18:24 +01:00
|
|
|
enable_special_filenames ();
|
2016-11-15 20:11:40 +01:00
|
|
|
break;
|
2024-02-10 14:24:50 +01:00
|
|
|
|
|
|
|
case oAssertPubkeyAlgo:
|
|
|
|
if (!opt.assert_pubkey_algos)
|
|
|
|
opt.assert_pubkey_algos = xstrdup (pargs.r.ret_str);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *tmp = opt.assert_pubkey_algos;
|
|
|
|
opt.assert_pubkey_algos = xstrconcat (tmp, ",",
|
|
|
|
pargs.r.ret_str, NULL);
|
|
|
|
xfree (tmp);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
default : pargs.err = ARGPARSE_PRINT_ERROR; break;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
}
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2020-02-20 14:59:58 +01:00
|
|
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
if (log_get_errorcount (0))
|
|
|
|
g10_exit(2);
|
|
|
|
|
|
|
|
if (opt.verbose > 1)
|
|
|
|
set_packet_list_mode(1);
|
2009-04-03 12:34:22 +02:00
|
|
|
|
2012-12-27 15:04:29 +01:00
|
|
|
/* Note: We open all keyrings in read-only mode. */
|
2009-04-03 12:34:22 +02:00
|
|
|
if (!nrings) /* No keyring given: use default one. */
|
2015-08-07 15:53:56 +02:00
|
|
|
keydb_add_resource ("trustedkeys" EXTSEP_S "kbx",
|
|
|
|
(KEYDB_RESOURCE_FLAG_READONLY
|
|
|
|
|KEYDB_RESOURCE_FLAG_GPGVDEF));
|
2008-11-13 13:37:45 +01:00
|
|
|
for (sl = nrings; sl; sl = sl->next)
|
2016-04-06 11:34:11 +02:00
|
|
|
keydb_add_resource (sl->d, KEYDB_RESOURCE_FLAG_READONLY);
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
FREE_STRLIST (nrings);
|
2010-10-01 22:33:53 +02:00
|
|
|
|
|
|
|
ctrl = xcalloc (1, sizeof *ctrl);
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2010-10-01 22:33:53 +02:00
|
|
|
if ((rc = verify_signatures (ctrl, argc, argv)))
|
2015-01-22 12:06:11 +01:00
|
|
|
log_error("verify signatures failed: %s\n", gpg_strerror (rc) );
|
2011-02-04 12:57:53 +01:00
|
|
|
|
2017-06-21 15:51:10 +02:00
|
|
|
keydb_release (ctrl->cached_getkey_kdb);
|
2010-10-01 22:33:53 +02:00
|
|
|
xfree (ctrl);
|
|
|
|
|
2008-11-13 13:37:45 +01:00
|
|
|
/* cleanup */
|
|
|
|
g10_exit (0);
|
|
|
|
return 8; /*NOTREACHED*/
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2024-02-10 14:24:50 +01:00
|
|
|
g10_exit (int rc)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2024-02-10 14:24:50 +01:00
|
|
|
if (rc)
|
|
|
|
;
|
|
|
|
else if (log_get_errorcount(0))
|
|
|
|
rc = 2;
|
|
|
|
else if (g10_errors_seen)
|
|
|
|
rc = 1;
|
|
|
|
else if (opt.assert_pubkey_algos && assert_pubkey_algo_false)
|
|
|
|
rc = 1;
|
|
|
|
|
|
|
|
exit (rc);
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Stub:
|
2015-11-16 12:41:46 +01:00
|
|
|
* We have to override the trustcheck from pkclist.c because
|
2003-06-05 09:14:21 +02:00
|
|
|
* this utility assumes that all keys in the keyring are trustworthy
|
|
|
|
*/
|
2020-06-08 20:13:25 +02:00
|
|
|
gpg_error_t
|
|
|
|
check_signatures_trust (ctrl_t ctrl, kbnode_t kblock,
|
|
|
|
PKT_public_key *pk, PKT_signature *sig)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2016-05-21 11:41:49 +02:00
|
|
|
(void)ctrl;
|
2020-06-08 20:13:25 +02:00
|
|
|
(void)kblock;
|
|
|
|
(void)pk;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)sig;
|
|
|
|
return 0;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
void
|
2017-03-31 20:03:52 +02:00
|
|
|
read_trust_options (ctrl_t ctrl,
|
|
|
|
byte *trust_model, ulong *created, ulong *nextcheck,
|
|
|
|
byte *marginals, byte *completes, byte *cert_depth,
|
|
|
|
byte *min_cert_level)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
2017-03-31 20:03:52 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)trust_model;
|
|
|
|
(void)created;
|
|
|
|
(void)nextcheck;
|
|
|
|
(void)marginals;
|
|
|
|
(void)completes;
|
|
|
|
(void)cert_depth;
|
2012-01-20 04:33:51 +01:00
|
|
|
(void)min_cert_level;
|
2008-10-20 15:53:23 +02:00
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
/* Stub:
|
2003-06-05 09:14:21 +02:00
|
|
|
* We don't have the trustdb , so we have to provide some stub functions
|
|
|
|
* instead
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2017-03-31 20:03:52 +02:00
|
|
|
cache_disabled_value (ctrl_t ctrl, PKT_public_key *pk)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2017-03-31 20:03:52 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)pk;
|
2003-06-05 09:14:21 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
void
|
2016-05-21 11:41:49 +02:00
|
|
|
check_trustdb_stale (ctrl_t ctrl)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
2016-05-21 11:41:49 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
int
|
2016-11-23 12:29:22 +01:00
|
|
|
get_validity_info (ctrl_t ctrl, kbnode_t kb, PKT_public_key *pk,
|
|
|
|
PKT_user_id *uid)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2016-05-21 11:41:49 +02:00
|
|
|
(void)ctrl;
|
2016-11-23 12:29:22 +01:00
|
|
|
(void)kb;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)pk;
|
|
|
|
(void)uid;
|
|
|
|
return '?';
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int
|
2016-11-23 12:29:22 +01:00
|
|
|
get_validity (ctrl_t ctrl, kbnode_t kb, PKT_public_key *pk, PKT_user_id *uid,
|
2016-05-21 11:41:49 +02:00
|
|
|
PKT_signature *sig, int may_ask)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2016-05-21 11:41:49 +02:00
|
|
|
(void)ctrl;
|
2016-11-23 12:29:22 +01:00
|
|
|
(void)kb;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)pk;
|
|
|
|
(void)uid;
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
(void)sig;
|
|
|
|
(void)may_ask;
|
2003-06-05 09:14:21 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
trust_value_to_string (unsigned int value)
|
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)value;
|
2003-06-05 09:14:21 +02:00
|
|
|
return "err";
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
const char *
|
2016-05-21 11:41:49 +02:00
|
|
|
uid_trust_string_fixed (ctrl_t ctrl, PKT_public_key *key, PKT_user_id *uid)
|
2006-04-19 13:26:11 +02:00
|
|
|
{
|
2016-05-21 11:41:49 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)key;
|
|
|
|
(void)uid;
|
2006-04-19 13:26:11 +02:00
|
|
|
return "err";
|
|
|
|
}
|
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
int
|
2017-03-31 20:03:52 +02:00
|
|
|
get_ownertrust_info (ctrl_t ctrl, PKT_public_key *pk, int no_create)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2017-03-31 20:03:52 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)pk;
|
2017-02-28 20:28:56 +01:00
|
|
|
(void)no_create;
|
2008-10-20 15:53:23 +02:00
|
|
|
return '?';
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int
|
2017-03-31 20:03:52 +02:00
|
|
|
get_ownertrust (ctrl_t ctrl, PKT_public_key *pk)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2017-03-31 20:03:52 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)pk;
|
|
|
|
return TRUST_UNKNOWN;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
2024-04-17 12:16:20 +02:00
|
|
|
const char *
|
|
|
|
get_ownertrust_string (ctrl_t ctrl, PKT_public_key *pk, int no_create)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)pk;
|
|
|
|
(void)no_create;
|
|
|
|
return "";
|
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
/* Stubs:
|
2003-06-05 09:14:21 +02:00
|
|
|
* Because we only work with trusted keys, it does not make sense to
|
|
|
|
* get them from a keyserver
|
|
|
|
*/
|
2006-04-19 13:26:11 +02:00
|
|
|
|
|
|
|
struct keyserver_spec *
|
2008-10-20 15:53:23 +02:00
|
|
|
keyserver_match (struct keyserver_spec *spec)
|
|
|
|
{
|
|
|
|
(void)spec;
|
2011-02-04 12:57:53 +01:00
|
|
|
return NULL;
|
2008-10-20 15:53:23 +02:00
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2016-01-21 11:49:27 +01:00
|
|
|
int
|
|
|
|
keyserver_any_configured (ctrl_t ctrl)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
int
|
2021-04-16 20:21:23 +02:00
|
|
|
keyserver_import_keyid (u32 *keyid, void *dummy, unsigned int flags)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)keyid;
|
|
|
|
(void)dummy;
|
2021-04-16 20:21:23 +02:00
|
|
|
(void)flags;
|
2008-10-20 15:53:23 +02:00
|
|
|
return -1;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
2016-06-20 23:58:16 +02:00
|
|
|
int
|
|
|
|
keyserver_import_fprint (ctrl_t ctrl, const byte *fprint,size_t fprint_len,
|
2021-04-16 20:21:23 +02:00
|
|
|
struct keyserver_spec *keyserver, unsigned int flags)
|
2016-06-20 23:58:16 +02:00
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)fprint;
|
|
|
|
(void)fprint_len;
|
|
|
|
(void)keyserver;
|
2021-04-16 20:21:23 +02:00
|
|
|
(void)flags;
|
2016-06-20 23:58:16 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2021-04-21 18:32:21 +02:00
|
|
|
int
|
|
|
|
keyserver_import_fprint_ntds (ctrl_t ctrl,
|
|
|
|
const byte *fprint, size_t fprint_len)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)fprint;
|
|
|
|
(void)fprint_len;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
int
|
2008-10-20 15:53:23 +02:00
|
|
|
keyserver_import_cert (const char *name)
|
|
|
|
{
|
|
|
|
(void)name;
|
2011-02-04 12:57:53 +01:00
|
|
|
return -1;
|
2008-10-20 15:53:23 +02:00
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2016-04-27 08:34:29 +02:00
|
|
|
gpg_error_t
|
2021-04-16 20:21:23 +02:00
|
|
|
keyserver_import_wkd (ctrl_t ctrl, const char *name, unsigned int flags,
|
2016-04-27 08:34:29 +02:00
|
|
|
unsigned char **fpr, size_t *fpr_len)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)name;
|
2021-04-16 20:21:23 +02:00
|
|
|
(void)flags;
|
2016-04-27 08:34:29 +02:00
|
|
|
(void)fpr;
|
|
|
|
(void)fpr_len;
|
|
|
|
return GPG_ERR_BUG;
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
int
|
2021-04-26 15:32:51 +02:00
|
|
|
keyserver_import_mbox (const char *name,struct keyserver_spec *spec)
|
2006-04-19 13:26:11 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)name;
|
|
|
|
(void)spec;
|
2006-04-19 13:26:11 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-12-17 18:18:52 +01:00
|
|
|
int
|
|
|
|
keyserver_import_ntds (ctrl_t ctrl, const char *mbox,
|
|
|
|
unsigned char **fpr, size_t *fprlen)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)mbox;
|
|
|
|
(void)fpr;
|
|
|
|
(void)fprlen;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
int
|
2008-10-20 15:53:23 +02:00
|
|
|
keyserver_import_ldap (const char *name)
|
|
|
|
{
|
|
|
|
(void)name;
|
|
|
|
return -1;
|
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2016-07-06 14:03:50 +02:00
|
|
|
|
|
|
|
gpg_error_t
|
2020-03-13 17:14:34 +01:00
|
|
|
read_key_from_file_or_buffer (ctrl_t ctrl, const char *fname,
|
|
|
|
const void *buffer, size_t buflen,
|
|
|
|
kbnode_t *r_keyblock)
|
2016-07-06 14:03:50 +02:00
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)fname;
|
2020-03-13 17:14:34 +01:00
|
|
|
(void)buffer;
|
|
|
|
(void)buflen;
|
2016-07-06 14:03:50 +02:00
|
|
|
(void)r_keyblock;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-03-13 17:14:34 +01:00
|
|
|
gpg_error_t
|
|
|
|
import_included_key_block (ctrl_t ctrl, kbnode_t keyblock)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)keyblock;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-07-06 14:03:50 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
/* Stub:
|
|
|
|
* No encryption here but mainproc links to these functions.
|
|
|
|
*/
|
2010-04-21 19:30:07 +02:00
|
|
|
gpg_error_t
|
2018-08-27 06:12:31 +02:00
|
|
|
get_session_key (ctrl_t ctrl, struct pubkey_enc_list *k, DEK *dek)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2015-11-03 23:15:27 +01:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)k;
|
|
|
|
(void)dek;
|
2015-01-22 12:06:11 +01:00
|
|
|
return GPG_ERR_GENERAL;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
2008-10-20 15:53:23 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
/* Stub: */
|
2010-04-21 19:30:07 +02:00
|
|
|
gpg_error_t
|
2008-10-20 15:53:23 +02:00
|
|
|
get_override_session_key (DEK *dek, const char *string)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)dek;
|
|
|
|
(void)string;
|
2015-01-22 12:06:11 +01:00
|
|
|
return GPG_ERR_GENERAL;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
2008-10-20 15:53:23 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
/* Stub: */
|
|
|
|
int
|
2022-03-18 11:13:23 +01:00
|
|
|
decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
|
|
|
|
int *compliance_error)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2010-10-01 22:33:53 +02:00
|
|
|
(void)ctrl;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)procctx;
|
|
|
|
(void)ed;
|
|
|
|
(void)dek;
|
2022-03-18 11:13:23 +01:00
|
|
|
(void)compliance_error;
|
2015-01-22 12:06:11 +01:00
|
|
|
return GPG_ERR_GENERAL;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Stub:
|
2008-10-20 15:53:23 +02:00
|
|
|
* No interactive commands, so we don't need the helptexts
|
2003-06-05 09:14:21 +02:00
|
|
|
*/
|
|
|
|
void
|
2008-10-20 15:53:23 +02:00
|
|
|
display_online_help (const char *keyword)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)keyword;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Stub:
|
|
|
|
* We don't use secret keys, but getkey.c links to this
|
|
|
|
*/
|
|
|
|
int
|
2010-04-20 19:57:50 +02:00
|
|
|
check_secret_key (PKT_public_key *pk, int n)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2010-04-20 19:57:50 +02:00
|
|
|
(void)pk;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)n;
|
2015-01-22 12:06:11 +01:00
|
|
|
return GPG_ERR_GENERAL;
|
2003-06-05 09:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Stub:
|
2011-02-04 12:57:53 +01:00
|
|
|
* No secret key, so no passphrase needed
|
2003-06-05 09:14:21 +02:00
|
|
|
*/
|
|
|
|
DEK *
|
2016-08-08 18:45:29 +02:00
|
|
|
passphrase_to_dek (int cipher_algo, STRING2KEY *s2k, int create, int nocache,
|
2021-05-17 19:27:54 +02:00
|
|
|
const char *tmp, unsigned int flags, int *canceled)
|
2003-06-05 09:14:21 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)cipher_algo;
|
|
|
|
(void)s2k;
|
2016-08-08 18:45:29 +02:00
|
|
|
(void)create;
|
|
|
|
(void)nocache;
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)tmp;
|
2021-05-17 19:27:54 +02:00
|
|
|
(void)flags;
|
2008-10-20 15:53:23 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
if (canceled)
|
|
|
|
*canceled = 0;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-08-20 10:41:15 +02:00
|
|
|
void
|
2016-08-08 18:45:29 +02:00
|
|
|
passphrase_clear_cache (const char *cacheid)
|
2009-08-20 10:41:15 +02:00
|
|
|
{
|
|
|
|
(void)cacheid;
|
|
|
|
}
|
|
|
|
|
2008-10-20 15:53:23 +02:00
|
|
|
struct keyserver_spec *
|
2011-02-04 12:57:53 +01:00
|
|
|
parse_preferred_keyserver(PKT_signature *sig)
|
2006-04-19 13:26:11 +02:00
|
|
|
{
|
2008-10-20 15:53:23 +02:00
|
|
|
(void)sig;
|
2006-04-19 13:26:11 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-10-20 15:53:23 +02:00
|
|
|
struct keyserver_spec *
|
|
|
|
parse_keyserver_uri (const char *uri, int require_scheme,
|
|
|
|
const char *configname, unsigned int configlineno)
|
|
|
|
{
|
|
|
|
(void)uri;
|
|
|
|
(void)require_scheme;
|
|
|
|
(void)configname;
|
|
|
|
(void)configlineno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
void
|
2008-10-20 15:53:23 +02:00
|
|
|
free_keyserver_spec (struct keyserver_spec *keyserver)
|
|
|
|
{
|
|
|
|
(void)keyserver;
|
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
|
2003-06-05 09:14:21 +02:00
|
|
|
/* Stubs to avoid linking to photoid.c */
|
2011-02-04 12:57:53 +01:00
|
|
|
void
|
2008-10-20 15:53:23 +02:00
|
|
|
show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk)
|
|
|
|
{
|
|
|
|
(void)attrs;
|
|
|
|
(void)count;
|
|
|
|
(void)pk;
|
|
|
|
}
|
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
int
|
2008-10-20 15:53:23 +02:00
|
|
|
parse_image_header (const struct user_attribute *attr, byte *type, u32 *len)
|
|
|
|
{
|
|
|
|
(void)attr;
|
|
|
|
(void)type;
|
|
|
|
(void)len;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
image_type_to_string (byte type, int string)
|
|
|
|
{
|
|
|
|
(void)type;
|
|
|
|
(void)string;
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2006-04-19 13:26:11 +02:00
|
|
|
#ifdef ENABLE_CARD_SUPPORT
|
2011-02-04 12:57:53 +01:00
|
|
|
int
|
2008-10-20 15:53:23 +02:00
|
|
|
agent_scd_getattr (const char *name, struct agent_card_info_s *info)
|
|
|
|
{
|
|
|
|
(void)name;
|
|
|
|
(void)info;
|
|
|
|
return 0;
|
|
|
|
}
|
2006-04-19 13:26:11 +02:00
|
|
|
#endif /* ENABLE_CARD_SUPPORT */
|
|
|
|
|
2008-10-20 15:53:23 +02:00
|
|
|
/* We do not do any locking, so use these stubs here */
|
2011-02-04 12:57:53 +01:00
|
|
|
void
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_disable (void)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
dotlock_t
|
2011-09-28 15:41:58 +02:00
|
|
|
dotlock_create (const char *file_to_lock, unsigned int flags)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
(void)file_to_lock;
|
2011-09-28 15:41:58 +02:00
|
|
|
(void)flags;
|
2008-10-20 15:53:23 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
void
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_destroy (dotlock_t h)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
(void)h;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_take (dotlock_t h, long timeout)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
(void)h;
|
|
|
|
(void)timeout;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_release (dotlock_t h)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
(void)h;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
void
|
2011-09-23 14:43:58 +02:00
|
|
|
dotlock_remove_lockfiles (void)
|
2008-10-20 15:53:23 +02:00
|
|
|
{
|
|
|
|
}
|
2003-06-05 09:14:21 +02:00
|
|
|
|
2020-01-17 07:11:02 +01:00
|
|
|
int
|
2010-04-21 18:26:17 +02:00
|
|
|
agent_probe_secret_key (ctrl_t ctrl, PKT_public_key *pk)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)pk;
|
2020-01-17 07:11:02 +01:00
|
|
|
return 0;
|
2010-04-21 18:26:17 +02:00
|
|
|
}
|
2010-10-13 17:57:08 +02:00
|
|
|
|
|
|
|
gpg_error_t
|
|
|
|
agent_probe_any_secret_key (ctrl_t ctrl, kbnode_t keyblock)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)keyblock;
|
|
|
|
return gpg_error (GPG_ERR_NO_SECKEY);
|
|
|
|
}
|
|
|
|
|
|
|
|
gpg_error_t
|
2016-06-10 22:15:33 +02:00
|
|
|
agent_get_keyinfo (ctrl_t ctrl, const char *hexkeygrip,
|
|
|
|
char **r_serialno, int *r_cleartext)
|
2010-10-13 17:57:08 +02:00
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)hexkeygrip;
|
2016-06-10 22:15:33 +02:00
|
|
|
(void)r_cleartext;
|
2010-10-13 17:57:08 +02:00
|
|
|
*r_serialno = NULL;
|
|
|
|
return gpg_error (GPG_ERR_NO_SECKEY);
|
|
|
|
}
|
2015-04-23 15:42:56 +02:00
|
|
|
|
2015-10-08 15:04:45 +02:00
|
|
|
gpg_error_t
|
|
|
|
export_pubkey_buffer (ctrl_t ctrl, const char *keyspec, unsigned int options,
|
2020-03-13 13:17:51 +01:00
|
|
|
const void *prefix, size_t prefixlen,
|
2015-11-12 16:02:35 +01:00
|
|
|
export_stats_t stats,
|
2015-10-08 15:04:45 +02:00
|
|
|
kbnode_t *r_keyblock, void **r_data, size_t *r_datalen)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)keyspec;
|
|
|
|
(void)options;
|
2020-03-13 13:17:51 +01:00
|
|
|
(void)prefix;
|
|
|
|
(void)prefixlen;
|
2015-11-12 16:02:35 +01:00
|
|
|
(void)stats;
|
2015-10-08 15:04:45 +02:00
|
|
|
|
|
|
|
*r_keyblock = NULL;
|
|
|
|
*r_data = NULL;
|
|
|
|
*r_datalen = 0;
|
|
|
|
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
|
|
|
|
}
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
|
2016-08-25 09:26:36 +02:00
|
|
|
gpg_error_t
|
|
|
|
tofu_write_tfs_record (ctrl_t ctrl, estream_t fp,
|
|
|
|
PKT_public_key *pk, const char *user_id)
|
|
|
|
{
|
|
|
|
(void)ctrl;
|
|
|
|
(void)fp;
|
|
|
|
(void)pk;
|
|
|
|
(void)user_id;
|
|
|
|
return gpg_error (GPG_ERR_GENERAL);
|
|
|
|
}
|
|
|
|
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
gpg_error_t
|
2016-05-21 12:26:44 +02:00
|
|
|
tofu_get_policy (ctrl_t ctrl, PKT_public_key *pk, PKT_user_id *user_id,
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
enum tofu_policy *policy)
|
|
|
|
{
|
2016-05-21 12:26:44 +02:00
|
|
|
(void)ctrl;
|
g10: Add TOFU support.
* configure.ac: Check for sqlite3.
(SQLITE3_CFLAGS): AC_SUBST it.
(SQLITE3_LIBS): Likewise.
* g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS).
(gpg2_SOURCES): Add tofu.h and tofu.c.
(gpg2_LDADD): Add $(SQLITE3_LIBS).
* g10/tofu.c: New file.
* g10/tofu.h: New file.
* g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP.
(tofu_db_format): Define.
* g10/packet.h (PKT_signature): Add fields digest and digest_len.
* g10/gpg.c: Include "tofu.h".
(cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy,
oTOFUDBFormat.
(opts): Add them.
(parse_trust_model): Recognize the tofu and tofu+pgp trust models.
(parse_tofu_policy): New function.
(parse_tofu_db_format): New function.
(main): Initialize opt.tofu_default_policy and opt.tofu_db_format.
Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat.
* g10/mainproc.c (do_check_sig): If the signature is good, copy the
hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately.
* g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update
callers.
(tdb_get_validity_core): Add arguments sig and may_ask. Update
callers.
* g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them
to tdb_get_validity_core.
* g10/trustdb.c: Include "tofu.h".
(trust_model_string): Handle TM_TOFU and TM_TOFU_PGP.
(tdb_get_validity_core): Add arguments sig and may_ask. If
OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust
level. Combine it with the computed PGP trust level, if appropriate.
* g10/keyedit.c: Include "tofu.h".
(show_key_with_all_names_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/keylist.c: Include "tofu.h".
(public_key_list): Also show the PGP stats if the trust model is
TM_TOFU_PGP.
(list_keyblock_colon): If the trust mode is tofu or
tofu+pgp, then show the trust policy.
* g10/pkclist.c: Include "tofu.h".
* g10/gpgv.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* g10/test-stubs.c (get_validity): Add arguments sig and may_ask.
(enum tofu_policy): Define.
(tofu_get_policy): New stub.
(tofu_policy_str): Likewise.
* doc/DETAILS: Describe the TOFU Policy field.
* doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu,
--trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format.
* tests/openpgp/Makefile.am (TESTS): Add tofu.test.
(TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc,
tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt.
(CLEANFILES): Add tofu.db.
(clean-local): Add tofu.d.
* tests/openpgp/tofu.test: New file.
* tests/openpgp/tofu-2183839A-1.txt: New file.
* tests/openpgp/tofu-BC15C85A-1.txt: New file.
* tests/openpgp/tofu-EE37CF96-1.txt: New file.
* tests/openpgp/tofu-keys.asc: New file.
* tests/openpgp/tofu-keys-secret.asc: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
2015-10-18 18:44:05 +02:00
|
|
|
(void)pk;
|
|
|
|
(void)user_id;
|
|
|
|
(void)policy;
|
|
|
|
return gpg_error (GPG_ERR_GENERAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
tofu_policy_str (enum tofu_policy policy)
|
|
|
|
{
|
|
|
|
(void)policy;
|
|
|
|
|
|
|
|
return "unknown";
|
|
|
|
}
|
2015-10-23 17:23:17 +02:00
|
|
|
|
|
|
|
void
|
2016-08-05 14:40:36 +02:00
|
|
|
tofu_begin_batch_update (ctrl_t ctrl)
|
2015-10-23 17:23:17 +02:00
|
|
|
{
|
2016-08-05 14:40:36 +02:00
|
|
|
(void)ctrl;
|
2015-10-23 17:23:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-08-05 14:40:36 +02:00
|
|
|
tofu_end_batch_update (ctrl_t ctrl)
|
2015-10-23 17:23:17 +02:00
|
|
|
{
|
2016-08-05 14:40:36 +02:00
|
|
|
(void)ctrl;
|
2015-10-23 17:23:17 +02:00
|
|
|
}
|
g10: Cache the effective policy. Recompute it when required.
* g10/tofu.c (initdb): Add column effective_policy to the bindings
table.
(record_binding): New parameters effective_policy and set_conflict.
Save the effective policy. If SET_CONFLICT is set, then set conflict
according to CONFLICT. Otherwise, preserve the current value of
conflict. Update callers.
(get_trust): Don't compute the effective policy here...
(get_policy): ... do it here, if it was not cached. Take new
parameters, PK, the public key, and NOW, the time that the operation
started. Update callers.
(show_statistics): New parameter PK. Pass it to get_policy. Update
callers.
(tofu_notice_key_changed): New function.
* g10/gpgv.c (tofu_notice_key_changed): New stub.
* g10/import.c (import_revoke_cert): Take additional argument CTRL.
Pass it to keydb_update_keyblock.
* g10/keydb.c (keydb_update_keyblock): Take additional argument CTRL.
Update callers.
[USE_TOFU]: Call tofu_notice_key_changed.
* g10/test-stubs.c (tofu_notice_key_changed): New stub.
* tests/openpgp/tofu.scm: Assume that manually setting a binding's
policy to auto does not cause the tofu engine to forget about any
conflict.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
We now store the computed policy in the tofu DB (in the
effective_policy column of the bindings table) to avoid computing it
every time, which is expensive. Further, policy is never overridden
in case of a conflict. Instead, we detect a conflict if CONFLICT is
not empty.
This change is backwards compatible to existing DBs. The only minor
incompatibility is that unresolved conflicts won't be automatically
resolved in case we import a direct signature, or cross signatures.
2016-11-21 22:47:30 +01:00
|
|
|
|
|
|
|
gpg_error_t
|
|
|
|
tofu_notice_key_changed (ctrl_t ctrl, kbnode_t kb)
|
|
|
|
{
|
|
|
|
(void) ctrl;
|
|
|
|
(void) kb;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-06-21 20:28:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
get_revocation_reason (PKT_signature *sig, char **r_reason,
|
|
|
|
char **r_comment, size_t *r_commentlen)
|
|
|
|
{
|
|
|
|
(void)sig;
|
|
|
|
(void)r_commentlen;
|
|
|
|
|
|
|
|
if (r_reason)
|
|
|
|
*r_reason = NULL;
|
|
|
|
if (r_comment)
|
|
|
|
*r_comment = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
2022-11-25 16:04:54 +01:00
|
|
|
|
|
|
|
const char *
|
|
|
|
impex_filter_getval (void *cookie, const char *propname)
|
|
|
|
{
|
|
|
|
(void)cookie;
|
|
|
|
(void)propname;
|
|
|
|
return NULL;
|
|
|
|
}
|