2002-06-29 13:46:34 +00:00
|
|
|
/* gpgv.c - The GnuPG signature verify utility
|
2009-03-15 03:10:04 +00:00
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006,
|
2012-01-19 22:33:51 -05:00
|
|
|
* 2009, 2012 Free Software Foundation, Inc.
|
2002-06-29 13:46:34 +00: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-10-23 10:48:09 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2002-06-29 13:46:34 +00: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
|
2007-10-23 10:48:09 +00:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2002-06-29 13:46:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#ifdef HAVE_DOSISH_SYSTEM
|
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c,
options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c,
signal.c, textfilter.c: Edit all preprocessor instructions to remove
whitespace before the '#'. This is not required by C89, but there are some
compilers out there that don't like it.
2003-05-24 21:50:33 +00:00
|
|
|
#include <fcntl.h> /* for setmode() */
|
2002-06-29 13:46:34 +00:00
|
|
|
#endif
|
2005-03-21 20:47:28 +00:00
|
|
|
#ifdef HAVE_LIBREADLINE
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <readline/readline.h>
|
|
|
|
#endif
|
2002-06-29 13:46:34 +00:00
|
|
|
|
|
|
|
#define INCLUDED_BY_MAIN_MODULE 1
|
|
|
|
#include "packet.h"
|
|
|
|
#include "iobuf.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "options.h"
|
|
|
|
#include "keydb.h"
|
|
|
|
#include "trustdb.h"
|
|
|
|
#include "mpi.h"
|
|
|
|
#include "cipher.h"
|
|
|
|
#include "filter.h"
|
|
|
|
#include "ttyio.h"
|
|
|
|
#include "i18n.h"
|
|
|
|
#include "status.h"
|
2004-09-15 18:41:36 +00:00
|
|
|
#include "cardglue.h"
|
2002-06-29 13:46:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
enum cmd_and_opt_values { aNull = 0,
|
|
|
|
oQuiet = 'q',
|
|
|
|
oVerbose = 'v',
|
|
|
|
oBatch = 500,
|
|
|
|
oKeyring,
|
2011-02-23 14:29:59 +01:00
|
|
|
oIgnoreTimeConflict,
|
2002-06-29 13:46:34 +00:00
|
|
|
oStatusFD,
|
|
|
|
oLoggerFD,
|
|
|
|
oHomedir,
|
|
|
|
aTest };
|
|
|
|
|
|
|
|
|
|
|
|
static ARGPARSE_OPTS opts[] = {
|
|
|
|
|
|
|
|
{ 301, NULL, 0, N_("@\nOptions:\n ") },
|
|
|
|
|
|
|
|
{ oVerbose, "verbose", 0, N_("verbose") },
|
|
|
|
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
|
|
|
{ oKeyring, "keyring" ,2, N_("take the keys from this keyring")},
|
2011-02-23 14:29:59 +01:00
|
|
|
{ oIgnoreTimeConflict, "ignore-time-conflict", 0,
|
2002-06-29 13:46:34 +00:00
|
|
|
N_("make timestamp conflicts only a warning") },
|
|
|
|
{ oStatusFD, "status-fd" ,1, N_("|FD|write status info to this FD") },
|
|
|
|
{ oLoggerFD, "logger-fd",1, "@" },
|
|
|
|
{ oHomedir, "homedir", 2, "@" }, /* defaults to "~/.gnupg" */
|
|
|
|
|
|
|
|
{0} };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int g10_errors_seen = 0;
|
|
|
|
|
|
|
|
const char *
|
|
|
|
strusage( int level )
|
|
|
|
{
|
|
|
|
const char *p;
|
|
|
|
switch( level ) {
|
|
|
|
case 11: p = "gpgv (GnuPG)";
|
|
|
|
break;
|
|
|
|
case 13: p = VERSION; break;
|
|
|
|
case 17: p = PRINTABLE_OS_NAME; break;
|
|
|
|
case 19: p =
|
|
|
|
_("Please report bugs to <gnupg-bugs@gnu.org>.\n");
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 40: p =
|
|
|
|
_("Usage: gpgv [options] [files] (-h for help)");
|
|
|
|
break;
|
|
|
|
case 41: p =
|
2009-03-15 03:10:04 +00:00
|
|
|
_("Syntax: gpgv [options] [files]\n"
|
2002-06-29 13:46:34 +00:00
|
|
|
"Check signatures against known trusted keys\n");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: p = default_strusage(level);
|
|
|
|
}
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
i18n_init(void)
|
|
|
|
{
|
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c,
options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c,
signal.c, textfilter.c: Edit all preprocessor instructions to remove
whitespace before the '#'. This is not required by C89, but there are some
compilers out there that don't like it.
2003-05-24 21:50:33 +00:00
|
|
|
#ifdef USE_SIMPLE_GETTEXT
|
2005-01-20 11:42:03 +00:00
|
|
|
set_gettext_file (PACKAGE, "Software\\GNU\\GnuPG");
|
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c,
options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c,
signal.c, textfilter.c: Edit all preprocessor instructions to remove
whitespace before the '#'. This is not required by C89, but there are some
compilers out there that don't like it.
2003-05-24 21:50:33 +00:00
|
|
|
#else
|
|
|
|
#ifdef ENABLE_NLS
|
2004-10-01 10:18:31 +00:00
|
|
|
setlocale( LC_ALL, "" );
|
2006-12-11 19:54:53 +00:00
|
|
|
bindtextdomain (PACKAGE, LOCALEDIR);
|
2002-06-29 13:46:34 +00:00
|
|
|
textdomain( PACKAGE );
|
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c,
options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c,
signal.c, textfilter.c: Edit all preprocessor instructions to remove
whitespace before the '#'. This is not required by C89, but there are some
compilers out there that don't like it.
2003-05-24 21:50:33 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2002-06-29 13:46:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main( int argc, char **argv )
|
|
|
|
{
|
|
|
|
ARGPARSE_ARGS pargs;
|
|
|
|
int rc=0;
|
|
|
|
STRLIST sl;
|
|
|
|
STRLIST nrings=NULL;
|
|
|
|
unsigned configlineno;
|
|
|
|
|
|
|
|
log_set_name("gpgv");
|
|
|
|
init_signals();
|
|
|
|
i18n_init();
|
|
|
|
opt.command_fd = -1; /* no command fd */
|
|
|
|
opt.pgp2_workarounds = 1;
|
2004-04-15 18:16:17 +00:00
|
|
|
opt.keyserver_options.options|=KEYSERVER_AUTO_KEY_RETRIEVE;
|
2002-11-03 20:18:56 +00:00
|
|
|
opt.trust_model = TM_ALWAYS;
|
2002-06-29 13:46:34 +00:00
|
|
|
opt.batch = 1;
|
|
|
|
|
2005-01-20 11:42:03 +00:00
|
|
|
opt.homedir = default_homedir ();
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
tty_no_terminal(1);
|
|
|
|
tty_batchmode(1);
|
2012-01-10 15:16:44 +01:00
|
|
|
dotlock_disable ();
|
2002-09-02 10:59:04 +00:00
|
|
|
|
|
|
|
set_native_charset (NULL); /* Try to auto set the character set */
|
2011-02-23 14:29:59 +01:00
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
pargs.argc = &argc;
|
|
|
|
pargs.argv = &argv;
|
|
|
|
pargs.flags= 1; /* do not remove the args */
|
|
|
|
while( optfile_parse( NULL, NULL, &configlineno, &pargs, opts) ) {
|
|
|
|
switch( pargs.r_opt ) {
|
|
|
|
case oQuiet: opt.quiet = 1; break;
|
|
|
|
case oVerbose: g10_opt_verbose++;
|
|
|
|
opt.verbose++; opt.list_sigs=1; break;
|
|
|
|
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
|
|
|
|
case oStatusFD: set_status_fd( pargs.r.ret_int ); break;
|
|
|
|
case oLoggerFD: log_set_logfile( NULL, pargs.r.ret_int ); break;
|
|
|
|
case oHomedir: opt.homedir = pargs.r.ret_str; break;
|
2003-03-04 15:24:12 +00:00
|
|
|
case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break;
|
2002-06-29 13:46:34 +00:00
|
|
|
default : pargs.err = 2; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( log_get_errorcount(0) )
|
|
|
|
g10_exit(2);
|
|
|
|
|
|
|
|
g10_opt_homedir = opt.homedir;
|
|
|
|
|
|
|
|
if( opt.verbose > 1 )
|
|
|
|
set_packet_list_mode(1);
|
|
|
|
|
|
|
|
if( !nrings ) /* no keyring given: use default one */
|
2009-04-03 10:41:33 +00:00
|
|
|
keydb_add_resource ("trustedkeys" EXTSEP_S "gpg", 8, 0);
|
2002-06-29 13:46:34 +00:00
|
|
|
for(sl = nrings; sl; sl = sl->next )
|
2009-04-03 10:41:33 +00:00
|
|
|
keydb_add_resource (sl->d, 8, 0 );
|
2011-02-23 14:29:59 +01:00
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
FREE_STRLIST(nrings);
|
2011-02-23 14:29:59 +01:00
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
if( (rc = verify_signatures( argc, argv ) ))
|
|
|
|
log_error("verify signatures failed: %s\n", g10_errstr(rc) );
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g10_exit(0);
|
|
|
|
return 8; /*NEVER REACHED*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
g10_exit( int rc )
|
|
|
|
{
|
|
|
|
rc = rc? rc : log_get_errorcount(0)? 2 :
|
|
|
|
g10_errors_seen? 1 : 0;
|
|
|
|
exit(rc );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Stub:
|
2011-02-23 14:29:59 +01:00
|
|
|
* We have to override the trustcheck from pkclist.c becuase
|
2002-06-29 13:46:34 +00:00
|
|
|
* this utility assumes that all keys in the keyring are trustworthy
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
check_signatures_trust( PKT_signature *sig )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-07-21 23:19:15 +00:00
|
|
|
void
|
|
|
|
read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck,
|
2012-01-19 22:33:51 -05:00
|
|
|
byte *marginals,byte *completes,byte *cert_depth,
|
|
|
|
byte *min_cert_level) {}
|
2002-06-29 13:46:34 +00:00
|
|
|
|
2011-02-23 14:29:59 +01:00
|
|
|
/* Stub:
|
2002-06-29 13:46:34 +00:00
|
|
|
* We don't have the trustdb , so we have to provide some stub functions
|
|
|
|
* instead
|
|
|
|
*/
|
2002-12-26 22:22:50 +00:00
|
|
|
|
|
|
|
int
|
* trustdb.h, trustdb.c (is_disabled), gpgv.c (is_disabled): Rename
is_disabled to cache_disabled_value, which now takes a pk and not just the
keyid. This is for speed since there is no need to re-fetch a key when we
already have that key handy. Cache the result of the check so we don't
need to hit the trustdb more than once.
* getkey.c (skip_disabled): New function to get a pk and call is_disabled
on it. (key_byname): Use it here.
* packet.h, getkey.c (skip_disabled), keylist.c (print_capabilities): New
"pk_is_disabled" macro to retrieve the cached disabled value if available,
and fill it in via cache_disabled_value if not available.
* trustdb.c (get_validity): Cache the disabled value since we have it
handy and it might be useful later.
* parse-packet.c (parse_key): Clear disabled flag when parsing a new key.
Just in case someone forgets to clear the whole key.
* getkey.c (merge_selfsigs_main): Add an "if all else fails" path for
setting a single user ID primary when there are multiple set primaries all
at the same second, or no primaries set and the most recent user IDs are
at the same second, or no signed user IDs at all. This is arbitrary, but
deterministic.
* exec.h, photoid.h: Add copyright message.
* keylist.c (list_keyblock_print): Don't dump attribs for
revoked/expired/etc uids for non-colon key listings. This is for
consistency with --show-photos.
* main.h, keylist.c (dump_attribs), mainproc.c (check_sig_and_print): Dump
attribs if --attrib-fd is set when verifying signatures.
* g10.c (main): New --gnupg option to disable the various --openpgp,
--pgpX, etc. options. This is the same as --no-XXXX for those options.
* revoke.c (ask_revocation_reason): Clear old reason if user elects to
repeat question. This is bug 153.
* keyedit.c (sign_uids): Show keyid of the key making the signature.
2003-05-21 16:42:22 +00:00
|
|
|
cache_disabled_value(PKT_public_key *pk)
|
2002-12-26 22:22:50 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-09-30 15:30:39 +00:00
|
|
|
void
|
|
|
|
check_trustdb_stale(void) {}
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
int
|
* armor.c (armor_filter): Comment about PGP's end of line tab problem.
* trustdb.h, trustdb.c (trust_letter): Make static. (get_ownertrust_info,
get_validity_info): Don't mask the trust level twice.
* trustdb.h, gpgv.c, trustdb.c (get_validity, get_validity_info),
keylist.c (list_keyblock_colon), keyedit.c (show_key_with_all_names_colon,
menu_revuid): Pass a user ID in rather than a namehash, so we only have to
do the hashing in one place.
* packet.h, pkclist.c (build_pk_list), free-packet.c
(release_public_key_parts): Remove unused namehash element for public
keys.
2003-01-11 03:57:00 +00:00
|
|
|
get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
|
2002-06-29 13:46:34 +00:00
|
|
|
{
|
|
|
|
return '?';
|
|
|
|
}
|
|
|
|
|
2003-06-03 17:47:58 +00:00
|
|
|
unsigned int
|
|
|
|
get_validity (PKT_public_key *pk, PKT_user_id *uid)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
trust_value_to_string (unsigned int value)
|
|
|
|
{
|
|
|
|
return "err";
|
|
|
|
}
|
|
|
|
|
2004-11-24 05:25:03 +00:00
|
|
|
const char *
|
|
|
|
uid_trust_string_fixed(PKT_public_key *key,PKT_user_id *uid)
|
|
|
|
{
|
|
|
|
return "err";
|
|
|
|
}
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
int
|
|
|
|
get_ownertrust_info (PKT_public_key *pk)
|
|
|
|
{
|
|
|
|
return '?';
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
get_ownertrust (PKT_public_key *pk)
|
|
|
|
{
|
|
|
|
return TRUST_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-12-23 22:17:11 +00:00
|
|
|
/* Stubs:
|
2002-06-29 13:46:34 +00:00
|
|
|
* Because we only work with trusted keys, it does not make sense to
|
|
|
|
* get them from a keyserver
|
|
|
|
*/
|
2006-02-24 14:27:22 +00:00
|
|
|
|
|
|
|
struct keyserver_spec *
|
|
|
|
keyserver_match(struct keyserver_spec *spec) { return NULL; }
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
int
|
|
|
|
keyserver_import_keyid( u32 *keyid, void *dummy )
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-08-05 14:46:59 +00:00
|
|
|
int
|
2005-12-23 22:17:11 +00:00
|
|
|
keyserver_import_cert(const char *name) { return -1; }
|
|
|
|
|
|
|
|
int
|
2006-02-21 22:23:35 +00:00
|
|
|
keyserver_import_pka(const char *name,unsigned char *fpr) { return -1; }
|
2005-08-05 14:46:59 +00:00
|
|
|
|
2005-12-23 21:33:32 +00:00
|
|
|
int
|
2006-02-22 23:37:23 +00:00
|
|
|
keyserver_import_name(const char *name,struct keyserver_spec *spec)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
2005-08-05 14:46:59 +00:00
|
|
|
|
2006-02-21 16:09:09 +00:00
|
|
|
int
|
|
|
|
keyserver_import_ldap(const char *name) { return -1; }
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
/* Stub:
|
|
|
|
* No encryption here but mainproc links to these functions.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
get_session_key( PKT_pubkey_enc *k, DEK *dek )
|
|
|
|
{
|
|
|
|
return G10ERR_GENERAL;
|
|
|
|
}
|
|
|
|
/* Stub: */
|
|
|
|
int
|
|
|
|
get_override_session_key( DEK *dek, const char *string )
|
|
|
|
{
|
|
|
|
return G10ERR_GENERAL;
|
|
|
|
}
|
|
|
|
/* Stub: */
|
|
|
|
int
|
|
|
|
decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
|
|
|
|
{
|
|
|
|
return G10ERR_GENERAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Stub:
|
|
|
|
* No interactive commnds, so we don't need the helptexts
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
display_online_help( const char *keyword )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Stub:
|
|
|
|
* We don't use secret keys, but getkey.c links to this
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
check_secret_key( PKT_secret_key *sk, int n )
|
|
|
|
{
|
|
|
|
return G10ERR_GENERAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Stub:
|
2011-02-23 14:29:59 +01:00
|
|
|
* No secret key, so no passphrase needed
|
2002-06-29 13:46:34 +00:00
|
|
|
*/
|
|
|
|
DEK *
|
|
|
|
passphrase_to_dek( u32 *keyid, int pubkey_algo,
|
|
|
|
int cipher_algo, STRING2KEY *s2k, int mode,
|
2003-04-10 09:56:47 +00:00
|
|
|
const char *tmp, int *canceled)
|
2002-06-29 13:46:34 +00:00
|
|
|
{
|
2003-04-10 09:56:47 +00:00
|
|
|
if (canceled)
|
|
|
|
*canceled = 0;
|
|
|
|
return NULL;
|
2002-06-29 13:46:34 +00:00
|
|
|
}
|
|
|
|
|
2004-05-22 03:50:20 +00:00
|
|
|
struct keyserver_spec *parse_preferred_keyserver(PKT_signature *sig) {return NULL;}
|
2005-07-28 18:59:36 +00:00
|
|
|
struct keyserver_spec *parse_keyserver_uri(const char *uri,int require_scheme,
|
|
|
|
const char *configname,
|
|
|
|
unsigned int configlineno)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-05-22 03:50:20 +00:00
|
|
|
void free_keyserver_spec(struct keyserver_spec *keyserver) {}
|
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
/* Stubs to avoid linking to photoid.c */
|
|
|
|
void show_photos(const struct user_attribute *attrs,int count,PKT_public_key *pk) {}
|
|
|
|
int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len) {return 0;}
|
|
|
|
char *image_type_to_string(byte type,int string) {return NULL;}
|
|
|
|
|
2004-09-24 14:34:45 +00:00
|
|
|
#ifdef ENABLE_CARD_SUPPORT
|
2004-09-15 18:41:36 +00:00
|
|
|
int agent_scd_getattr (const char *name, struct agent_card_info_s *info) {return 0;}
|
2004-09-24 14:34:45 +00:00
|
|
|
#endif /* ENABLE_CARD_SUPPORT */
|
2004-09-15 18:41:36 +00:00
|
|
|
|
2002-06-29 13:46:34 +00:00
|
|
|
/* Stubs to void linking to ../cipher/cipher.c */
|
|
|
|
int string_to_cipher_algo( const char *string ) { return 0; }
|
|
|
|
const char *cipher_algo_to_string( int algo ) { return "?";}
|
|
|
|
void disable_cipher_algo( int algo ) {}
|
|
|
|
int check_cipher_algo( int algo ) { return -1;}
|
|
|
|
unsigned int cipher_get_keylen( int algo ) { return 0; }
|
|
|
|
unsigned int cipher_get_blocksize( int algo ) {return 0;}
|
|
|
|
CIPHER_HANDLE cipher_open( int algo, int mode, int secure ) { return NULL;}
|
|
|
|
void cipher_close( CIPHER_HANDLE c ) {}
|
|
|
|
int cipher_setkey( CIPHER_HANDLE c, byte *key, unsigned keylen ) { return -1;}
|
|
|
|
void cipher_setiv( CIPHER_HANDLE c, const byte *iv, unsigned ivlen ){}
|
|
|
|
void cipher_encrypt( CIPHER_HANDLE c, byte *outbuf,
|
|
|
|
byte *inbuf, unsigned nbytes ) {}
|
|
|
|
void cipher_decrypt( CIPHER_HANDLE c, byte *outbuf,
|
|
|
|
byte *inbuf, unsigned nbytes ) {}
|
|
|
|
void cipher_sync( CIPHER_HANDLE c ) {}
|
|
|
|
|
|
|
|
/* Stubs to avoid linking to ../cipher/random.c */
|
|
|
|
void random_dump_stats(void) {}
|
|
|
|
int quick_random_gen( int onoff ) { return -1;}
|
|
|
|
void randomize_buffer( byte *buffer, size_t length, int level ) {}
|
2013-10-22 14:26:53 +02:00
|
|
|
void randomize_mpi (MPI mpi, size_t nbits, int level) {}
|
2002-06-29 13:46:34 +00:00
|
|
|
int random_is_faked() { return -1;}
|
|
|
|
byte *get_random_bits( size_t nbits, int level, int secure ) { return NULL;}
|
|
|
|
void set_random_seed_file( const char *name ) {}
|
|
|
|
void update_random_seed_file() {}
|
|
|
|
void fast_random_poll() {}
|
|
|
|
|
|
|
|
/* Stubs to avoid linking of ../cipher/primegen.c */
|
|
|
|
void register_primegen_progress ( void (*cb)( void *, int), void *cb_data ) {}
|
|
|
|
MPI generate_secret_prime( unsigned nbits ) { return NULL;}
|
|
|
|
MPI generate_public_prime( unsigned nbits ) { return NULL;}
|
|
|
|
MPI generate_elg_prime( int mode, unsigned pbits, unsigned qbits,
|
|
|
|
MPI g, MPI **ret_factors ) { return NULL;}
|
|
|
|
|
|
|
|
/* Do not link to ../cipher/rndlinux.c */
|
|
|
|
void rndlinux_constructor(void) {}
|
|
|
|
|
|
|
|
|
|
|
|
/* Stubs to avoid linking to ../util/ttyio.c */
|
|
|
|
int tty_batchmode( int onoff ) { return 0; }
|
|
|
|
void tty_printf( const char *fmt, ... ) { }
|
2005-01-20 17:21:40 +00:00
|
|
|
void tty_fprintf (FILE *fp, const char *fmt, ... ) { }
|
2003-10-08 15:21:20 +00:00
|
|
|
void tty_print_string( const byte *p, size_t n ) { }
|
|
|
|
void tty_print_utf8_string( const byte *p, size_t n ) {}
|
|
|
|
void tty_print_utf8_string2( const byte *p, size_t n, size_t max_n ) {}
|
2002-06-29 13:46:34 +00:00
|
|
|
char *tty_get( const char *prompt ) { return NULL;}
|
|
|
|
char *tty_get_hidden( const char *prompt ) {return NULL; }
|
|
|
|
void tty_kill_prompt(void) {}
|
|
|
|
int tty_get_answer_is_yes( const char *prompt ) {return 0;}
|
|
|
|
int tty_no_terminal(int onoff) {return 0;}
|
2009-06-02 15:26:06 +00:00
|
|
|
void tty_cleanup_after_signal (void) {}
|
2010-09-28 10:07:30 +00:00
|
|
|
#ifdef __VMS
|
|
|
|
FILE *ttyfp_is (void) { return stderr; }
|
|
|
|
void init_ttyfp (void) { }
|
|
|
|
#endif /*__VMS*/
|
2005-03-21 20:47:28 +00:00
|
|
|
#ifdef HAVE_LIBREADLINE
|
|
|
|
void tty_enable_completion(rl_completion_func_t *completer) {}
|
|
|
|
void tty_disable_completion(void) {}
|
2011-02-23 14:29:59 +01:00
|
|
|
void rl_cleanup_after_signal (void) {}
|
|
|
|
void rl_free_line_state (void) {}
|
2005-03-21 20:47:28 +00:00
|
|
|
#endif
|
2002-06-29 13:46:34 +00:00
|
|
|
|
|
|
|
/* We do not do any locking, so use these stubs here */
|
2012-01-10 15:16:44 +01:00
|
|
|
void dotlock_disable(void) {}
|
|
|
|
dotlock_t dotlock_create (const char *file_to_lock, unsigned int flags)
|
|
|
|
{ return NULL; }
|
2013-07-12 17:26:55 +09:00
|
|
|
void dotlock_destroy (dotlock_t h, int reclaim) {}
|
2012-01-10 15:16:44 +01:00
|
|
|
int dotlock_take (dotlock_t h, long timeout) { return 0;}
|
|
|
|
int dotlock_release (dotlock_t h) {return 0;}
|
2013-07-16 09:21:54 +09:00
|
|
|
void dotlock_remove_lockfiles (int reclaim) {}
|