1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpgsm: Allow unattended PKCS#12 export without passphrase.

* sm/gpgsm.c (oNoProtection): New.
(opts): Add "--no-protection".
(main): PArse it.
* sm/gpgsm.h (struct server_control_s): Add field no_protection.
* sm/server.c (option_handler): Add option "no-protection".
(reset_notify): Clear option.
* sm/export.c (export_p12): Use empty passphrase if option is set.
This commit is contained in:
Werner Koch 2025-01-29 18:06:15 +01:00
parent 89055f24f4
commit 159e801043
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
5 changed files with 48 additions and 15 deletions

View file

@ -135,6 +135,7 @@ enum cmd_and_opt_values {
oPassphraseFD,
oPinentryMode,
oNoProtection,
oRequestOrigin,
oAssumeArmor,
@ -436,6 +437,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_n (oDisableFdTranslation, "disable-fd-translation", "@"),
ARGPARSE_s_i (oPassphraseFD, "passphrase-fd", "@"),
ARGPARSE_s_s (oPinentryMode, "pinentry-mode", "@"),
ARGPARSE_s_n (oNoProtection, "no-protection", "@"),
ARGPARSE_header (NULL, N_("Other options")),
@ -1178,6 +1180,10 @@ main ( int argc, char **argv)
log_error (_("invalid pinentry mode '%s'\n"), pargs.r.ret_str);
break;
case oNoProtection:
ctrl.no_protection = 1;
break;
case oRequestOrigin:
opt.request_origin = parse_request_origin (pargs.r.ret_str);
if (opt.request_origin == -1)