aboutsummaryrefslogtreecommitdiffstats
path: root/sm/gpgsm.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-06-13 15:46:40 +0000
committerWerner Koch <[email protected]>2022-06-13 15:50:26 +0000
commitf0b373cec93bb01f02b9c0a3ab1f3e242b381c3f (patch)
tree7c54cfd4a2bcbdc24a85edd15974fae517712c06 /sm/gpgsm.c
parentcommon: New function parse_compatibility_flags. (diff)
downloadgnupg-f0b373cec93bb01f02b9c0a3ab1f3e242b381c3f.tar.gz
gnupg-f0b373cec93bb01f02b9c0a3ab1f3e242b381c3f.zip
gpgsm: New option --compatibility-flags.
* sm/gpgsm.c (oCompatibilityFlags): New option. (compatibility_flags): new. (main): Parse and print them in verbose mode. * sm/gpgsm.h (opt): Add field compat_glags.: (COMPAT_ALLOW_KA_TO_ENCR): New. * sm/keylist.c (print_capabilities): Take care of the new flag. * sm/certlist.c (cert_usage_p): Ditto.
Diffstat (limited to 'sm/gpgsm.c')
-rw-r--r--sm/gpgsm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 4634fba74..4c7c28c3e 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -210,6 +210,7 @@ enum cmd_and_opt_values {
oUseKeyboxd,
oKeyboxdProgram,
oRequireCompliance,
+ oCompatibilityFlags,
oNoAutostart
};
@@ -442,6 +443,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_s (oLCmessages, "lc-messages", "@"),
ARGPARSE_s_s (oXauthority, "xauthority", "@"),
ARGPARSE_s_s (oChUid, "chuid", "@"),
+ ARGPARSE_s_s (oCompatibilityFlags, "compatibility-flags", "@"),
ARGPARSE_header (NULL, ""), /* Stop the header group. */
@@ -479,6 +481,14 @@ static struct debug_flags_s debug_flags [] =
};
+/* The list of compatibility flags. */
+static struct compatibility_flags_s compatibility_flags [] =
+ {
+ { COMPAT_ALLOW_KA_TO_ENCR, "allow-ka-to-encr" },
+ { 0, NULL }
+ };
+
+
/* Global variable to keep an error count. */
int gpgsm_errors_seen = 0;
@@ -1271,6 +1281,15 @@ main ( int argc, char **argv)
case oDebugIgnoreExpiration: opt.ignore_expiration = 1; break;
case oDebugForceECDHSHA1KDF: opt.force_ecdh_sha1kdf = 1; 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:
ctrl.status_fd = translate_sys2libc_fd_int (pargs.r.ret_int, 1);
break;
@@ -1584,6 +1603,8 @@ main ( int argc, char **argv)
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
set_debug ();
+ 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);
/* Although we always use gpgsm_exit, we better install a regular