1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

Cleaned up unused gpgsm and gpg options.

This commit is contained in:
Werner Koch 2008-11-13 12:37:45 +00:00
parent 329509c864
commit 4b3389b7bd
34 changed files with 8661 additions and 8807 deletions

4
TODO
View File

@ -90,6 +90,10 @@
* UTF-8 specific TODOs * UTF-8 specific TODOs
None. None.
* Manual
** Document all gpgsm options.
* Pinpad Reader * Pinpad Reader
We do not yet support P15 applications. The trivial thing using We do not yet support P15 applications. The trivial thing using
ASCII characters will be easy to implement but the other cases need ASCII characters will be easy to implement but the other cases need

View File

@ -1,3 +1,7 @@
2008-11-13 Werner Koch <wk@g10code.com>
* gpgv.c: Use new ARGPARSE macros and re-indent.
2008-11-11 Werner Koch <wk@g10code.com> 2008-11-11 Werner Koch <wk@g10code.com>
* gpg.c (opts): Use new ARGPARSE macros for clarity. * gpg.c (opts): Use new ARGPARSE macros for clarity.

View File

@ -369,8 +369,8 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_group (300, N_("@Commands:\n ")), ARGPARSE_group (300, N_("@Commands:\n ")),
ARGPARSE_c (aSign, "sign", N_("|[file]|make a signature")), ARGPARSE_c (aSign, "sign", N_("make a signature")),
ARGPARSE_c (aClearsign, "clearsign", N_("|[file]|make a clear text signature")), ARGPARSE_c (aClearsign, "clearsign", N_("make a clear text signature")),
ARGPARSE_c (aDetachedSign, "detach-sign", N_("make a detached signature")), ARGPARSE_c (aDetachedSign, "detach-sign", N_("make a detached signature")),
ARGPARSE_c (aEncr, "encrypt", N_("encrypt data")), ARGPARSE_c (aEncr, "encrypt", N_("encrypt data")),
ARGPARSE_c (aEncrFiles, "encrypt-files", "@"), ARGPARSE_c (aEncrFiles, "encrypt-files", "@"),
@ -428,7 +428,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_c (aDeArmor, "dearmour", "@"), ARGPARSE_c (aDeArmor, "dearmour", "@"),
ARGPARSE_c (aEnArmor, "enarmor", "@"), ARGPARSE_c (aEnArmor, "enarmor", "@"),
ARGPARSE_c (aEnArmor, "enarmour", "@"), ARGPARSE_c (aEnArmor, "enarmour", "@"),
ARGPARSE_c (aPrintMD, "print-md", N_("|algo [files]|print message digests")), ARGPARSE_c (aPrintMD, "print-md", N_("print message digests")),
ARGPARSE_c (aPrimegen, "gen-prime", "@" ), ARGPARSE_c (aPrimegen, "gen-prime", "@" ),
ARGPARSE_c (aGenRandom,"gen-random", "@" ), ARGPARSE_c (aGenRandom,"gen-random", "@" ),
ARGPARSE_c (aServer, "server", N_("run in server mode")), ARGPARSE_c (aServer, "server", N_("run in server mode")),
@ -438,7 +438,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oArmor, "armor", N_("create ascii armored output")), ARGPARSE_s_n (oArmor, "armor", N_("create ascii armored output")),
ARGPARSE_s_n (oArmor, "armour", "@"), ARGPARSE_s_n (oArmor, "armour", "@"),
ARGPARSE_s_s (oRecipient, "recipient", N_("|NAME|encrypt for NAME")), ARGPARSE_s_s (oRecipient, "recipient", N_("|USER-ID|encrypt for USER-ID")),
ARGPARSE_s_s (oHiddenRecipient, "hidden-recipient", "@"), ARGPARSE_s_s (oHiddenRecipient, "hidden-recipient", "@"),
ARGPARSE_s_s (oRecipient, "remote-user", "@"), /* (old option name) */ ARGPARSE_s_s (oRecipient, "remote-user", "@"), /* (old option name) */
ARGPARSE_s_s (oDefRecipient, "default-recipient", "@"), ARGPARSE_s_s (oDefRecipient, "default-recipient", "@"),
@ -451,9 +451,10 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oNoEncryptTo, "no-encrypt-to", "@"), ARGPARSE_s_n (oNoEncryptTo, "no-encrypt-to", "@"),
ARGPARSE_s_s (oHiddenEncryptTo, "hidden-encrypt-to", "@"), ARGPARSE_s_s (oHiddenEncryptTo, "hidden-encrypt-to", "@"),
ARGPARSE_s_s (oLocalUser, "local-user", ARGPARSE_s_s (oLocalUser, "local-user",
N_("use this user-id to sign or decrypt")), N_("|USER-ID|use USER-ID to sign or decrypt")),
ARGPARSE_s_i (oCompress, NULL, N_("|N|set compress level N (0 disables)")), ARGPARSE_s_i (oCompress, NULL,
N_("|N|set compress level to N (0 disables)")),
ARGPARSE_s_i (oCompressLevel, "compress-level", "@"), ARGPARSE_s_i (oCompressLevel, "compress-level", "@"),
ARGPARSE_s_i (oBZ2CompressLevel, "bzip2-compress-level", "@"), ARGPARSE_s_i (oBZ2CompressLevel, "bzip2-compress-level", "@"),
ARGPARSE_s_n (oBZ2DecompressLowmem, "bzip2-decompress-lowmem", "@"), ARGPARSE_s_n (oBZ2DecompressLowmem, "bzip2-decompress-lowmem", "@"),
@ -546,7 +547,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oRFC2440, "rfc2440", "@"), ARGPARSE_s_n (oRFC2440, "rfc2440", "@"),
ARGPARSE_s_n (oRFC4880, "rfc4880", "@"), ARGPARSE_s_n (oRFC4880, "rfc4880", "@"),
ARGPARSE_s_n (oOpenPGP, "openpgp", N_("use strict OpenPGP behavior")), ARGPARSE_s_n (oOpenPGP, "openpgp", N_("use strict OpenPGP behavior")),
ARGPARSE_s_n (oPGP2, "pgp2", N_("generate PGP 2.x compatible messages")), ARGPARSE_s_n (oPGP2, "pgp2", "@"),
ARGPARSE_s_n (oPGP6, "pgp6", "@"), ARGPARSE_s_n (oPGP6, "pgp6", "@"),
ARGPARSE_s_n (oPGP7, "pgp7", "@"), ARGPARSE_s_n (oPGP7, "pgp7", "@"),
ARGPARSE_s_n (oPGP8, "pgp8", "@"), ARGPARSE_s_n (oPGP8, "pgp8", "@"),

