diff options
author | Werner Koch <[email protected]> | 2025-01-29 17:06:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2025-01-29 17:06:15 +0000 |
commit | 159e801043de479d9899fccb07a79fbbcc76e751 (patch) | |
tree | cc86421520a3efe5d37925aee1682ea5bfd33aa8 /sm/server.c | |
parent | gpgsm: Allow CSR generation with an unprotected key. (diff) | |
download | gnupg-159e801043de479d9899fccb07a79fbbcc76e751.tar.gz gnupg-159e801043de479d9899fccb07a79fbbcc76e751.zip |
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.
Diffstat (limited to 'sm/server.c')
-rw-r--r-- | sm/server.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sm/server.c b/sm/server.c index 345c3167b..c0542dc9a 100644 --- a/sm/server.c +++ b/sm/server.c @@ -318,6 +318,11 @@ option_handler (assuan_context_t ctx, const char *key, const char *value) { ctrl->input_size_hint = string_to_u64 (value); } + else if (!strcmp (key, "no-protection")) + { + int i = *value? atoi (value) : 0; + ctrl->no_protection = !!i; + } else err = gpg_error (GPG_ERR_UNKNOWN_OPTION); @@ -338,6 +343,7 @@ reset_notify (assuan_context_t ctx, char *line) ctrl->server_local->recplist = NULL; ctrl->server_local->signerlist = NULL; ctrl->always_trust = 0; + ctrl->no_protection = 0; close_message_fp (ctrl); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); |