mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
gpg: New option --compatibility-flags
* g10/gpg.c (oCompatibilityFlags): New. (opts): Add option. (compatibility_flags): New list. (main): Set flags and print help. * g10/options.h (opt): Add field compatibility_flags. -- No flags are yet defined but it is good to have the framework.
This commit is contained in:
parent
b71a14238d
commit
03f04dfb9a
@ -2997,6 +2997,14 @@ therefore enables a fast listing of the encryption keys.
|
|||||||
@opindex interactive
|
@opindex interactive
|
||||||
Prompt before overwriting any files.
|
Prompt before overwriting any files.
|
||||||
|
|
||||||
|
@item --compatibility-flags @var{flags}
|
||||||
|
@opindex compatibility-flags
|
||||||
|
Set compatibility flags to work around problems due to non-compliant
|
||||||
|
keys or data. The @var{flags} are given as a comma separated
|
||||||
|
list of flag names and are OR-ed together. The special flag "none"
|
||||||
|
clears the list and allows to start over with an empty list. To get a
|
||||||
|
list of available flags the sole word "help" can be used.
|
||||||
|
|
||||||
@item --debug-level @var{level}
|
@item --debug-level @var{level}
|
||||||
@opindex debug-level
|
@opindex debug-level
|
||||||
Select the debug level for investigating problems. @var{level} may be
|
Select the debug level for investigating problems. @var{level} may be
|
||||||
|
20
g10/gpg.c
20
g10/gpg.c
@ -444,6 +444,7 @@ enum cmd_and_opt_values
|
|||||||
oForceSignKey,
|
oForceSignKey,
|
||||||
oForbidGenKey,
|
oForbidGenKey,
|
||||||
oRequireCompliance,
|
oRequireCompliance,
|
||||||
|
oCompatibilityFlags,
|
||||||
|
|
||||||
oNoop
|
oNoop
|
||||||
};
|
};
|
||||||
@ -914,6 +915,7 @@ static gpgrt_opt_t opts[] = {
|
|||||||
ARGPARSE_s_n (oUseKeyboxd, "use-keyboxd", "@"),
|
ARGPARSE_s_n (oUseKeyboxd, "use-keyboxd", "@"),
|
||||||
ARGPARSE_s_n (oForbidGenKey, "forbid-gen-key", "@"),
|
ARGPARSE_s_n (oForbidGenKey, "forbid-gen-key", "@"),
|
||||||
ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"),
|
ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"),
|
||||||
|
ARGPARSE_s_s (oCompatibilityFlags, "compatibility-flags", "@"),
|
||||||
/* Options which can be used in special circumstances. They are not
|
/* Options which can be used in special circumstances. They are not
|
||||||
* published and we hope they are never required. */
|
* published and we hope they are never required. */
|
||||||
ARGPARSE_s_n (oUseOnlyOpenPGPCard, "use-only-openpgp-card", "@"),
|
ARGPARSE_s_n (oUseOnlyOpenPGPCard, "use-only-openpgp-card", "@"),
|
||||||
@ -1009,6 +1011,13 @@ static struct debug_flags_s debug_flags [] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* The list of compatibility flags. */
|
||||||
|
static struct compatibility_flags_s compatibility_flags [] =
|
||||||
|
{
|
||||||
|
{ 0, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_SELINUX_HACKS
|
#ifdef ENABLE_SELINUX_HACKS
|
||||||
#define ALWAYS_ADD_KEYRINGS 1
|
#define ALWAYS_ADD_KEYRINGS 1
|
||||||
#else
|
#else
|
||||||
@ -2861,6 +2870,15 @@ main (int argc, char **argv)
|
|||||||
allow_large_chunks = 1;
|
allow_large_chunks = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case oCompatibilityFlags:
|
||||||
|
if (parse_compatibility_flags (pargs.r.ret_str, &opt.compat_flags,
|
||||||
|
compatibility_flags))
|
||||||
|
{
|
||||||
|
pargs.r_opt = ARGPARSE_INVALID_ARG;
|
||||||
|
pargs.err = ARGPARSE_PRINT_ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case oStatusFD:
|
case oStatusFD:
|
||||||
set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) );
|
set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) );
|
||||||
break;
|
break;
|
||||||
@ -3920,6 +3938,8 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_debug (debug_level);
|
set_debug (debug_level);
|
||||||
|
if (opt.verbose) /* Print the compatibility flags. */
|
||||||
|
parse_compatibility_flags (NULL, &opt.compat_flags, compatibility_flags);
|
||||||
gnupg_set_compliance_extra_info (opt.min_rsa_length);
|
gnupg_set_compliance_extra_info (opt.min_rsa_length);
|
||||||
if (DBG_CLOCK)
|
if (DBG_CLOCK)
|
||||||
log_clock ("start");
|
log_clock ("start");
|
||||||
|
@ -308,6 +308,9 @@ struct
|
|||||||
int no_symkey_cache; /* Disable the cache used for --symmetric. */
|
int no_symkey_cache; /* Disable the cache used for --symmetric. */
|
||||||
|
|
||||||
int use_keyboxd; /* Use the external keyboxd as storage backend. */
|
int use_keyboxd; /* Use the external keyboxd as storage backend. */
|
||||||
|
|
||||||
|
/* Compatibility flags (COMPAT_FLAG_xxxx). */
|
||||||
|
unsigned int compat_flags;
|
||||||
} opt;
|
} opt;
|
||||||
|
|
||||||
/* CTRL is used to keep some global variables we currently can't
|
/* CTRL is used to keep some global variables we currently can't
|
||||||
@ -363,8 +366,11 @@ struct {
|
|||||||
EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode;
|
EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode;
|
||||||
EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode;
|
EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode;
|
||||||
|
|
||||||
|
/* Compatibility flags */
|
||||||
|
/* #define COMPAT_FOO 1 */
|
||||||
|
|
||||||
/* Compatibility flags. */
|
|
||||||
|
/* Compliance test macors. */
|
||||||
#define GNUPG (opt.compliance==CO_GNUPG || opt.compliance==CO_DE_VS)
|
#define GNUPG (opt.compliance==CO_GNUPG || opt.compliance==CO_DE_VS)
|
||||||
#define RFC2440 (opt.compliance==CO_RFC2440)
|
#define RFC2440 (opt.compliance==CO_RFC2440)
|
||||||
#define RFC4880 (opt.compliance==CO_RFC4880)
|
#define RFC4880 (opt.compliance==CO_RFC4880)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user