View File

@ -1,6 +1,6 @@
/* gpgv.c - The GnuPG signature verify utility /* gpgv.c - The GnuPG signature verify utility
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005,
* 2006 Free Software Foundation, Inc. * 2006, 2008 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -51,7 +51,8 @@
#include "call-agent.h" #include "call-agent.h"
enum cmd_and_opt_values { aNull = 0, enum cmd_and_opt_values {
aNull = 0,
oQuiet = 'q', oQuiet = 'q',
oVerbose = 'v', oVerbose = 'v',
oBatch = 500, oBatch = 500,
@ -60,46 +61,48 @@ enum cmd_and_opt_values { aNull = 0,
oStatusFD, oStatusFD,
oLoggerFD, oLoggerFD,
oHomedir, oHomedir,
aTest }; aTest
};
static ARGPARSE_OPTS opts[] = { static ARGPARSE_OPTS opts[] = {
ARGPARSE_group (300, N_("@\nOptions:\n ")),
{ 301, NULL, 0, N_("@\nOptions:\n ") }, ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")),
ARGPARSE_s_s (oKeyring, "keyring",
N_("|FILE|take the keys from the keyring FILE")),
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", "@"),
ARGPARSE_s_s (oHomedir, "homedir", "@"),
{ oVerbose, "verbose", 0, N_("verbose") }, ARGPARSE_end ()
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") }, };
{ oKeyring, "keyring" ,2, N_("take the keys from this keyring")},
{ oIgnoreTimeConflict, "ignore-time-conflict", 0,
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; int g10_errors_seen = 0;
static const char * static const char *
my_strusage( int level ) my_strusage( int level )
{ {
const char *p; const char *p;
switch( level ) { switch (level)
{
case 11: p = "gpgv (GnuPG)"; case 11: p = "gpgv (GnuPG)";
break; break;
case 13: p = VERSION; break; case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break; case 17: p = PRINTABLE_OS_NAME; break;
case 19: p = case 19: p = _("Please report bugs to <gnupg-bugs@gnu.org>.\n");
_("Please report bugs to <gnupg-bugs@gnu.org>.\n");
break; break;
case 1: case 1:
case 40: p = case 40: p = _("Usage: gpgv [options] [files] (-h for help)");
_("Usage: gpgv [options] [files] (-h for help)");
break; break;
case 41: p = case 41: p = _("Syntax: gpg [options] [files]\n"
_("Syntax: gpg [options] [files]\n"
"Check signatures against known trusted keys\n"); "Check signatures against known trusted keys\n");
break; break;
@ -143,8 +146,10 @@ main( int argc, char **argv )
pargs.argc = &argc; pargs.argc = &argc;
pargs.argv = &argv; pargs.argv = &argv;
pargs.flags= 1; /* do not remove the args */ pargs.flags= 1; /* do not remove the args */
while( optfile_parse( NULL, NULL, &configlineno, &pargs, opts) ) { while (optfile_parse( NULL, NULL, &configlineno, &pargs, opts))
switch( pargs.r_opt ) { {
switch (pargs.r_opt)
{
case oQuiet: opt.quiet = 1; break; case oQuiet: opt.quiet = 1; break;
case oVerbose: case oVerbose:
opt.verbose++; opt.verbose++;
@ -158,7 +163,7 @@ main( int argc, char **argv )
break; break;
case oHomedir: opt.homedir = pargs.r.ret_str; break; case oHomedir: opt.homedir = pargs.r.ret_str; break;
case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break; case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break;
default : pargs.err = 2; break; default : pargs.err = ARGPARSE_PRINT_ERROR; break;
} }
} }
@ -180,15 +185,14 @@ main( int argc, char **argv )
/* cleanup */ /* cleanup */
g10_exit (0); g10_exit (0);
return 8; /*NEVER REACHED*/ return 8; /*NOTREACHED*/
} }
void void
g10_exit( int rc ) g10_exit( int rc )
{ {
rc = rc? rc : log_get_errorcount(0)? 2 : rc = rc? rc : log_get_errorcount(0)? 2 : g10_errors_seen? 1 : 0;
g10_errors_seen? 1 : 0;
exit(rc ); exit(rc );
} }

View File

@ -1,3 +1,7 @@
2008-11-13 Werner Koch <wk@g10code.com>
* de.po: Udpate.
2008-09-30 David Ammouial <da-debian-br@weeno.net> (wk) 2008-09-30 David Ammouial <da-debian-br@weeno.net> (wk)
* fr.po: Fix bug #922. * fr.po: Fix bug #922.

614
po/be.po

File diff suppressed because it is too large Load Diff

