aboutsummaryrefslogtreecommitdiffstats
path: root/src/import.c
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2024-06-12 08:45:11 +0000
committerIngo Klöcker <[email protected]>2024-06-12 08:45:11 +0000
commit3b9815bd8ad723445128ae99883be0072ae389a6 (patch)
tree9553f5d4c4cecf28ec1d1a68da24bd545535f731 /src/import.c
parentqt,doc: Fix typos (diff)
downloadgpgme-3b9815bd8ad723445128ae99883be0072ae389a6.tar.gz
gpgme-3b9815bd8ad723445128ae99883be0072ae389a6.zip
core: Allow setting import options when importing keys
* src/context.h (struct gpgme_context): New field import_options. * src/engine-backend.h (struct engine_ops): Add arg import_options to field 'import'. * src/engine-gpg.c (gpg_import): Add arg import_options and pass option --import-options with argument value to gpg. * src/engine-gpgsm.c (gpgsm_import): Add dummy arg import_options. * src/engine.c (_gpgme_engine_op_import): Add arg import_options and pass option to import function of engine. * src/engine.h (_gpgme_engine_op_import): Add arg import_options. * src/gpgme.c (gpgme_release): Free 'import_options'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "import-options". * src/import.c (_gpgme_op_import_start, _gpgme_op_import_keys_start, _gpgme_op_receive_keys_start): Pass import options stored in context to _gpgme_engine_op_import. * tests/run-import.c (show_usage, main): Add option --import-options. -- This makes the --import-options option available in the GPGME API for key imports. GnuPG-bug-id: 7152
Diffstat (limited to 'src/import.c')
-rw-r--r--src/import.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/import.c b/src/import.c
index f288a811..d8c9adcb 100644
--- a/src/import.c
+++ b/src/import.c
@@ -368,7 +368,8 @@ _gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata)
ctx);
return _gpgme_engine_op_import (ctx->engine, keydata, NULL, NULL,
- ctx->import_filter, ctx->key_origin);
+ ctx->import_filter, ctx->import_options,
+ ctx->key_origin);
}
@@ -448,7 +449,8 @@ _gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous,
ctx);
return _gpgme_engine_op_import (ctx->engine, NULL, keys, NULL,
- ctx->import_filter, ctx->key_origin);
+ ctx->import_filter, ctx->import_options,
+ ctx->key_origin);
}
@@ -541,7 +543,8 @@ _gpgme_op_receive_keys_start (gpgme_ctx_t ctx, int synchronous, const char *keyi
ctx);
return _gpgme_engine_op_import (ctx->engine, NULL, NULL, keyids,
- ctx->import_filter, ctx->key_origin);
+ ctx->import_filter, ctx->import_options,
+ ctx->key_origin);
}