613
po/ca.po

File diff suppressed because it is too large Load Diff

616
po/cs.po

File diff suppressed because it is too large Load Diff

621
po/da.po

File diff suppressed because it is too large Load Diff

691
po/de.po

File diff suppressed because it is too large Load Diff

622
po/el.po

File diff suppressed because it is too large Load Diff

621
po/eo.po

File diff suppressed because it is too large Load Diff

620
po/es.po

File diff suppressed because it is too large Load Diff

622
po/et.po

File diff suppressed because it is too large Load Diff

622
po/fi.po

File diff suppressed because it is too large Load Diff

615
po/fr.po

File diff suppressed because it is too large Load Diff

622
po/gl.po

File diff suppressed because it is too large Load Diff

622
po/hu.po

File diff suppressed because it is too large Load Diff

622
po/id.po

File diff suppressed because it is too large Load Diff

622
po/it.po

File diff suppressed because it is too large Load Diff

623
po/ja.po

File diff suppressed because it is too large Load Diff

615
po/nb.po

File diff suppressed because it is too large Load Diff

612
po/pl.po

File diff suppressed because it is too large Load Diff

625
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

616
po/ro.po

File diff suppressed because it is too large Load Diff

612
po/ru.po

File diff suppressed because it is too large Load Diff

626
po/sk.po

File diff suppressed because it is too large Load Diff

612
po/sv.po

File diff suppressed because it is too large Load Diff

612
po/tr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,7 @@
2008-11-13 Werner Koch <wk@g10code.com>
* gpgsm.c: Remove all unused options. Use ARGPARSE macros.
2008-10-28 Werner Koch <wk@g10code.com> 2008-10-28 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_format_keydesc): Use xtryasprintf and xfree. * certdump.c (gpgsm_format_keydesc): Use xtryasprintf and xfree.

View File

@ -50,7 +50,6 @@ enum cmd_and_opt_values {
aSym = 'c', aSym = 'c',
aDecrypt = 'd', aDecrypt = 'd',
aEncr = 'e', aEncr = 'e',
oInteractive = 'i',
aListKeys = 'k', aListKeys = 'k',
aListSecretKeys = 'K', aListSecretKeys = 'K',
oDryRun = 'n', oDryRun = 'n',
@ -58,20 +57,12 @@ enum cmd_and_opt_values {
oQuiet = 'q', oQuiet = 'q',
oRecipient = 'r', oRecipient = 'r',
aSign = 's', aSign = 's',
oTextmodeShort= 't',
oUser = 'u', oUser = 'u',
oVerbose = 'v', oVerbose = 'v',
oCompress = 'z',
oNotation = 'N',
oBatch = 500, oBatch = 500,
aClearsign, aClearsign,
aStore,
aKeygen, aKeygen,
aSignEncr, aSignEncr,
aSignKey,
aLSignKey,
aListPackets,
aEditKey,
aDeleteKey, aDeleteKey,
aImport, aImport,
aVerify, aVerify,
@ -82,7 +73,6 @@ enum cmd_and_opt_values {
aRecvKeys, aRecvKeys,
aExport, aExport,
aExportSecretKeyP12, aExportSecretKeyP12,
aCheckKeys, /* nyi */
aServer, aServer,
aLearnCard, aLearnCard,
aCallDirmngr, aCallDirmngr,
@ -95,6 +85,7 @@ enum cmd_and_opt_values {
aDumpSecretKeys, aDumpSecretKeys,
aDumpExternalKeys, aDumpExternalKeys,
aKeydbClearSomeCertFlags, aKeydbClearSomeCertFlags,
aFingerprint,
oOptions, oOptions,
oDebug, oDebug,
@ -150,35 +141,20 @@ enum cmd_and_opt_values {
oEnablePolicyChecks, oEnablePolicyChecks,
oAutoIssuerKeyRetrieve, oAutoIssuerKeyRetrieve,
oTextmode,
oFingerprint,
oWithFingerprint, oWithFingerprint,
oWithMD5Fingerprint, oWithMD5Fingerprint,
oAnswerYes, oAnswerYes,
oAnswerNo, oAnswerNo,
oKeyring, oKeyring,
oSecretKeyring,
oDefaultKey, oDefaultKey,
oDefRecipient, oDefRecipient,
oDefRecipientSelf, oDefRecipientSelf,
oNoDefRecipient, oNoDefRecipient,
oStatusFD, oStatusFD,
oNoComment,
oNoVersion,
oEmitVersion,
oCompletesNeeded,
oMarginalsNeeded,
oMaxCertDepth,
oLoadExtension,
oRFC1991,
oOpenPGP,
oCipherAlgo, oCipherAlgo,
oDigestAlgo, oDigestAlgo,
oExtraDigestAlgo, oExtraDigestAlgo,
oCompressAlgo,
oCommandFD,
oNoVerbose, oNoVerbose,
oTrustDBName,
oNoSecmemWarn, oNoSecmemWarn,
oNoDefKeyring, oNoDefKeyring,
oNoGreeting, oNoGreeting,
@ -191,284 +167,231 @@ enum cmd_and_opt_values {
oWithValidation, oWithValidation,
oWithEphemeralKeys, oWithEphemeralKeys,
oSkipVerify, oSkipVerify,
oCompressKeys,
oCompressSigs,
oAlwaysTrust,
oRunAsShmCP,
oSetFilename,
oSetPolicyURL,
oUseEmbeddedFilename,
oValidationModel, oValidationModel,
oComment,
oDefaultComment,
oThrowKeyid,
oForceV3Sigs,
oForceMDC,
oS2KMode,
oS2KDigest,
oS2KCipher,
oCharset,
oNotDashEscaped,
oEscapeFrom,
oLockOnce,
oLockMultiple,
oLockNever,
oKeyServer, oKeyServer,
oEncryptTo, oEncryptTo,
oNoEncryptTo, oNoEncryptTo,
oLoggerFD, oLoggerFD,
oUtf8Strings,
oNoUtf8Strings,
oDisableCipherAlgo, oDisableCipherAlgo,
oDisablePubkeyAlgo, oDisablePubkeyAlgo,
oAllowNonSelfsignedUID,
oAllowFreeformUID,
oNoLiteral,
oSetFilesize,
oHonorHttpProxy,
oFastListMode,
oListOnly,
oIgnoreTimeConflict, oIgnoreTimeConflict,
oNoRandomSeedFile, oNoRandomSeedFile,
oNoAutoKeyRetrieve, oNoCommonCertsImport
oNoCommonCertsImport,
oUseAgent,
oMergeOnly,
oTryAllSecrets,
oTrustedKey,
oEmuMDEncodeBug,
aDummy
}; };
static ARGPARSE_OPTS opts[] = { static ARGPARSE_OPTS opts[] = {
{ 300, NULL, 0, N_("@Commands:\n ") }, ARGPARSE_group (300, N_("@Commands:\n ")),
{ aSign, "sign", 256, N_("|[FILE]|make a signature")}, ARGPARSE_c (aSign, "sign", N_("make a signature")),
{ aClearsign, "clearsign", 256, N_("|[FILE]|make a clear text signature") }, ARGPARSE_c (aClearsign, "clearsign", N_("make a clear text signature") ),
{ aDetachedSign, "detach-sign", 256, N_("make a detached signature")}, ARGPARSE_c (aDetachedSign, "detach-sign", N_("make a detached signature")),
{ aEncr, "encrypt", 256, N_("encrypt data")}, ARGPARSE_c (aEncr, "encrypt", N_("encrypt data")),
{ aSym, "symmetric", 256, N_("encryption only with symmetric cipher")}, ARGPARSE_c (aSym, "symmetric", N_("encryption only with symmetric cipher")),
{ aDecrypt, "decrypt", 256, N_("decrypt data (default)")}, ARGPARSE_c (aDecrypt, "decrypt", N_("decrypt data (default)")),
{ aVerify, "verify" , 256, N_("verify a signature")}, ARGPARSE_c (aVerify, "verify", N_("verify a signature")),
{ aVerifyFiles, "verify-files" , 256, "@" }, ARGPARSE_c (aVerifyFiles, "verify-files", "@"),
{ aListKeys, "list-keys", 256, N_("list keys")}, ARGPARSE_c (aListKeys, "list-keys", N_("list keys")),
{ aListExternalKeys, "list-external-keys", 256, N_("list external keys")}, ARGPARSE_c (aListExternalKeys, "list-external-keys",
{ aListSecretKeys, "list-secret-keys", 256, N_("list secret keys")}, N_("list external keys")),
{ aListChain, "list-chain", 256, N_("list certificate chain")}, ARGPARSE_c (aListSecretKeys, "list-secret-keys", N_("list secret keys")),
{ oFingerprint, "fingerprint", 256, N_("list keys and fingerprints")}, ARGPARSE_c (aListChain, "list-chain", N_("list certificate chain")),
{ aKeygen, "gen-key", 256, "@" }, ARGPARSE_c (aFingerprint, "fingerprint", N_("list keys and fingerprints")),
{ aDeleteKey, "delete-keys",256,N_("remove keys from the public keyring")}, ARGPARSE_c (aKeygen, "gen-key", "@"),
{ aSendKeys, "send-keys" , 256, N_("export keys to a key server") }, ARGPARSE_c (aDeleteKey, "delete-keys",
{ aRecvKeys, "recv-keys" , 256, N_("import keys from a key server") }, N_("remove keys from the public keyring")),
{ aImport, "import", 256 , N_("import certificates")}, ARGPARSE_c (aSendKeys, "send-keys", N_("export keys to a key server")),
{ aExport, "export", 256 , N_("export certificates")}, ARGPARSE_c (aRecvKeys, "recv-keys", N_("import keys from a key server")),
{ aLearnCard, "learn-card", 256 ,N_("register a smartcard")}, ARGPARSE_c (aImport, "import", N_("import certificates")),
{ aServer, "server", 256, N_("run in server mode")}, ARGPARSE_c (aExport, "export", N_("export certificates")),
{ aCallDirmngr, "call-dirmngr", 256, N_("pass a command to the dirmngr")}, ARGPARSE_c (aExportSecretKeyP12, "export-secret-key-p12", "@"),
{ aCallProtectTool, "call-protect-tool", 256, ARGPARSE_c (aLearnCard, "learn-card", N_("register a smartcard")),
N_("invoke gpg-protect-tool")}, ARGPARSE_c (aServer, "server", N_("run in server mode")),
{ aPasswd, "passwd", 256, N_("change a passphrase")}, ARGPARSE_c (aCallDirmngr, "call-dirmngr",
{ aGPGConfList, "gpgconf-list", 256, "@" }, N_("pass a command to the dirmngr")),
{ aGPGConfTest, "gpgconf-test", 256, "@" }, ARGPARSE_c (aCallProtectTool, "call-protect-tool",
N_("invoke gpg-protect-tool")),
ARGPARSE_c (aPasswd, "passwd", N_("change a passphrase")),
ARGPARSE_c (aGPGConfList, "gpgconf-list", "@"),
ARGPARSE_c (aGPGConfTest, "gpgconf-test", "@"),
{ aDumpKeys, "dump-cert", 256, "@"}, ARGPARSE_c (aDumpKeys, "dump-cert", "@"),
{ aDumpKeys, "dump-keys", 256, "@"}, ARGPARSE_c (aDumpKeys, "dump-keys", "@"),
{ aDumpChain, "dump-chain", 256, "@"}, ARGPARSE_c (aDumpChain, "dump-chain", "@"),
{ aDumpExternalKeys, "dump-external-keys", 256, "@"}, ARGPARSE_c (aDumpExternalKeys, "dump-external-keys", "@"),
{ aDumpSecretKeys, "dump-secret-keys", 256, "@"}, ARGPARSE_c (aDumpSecretKeys, "dump-secret-keys", "@"),
{ aKeydbClearSomeCertFlags, "keydb-clear-some-cert-flags", 256, "@"}, ARGPARSE_c (aKeydbClearSomeCertFlags, "keydb-clear-some-cert-flags", "@"),
{ 301, NULL, 0, N_("@\nOptions:\n ") }, ARGPARSE_group (301, N_("@\nOptions:\n ")),
{ oArmor, "armor", 0, N_("create ascii armored output")}, ARGPARSE_s_n (oArmor, "armor", N_("create ascii armored output")),
{ oArmor, "armour", 0, "@" }, ARGPARSE_s_n (oArmor, "armour", "@"),
{ oBase64, "base64", 0, N_("create base-64 encoded output")}, ARGPARSE_s_n (oBase64, "base64", N_("create base-64 encoded output")),
{ oP12Charset, "p12-charset", 2, "@" }, ARGPARSE_s_s (oP12Charset, "p12-charset", "@"),
{ oAssumeArmor, "assume-armor", 0, N_("assume input is in PEM format")}, ARGPARSE_s_n (oAssumeArmor, "assume-armor",
{ oAssumeBase64, "assume-base64", 0, N_("assume input is in PEM format")),
N_("assume input is in base-64 format")}, ARGPARSE_s_n (oAssumeBase64, "assume-base64",
{ oAssumeBinary, "assume-binary", 0, N_("assume input is in base-64 format")),
N_("assume input is in binary format")}, ARGPARSE_s_n (oAssumeBinary, "assume-binary",
N_("assume input is in binary format")),
{ oRecipient, "recipient", 2, N_("|NAME|encrypt for NAME")}, ARGPARSE_s_s (oRecipient, "recipient", N_("|USER-ID|encrypt for USER-ID")),
{ oPreferSystemDirmngr,"prefer-system-dirmngr", 0, ARGPARSE_s_n (oPreferSystemDirmngr,"prefer-system-dirmngr",
N_("use system's dirmngr if available")}, N_("use system's dirmngr if available")),
{ oDisableCRLChecks, "disable-crl-checks", 0, N_("never consult a CRL")},
{ oEnableCRLChecks, "enable-crl-checks", 0, "@"},
{ oDisableTrustedCertCRLCheck, "disable-trusted-cert-crl-check", 0, "@"},
{ oEnableTrustedCertCRLCheck, "enable-trusted-cert-crl-check", 0, "@"},
{ oForceCRLRefresh, "force-crl-refresh", 0, "@"},
{ oDisableOCSP, "disable-ocsp", 0, "@" }, ARGPARSE_s_n (oDisableCRLChecks, "disable-crl-checks",
{ oEnableOCSP, "enable-ocsp", 0, N_("check validity using OCSP")}, N_("never consult a CRL")),
ARGPARSE_s_n (oEnableCRLChecks, "enable-crl-checks", "@"),
ARGPARSE_s_n (oDisableTrustedCertCRLCheck,
"disable-trusted-cert-crl-check", "@"),
ARGPARSE_s_n (oEnableTrustedCertCRLCheck,
"enable-trusted-cert-crl-check", "@"),
{ oValidationModel, "validation-model", 2, "@"}, ARGPARSE_s_n (oForceCRLRefresh, "force-crl-refresh", "@"),
{ oIncludeCerts, "include-certs", 1, ARGPARSE_s_n (oDisableOCSP, "disable-ocsp", "@"),
N_("|N|number of certificates to include") }, ARGPARSE_s_n (oEnableOCSP, "enable-ocsp", N_("check validity using OCSP")),
{ oPolicyFile, "policy-file", 2, ARGPARSE_s_s (oValidationModel, "validation-model", "@"),
N_("|FILE|take policy information from FILE") },
{ oDisablePolicyChecks, "disable-policy-checks", 0, ARGPARSE_s_i (oIncludeCerts, "include-certs",
N_("do not check certificate policies")}, N_("|N|number of certificates to include") ),
{ oEnablePolicyChecks, "enable-policy-checks", 0, "@"},
{ oAutoIssuerKeyRetrieve, "auto-issuer-key-retrieve", 0, ARGPARSE_s_s (oPolicyFile, "policy-file",
N_("fetch missing issuer certificates")}, N_("|FILE|take policy information from FILE")),
#if 0 ARGPARSE_s_n (oDisablePolicyChecks, "disable-policy-checks",
{ oDefRecipient, "default-recipient" ,2, N_("do not check certificate policies")),
N_("|NAME|use NAME as default recipient")}, ARGPARSE_s_n (oEnablePolicyChecks, "enable-policy-checks", "@"),
{ oDefRecipientSelf, "default-recipient-self" ,0,
N_("use the default key as default recipient")},
{ oNoDefRecipient, "no-default-recipient", 0, "@" },
#endif
{ oEncryptTo, "encrypt-to", 2, "@" },
{ oNoEncryptTo, "no-encrypt-to", 0, "@" },
{ oUser, "local-user",2, N_("use this user-id to sign or decrypt")}, ARGPARSE_s_n (oAutoIssuerKeyRetrieve, "auto-issuer-key-retrieve",
N_("fetch missing issuer certificates")),
#if 0 ARGPARSE_s_s (oEncryptTo, "encrypt-to", "@"),
{ oCompress, NULL, 1, N_("|N|set compress level N (0 disables)") }, ARGPARSE_s_n (oNoEncryptTo, "no-encrypt-to", "@"),
{ oTextmodeShort, NULL, 0, "@"},
{ oTextmode, "textmode", 0, N_("use canonical text mode")},
#endif
{ oOutput, "output", 2, N_("|FILE|write output to FILE")}, ARGPARSE_s_s (oUser, "local-user",
{ oVerbose, "verbose", 0, N_("verbose") }, N_("|USER-ID|use USER-ID to sign or decrypt")),
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
{ oNoTTY, "no-tty", 0, N_("don't use the terminal at all") },
{ oLogFile, "log-file" ,2, N_("|FILE|write a server mode log to FILE")},
{ oNoLogFile, "no-log-file" ,0, "@"},
{ oAuditLog, "audit-log", 2, N_("|FILE|write an audit log to FILE")},
#if 0
{ oForceV3Sigs, "force-v3-sigs", 0, N_("force v3 signatures") },
{ oForceMDC, "force-mdc", 0, N_("always use a MDC for encryption") },
#endif
{ oDryRun, "dry-run", 0, N_("do not make any changes") },
/*{ oInteractive, "interactive", 0, N_("prompt before overwriting") }, */
/*{ oUseAgent, "use-agent",0, N_("use the gpg-agent")},*/
{ oBatch, "batch", 0, N_("batch mode: never ask")},
{ oAnswerYes, "yes", 0, N_("assume yes on most questions")},
{ oAnswerNo, "no", 0, N_("assume no on most questions")},
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")}, ARGPARSE_s_s (oOutput, "output", N_("|FILE|write output to FILE")),
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")}, ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")}, ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")),
{ oKeyServer, "keyserver",2, N_("|SPEC|use this keyserver to lookup keys")}, ARGPARSE_s_n (oNoTTY, "no-tty", N_("don't use the terminal at all")),
{ oCharset, "charset" , 2, N_("|NAME|set terminal charset to NAME") }, ARGPARSE_s_s (oLogFile, "log-file",
{ oOptions, "options" , 2, N_("read options from file")}, N_("|FILE|write a server mode log to FILE")),
ARGPARSE_s_n (oNoLogFile, "no-log-file", "@"),
ARGPARSE_s_i (oLoggerFD, "logger-fd", "@"),
{ oDebug, "debug" ,4|16, "@"}, ARGPARSE_s_s (oAuditLog, "audit-log",
{ oDebugLevel, "debug-level" ,2, N_("|LEVEL|set the debugging level to LEVEL")}, N_("|FILE|write an audit log to FILE")),
{ oDebugAll, "debug-all" ,0, "@"}, ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")),
{ oDebugNone, "debug-none" ,0, "@"}, ARGPARSE_s_n (oBatch, "batch", N_("batch mode: never ask")),
{ oDebugWait, "debug-wait" ,1, "@"}, ARGPARSE_s_n (oAnswerYes, "yes", N_("assume yes on most questions")),
{ oDebugAllowCoreDump, "debug-allow-core-dump", 0, "@" }, ARGPARSE_s_n (oAnswerNo, "no", N_("assume no on most questions")),
{ oDebugNoChainValidation, "debug-no-chain-validation", 0, "@"},
{ oDebugIgnoreExpiration, "debug-ignore-expiration", 0, "@"}, ARGPARSE_s_s (oKeyring, "keyring",
{ oFixedPassphrase, "fixed-passphrase", 2, "@"}, N_("|FILE|add keyring to the list of keyrings")),
{ oStatusFD, "status-fd" ,1, N_("|FD|write status info to this FD") },
{ aDummy, "no-comment", 0, "@"}, ARGPARSE_s_s (oDefaultKey, "default-key",
{ aDummy, "completes-needed", 1, "@"}, N_("|USER-ID|use USER-ID as default secret key")),
{ aDummy, "marginals-needed", 1, "@"},
{ oMaxCertDepth, "max-cert-depth", 1, "@" }, /* Not yet used: */
{ aDummy, "trusted-key", 2, "@"}, /* ARGPARSE_s_s (oDefRecipient, "default-recipient", */
{ oLoadExtension, "load-extension" ,2, /* N_("|NAME|use NAME as default recipient")), */
N_("|FILE|load extension module FILE")}, /* ARGPARSE_s_n (oDefRecipientSelf, "default-recipient-self", */
{ aDummy, "rfc1991", 0, "@"}, /* N_("use the default key as default recipient")), */
{ aDummy, "openpgp", 0, "@"}, /* ARGPARSE_s_n (oNoDefRecipient, "no-default-recipient", "@"), */
{ aDummy, "s2k-mode", 1, "@"},
{ aDummy, "s2k-digest-algo",2, "@"}, ARGPARSE_s_s (oKeyServer, "keyserver",
{ aDummy, "s2k-cipher-algo",2, "@"}, N_("|SPEC|use this keyserver to lookup keys")),
{ oCipherAlgo, "cipher-algo", 2 , N_("|NAME|use cipher algorithm NAME")}, ARGPARSE_s_s (oOptions, "options", N_("|FILE|read options from FILE")),
{ oDigestAlgo, "digest-algo", 2 ,
N_("|NAME|use message digest algorithm NAME")}, ARGPARSE_p_u (oDebug, "debug", "@"),
{ oExtraDigestAlgo, "extra-digest-algo", 2 , "@" }, ARGPARSE_s_s (oDebugLevel, "debug-level",
#if 0 N_("|LEVEL|set the debugging level to LEVEL")),
{ oCompressAlgo, "compress-algo", 1 , N_("|N|use compress algorithm N")}, ARGPARSE_s_n (oDebugAll, "debug-all", "@"),
#endif ARGPARSE_s_n (oDebugNone, "debug-none", "@"),
{ aDummy, "throw-keyid", 0, "@"}, ARGPARSE_s_i (oDebugWait, "debug-wait", "@"),
{ aDummy, "notation-data", 2, "@"}, ARGPARSE_s_n (oDebugAllowCoreDump, "debug-allow-core-dump", "@"),
{ aExportSecretKeyP12, "export-secret-key-p12", 256, "@"}, ARGPARSE_s_n (oDebugNoChainValidation, "debug-no-chain-validation", "@"),
ARGPARSE_s_n (oDebugIgnoreExpiration, "debug-ignore-expiration", "@"),
ARGPARSE_s_s (oFixedPassphrase, "fixed-passphrase", "@"),
ARGPARSE_s_i (oStatusFD, "status-fd",
N_("|FD|write status info to this FD")),
ARGPARSE_s_s (oCipherAlgo, "cipher-algo",
N_("|NAME|use cipher algorithm NAME")),
ARGPARSE_s_s (oDigestAlgo, "digest-algo",
N_("|NAME|use message digest algorithm NAME")),
ARGPARSE_s_s (oExtraDigestAlgo, "extra-digest-algo", "@"),
{ 302, NULL, 0, N_( ARGPARSE_group (302, N_(
"@\n(See the man page for a complete listing of all commands and options)\n" "@\n(See the man page for a complete listing of all commands and options)\n"
)}, )),
{ 303, NULL, 0, N_("@\nExamples:\n\n" ARGPARSE_group (303, N_("@\nExamples:\n\n"
" -se -r Bob [file] sign and encrypt for user Bob\n" " -se -r Bob [file] sign and encrypt for user Bob\n"
" --clearsign [file] make a clear text signature\n" " --clearsign [file] make a clear text signature\n"
" --detach-sign [file] make a detached signature\n" " --detach-sign [file] make a detached signature\n"
" --list-keys [names] show keys\n" " --list-keys [names] show keys\n"
" --fingerprint [names] show fingerprints\n" ) }, " --fingerprint [names] show fingerprints\n" )),
/* hidden options */ /* Hidden options. */
{ oNoVerbose, "no-verbose", 0, "@"}, ARGPARSE_s_n (oNoVerbose, "no-verbose", "@"),
ARGPARSE_s_n (oEnableSpecialFilenames, "enable-special-filenames", "@"),
ARGPARSE_s_n (oNoSecmemWarn, "no-secmem-warning", "@"),
ARGPARSE_s_n (oNoArmor, "no-armor", "@"),
ARGPARSE_s_n (oNoArmor, "no-armour", "@"),
ARGPARSE_s_n (oNoDefKeyring, "no-default-keyring", "@"),
ARGPARSE_s_n (oNoGreeting, "no-greeting", "@"),
ARGPARSE_s_n (oNoOptions, "no-options", "@"),
ARGPARSE_s_s (oHomedir, "homedir", "@"),
ARGPARSE_s_s (oAgentProgram, "agent-program", "@"),
ARGPARSE_s_s (oDisplay, "display", "@"),
ARGPARSE_s_s (oTTYname, "ttyname", "@"),
ARGPARSE_s_s (oTTYtype, "ttytype", "@"),
ARGPARSE_s_s (oLCctype, "lc-ctype", "@"),
ARGPARSE_s_s (oLCmessages, "lc-messages", "@"),
ARGPARSE_s_s (oXauthority, "xauthority", "@"),
ARGPARSE_s_s (oDirmngrProgram, "dirmngr-program", "@"),
ARGPARSE_s_n (oDisableDirmngr, "disable-dirmngr", "@"),
ARGPARSE_s_s (oProtectToolProgram, "protect-tool-program", "@"),
ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"),
ARGPARSE_s_n (oNoBatch, "no-batch", "@"),
ARGPARSE_s_n (oWithColons, "with-colons", "@"),
ARGPARSE_s_n (oWithKeyData,"with-key-data", "@"),
ARGPARSE_s_n (oWithValidation, "with-validation", "@"),
ARGPARSE_s_n (oWithMD5Fingerprint, "with-md5-fingerprint", "@"),
ARGPARSE_s_n (oWithEphemeralKeys, "with-ephemeral-keys", "@"),
ARGPARSE_s_n (oSkipVerify, "skip-verify", "@"),
ARGPARSE_s_n (oWithFingerprint, "with-fingerprint", "@"),
ARGPARSE_s_s (oDisableCipherAlgo, "disable-cipher-algo", "@"),
ARGPARSE_s_s (oDisablePubkeyAlgo, "disable-pubkey-algo", "@"),
ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict", "@"),
ARGPARSE_s_n (oNoRandomSeedFile, "no-random-seed-file", "@"),
ARGPARSE_s_n (oNoCommonCertsImport, "no-common-certs-import", "@"),
{ oEnableSpecialFilenames, "enable-special-filenames", 0, "@" }, /* Command aliases. */
ARGPARSE_c (aListKeys, "list-key", "@"),
ARGPARSE_c (aListChain, "list-sig", "@"),
ARGPARSE_c (aListChain, "list-sigs", "@"),
ARGPARSE_c (aListChain, "check-sig", "@"),
ARGPARSE_c (aListChain, "check-sigs", "@"),
ARGPARSE_c (aDeleteKey, "delete-key", "@"),
ARGPARSE_end ()
{ oTrustDBName, "trustdb-name", 2, "@" }, };
{ oNoSecmemWarn, "no-secmem-warning", 0, "@" },
{ oNoArmor, "no-armor", 0, "@"},
{ oNoArmor, "no-armour", 0, "@"},
{ oNoDefKeyring, "no-default-keyring", 0, "@" },
{ oNoGreeting, "no-greeting", 0, "@" },
{ oNoOptions, "no-options", 0, "@" }, /* shortcut for --options /dev/null */
{ oHomedir, "homedir", 2, "@" }, /* defaults to "~/.gnupg" */
{ oAgentProgram, "agent-program", 2 , "@" },
{ oDisplay, "display", 2, "@" },
{ oTTYname, "ttyname", 2, "@" },
{ oTTYtype, "ttytype", 2, "@" },
{ oLCctype, "lc-ctype", 2, "@" },
{ oLCmessages, "lc-messages", 2, "@" },
{ oXauthority, "xauthority", 2, "@" },
{ oDirmngrProgram, "dirmngr-program", 2 , "@" },
{ oDisableDirmngr, "disable-dirmngr", 0 , "@" },
{ oProtectToolProgram, "protect-tool-program", 2 , "@" },
{ oFakedSystemTime, "faked-system-time", 2, "@" }, /* (epoch time) */
{ oNoBatch, "no-batch", 0, "@" },
{ oWithColons, "with-colons", 0, "@"},
{ oWithKeyData,"with-key-data", 0, "@"},
{ oWithValidation, "with-validation", 0, "@"},
{ oWithMD5Fingerprint, "with-md5-fingerprint", 0, "@"},
{ oWithEphemeralKeys, "with-ephemeral-keys", 0, "@"},
{ aListKeys, "list-key", 256, "@" }, /* alias */
{ aListChain, "list-sig", 256, "@" }, /* alias */
{ aListChain, "list-sigs",256, "@" }, /* alias */
{ aListChain, "check-sig",256, "@" }, /* alias */
{ aListChain, "check-sigs",256, "@"}, /* alias */
{ aDeleteKey, "delete-key",256,"@"}, /* alias */
{ oSkipVerify, "skip-verify",0, "@" },
{ oCompressKeys, "compress-keys",0, "@"},
{ oCompressSigs, "compress-sigs",0, "@"},
{ oAlwaysTrust, "always-trust", 0, "@"},
{ oNoVersion, "no-version", 0, "@"},
{ oLockOnce, "lock-once", 0, "@" },
{ oLockMultiple, "lock-multiple", 0, "@" },
{ oLockNever, "lock-never", 0, "@" },
{ oLoggerFD, "logger-fd",1, "@" },
{ oWithFingerprint, "with-fingerprint", 0, "@" },
{ oDisableCipherAlgo, "disable-cipher-algo", 2, "@" },
{ oDisablePubkeyAlgo, "disable-pubkey-algo", 2, "@" },
{ oHonorHttpProxy,"honor-http-proxy", 0, "@" },
{ oListOnly, "list-only", 0, "@"},
{ oIgnoreTimeConflict, "ignore-time-conflict", 0, "@" },
{ oNoRandomSeedFile, "no-random-seed-file", 0, "@" },
{ oNoCommonCertsImport, "no-common-certs-import", 0, "@" },
{0} };
/* Global variable to keep an error count. */
int gpgsm_errors_seen = 0; int gpgsm_errors_seen = 0;
/* It is possible that we are currentlu running under setuid permissions */ /* It is possible that we are currentlu running under setuid permissions */
@ -1123,7 +1046,6 @@ main ( int argc, char **argv)
do_not_setup_keys = 1; do_not_setup_keys = 1;
break; break;
case aCheckKeys:
case aImport: case aImport:
case aSendKeys: case aSendKeys:
case aRecvKeys: case aRecvKeys:
@ -1287,7 +1209,7 @@ main ( int argc, char **argv)
opt.with_md5_fingerprint=1; /*fall thru*/ opt.with_md5_fingerprint=1; /*fall thru*/
case oWithFingerprint: case oWithFingerprint:
with_fpr=1; /*fall thru*/ with_fpr=1; /*fall thru*/
case oFingerprint: case aFingerprint:
opt.fingerprint++; opt.fingerprint++;
break; break;
@ -1367,9 +1289,6 @@ main ( int argc, char **argv)
add_to_strlist ( &remusr, pargs.r.ret_str); add_to_strlist ( &remusr, pargs.r.ret_str);
break; break;
case oTextmodeShort: /*fixme:opt.textmode = 2;*/ break;
case oTextmode: /*fixme:opt.textmode=1;*/ break;
case oUser: /* Store the local users, the first one is the default */ case oUser: /* Store the local users, the first one is the default */
if (!opt.local_user) if (!opt.local_user)
opt.local_user = xstrdup (pargs.r.ret_str); opt.local_user = xstrdup (pargs.r.ret_str);
@ -1397,6 +1316,10 @@ main ( int argc, char **argv)
} }
break; break;
case oDigestAlgo:
/* Dummy for now. */
break;
case oExtraDigestAlgo: case oExtraDigestAlgo:
extra_digest_algo = pargs.r.ret_str; extra_digest_algo = pargs.r.ret_str;
break; break;
@ -1427,10 +1350,8 @@ main ( int argc, char **argv)
} }
break; break;
case aDummy:
break;
default: default:
pargs.err = configfp? 1:2; pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
break; break;
} }
} }