aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* core: Extend gpgme_get_dirinfo to return the gpgtar nameIngo Klöcker2023-01-181-0/+1
| | | | | | | | | | | | | * src/dirinfo.c (WANT_GPGTAR_NAME): New. (dirinfo): Add field gpgtar_name. (get_gpgconf_item): Build gpgtar_name on demand and return it. (_gpgme_get_default_gpgtar_name) : New. (gpgme_get_dirinfo): New value "gpgtar-name" for WHAT. * src/util.h (_gpgme_get_default_gpgtar_name): New. * tests/t-engine-info.c (main): Add gpgtar-name to the output. GnuPG-bug-id: 6342
* core: New context flag "no-auto-check-trustdb"Ingo Klöcker2022-11-041-0/+13
| | | | | | | | | | | | | | | | | * src/context.h (gpgme_context): Add field no_auto_check_trustdb. * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add flag "no-auto-check-trustdb". * src/engine-gpg.c (engine_gpg): Add flags.no_auto_check_trustdb. (gpg_set_engine_flags): Set the flag. (build_argv): Pass option to gpg. * tests/run-keylist.c (show_usage, main): Add option --no-trust-check. -- This makes the --no-auto-check-trustdb option available in the GPGME API to disable the potentially expensive automatic trust database check. GnuPG-bug-id: 6261
* tests: Make t-edit-sign more robust.Werner Koch2022-08-101-4/+2
| | | | | | | * tests/gpg/t-edit-sign.c (interact_fnc): Provide the default answer. -- A default answer to prompts should always be given.
* tests: Add support for clear text signatures to test runnerIngo Klöcker2022-06-141-0/+6
| | | | | | | | * tests/run-sign.c (show_usage): Add new argument "--clear". (main): Handle new argument "--clear". -- GnuPG-bug-id: 6028
* Revert "tests: Avoid problems with local time across a day boundary."Ingo Klöcker2022-06-091-1/+1
| | | | This reverts commit 5ba0e454a37c9b0d3badddfc2dad8bcc7c7af874.
* tests: Avoid problems with local time across a day boundary.Werner Koch2022-05-231-1/+1
| | | | | | -- GnuPG-bug-id: 5991
* core: New function gpgme_op_receive_keysIngo Klöcker2022-02-032-1/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_receive_keys_start, gpgme_op_receive_keys): New. * src/gpgme.def, src/libgpgme.vers: Add them. * src/engine-backend.h (struct engine_ops): Add arg keyids to field 'import'. * src/engine.h, src/engine.c (_gpgme_engine_op_import): Add arg keyids. * src/engine.c (_gpgme_engine_op_import): Forward new arg keyids. * src/import.c: (_gpgme_op_import_start, _gpgme_op_import_keys_start): Pass NULL to new arg of _gpgme_op_import_start. (_gpgme_op_receive_keys_start, gpgme_op_receive_keys_start, gpgme_op_receive_keys): New. * src/engine-gpg.c (gpg_import): Add arg keyids. Extend check for valid arguments. Build command line if keyids are given. * src/engine-gpgsm.c (gpgsm_import): Add arg keyids. Return error if keyids is not NULL. tests/run-receive-keys.c: New. tests/Makefile.am (noinst_PROGRAMS): Add new test runner. -- The new function allows importing keys given by their key ids or fingerprints from a keyserver (like gpg's --recv-keys command). GnuPG-bug-id: 5808
* tests: Fix generation of keys without expirationIngo Klöcker2022-01-131-8/+16
| | | | | | | | | | | * tests/run-genkey.c (parse_expire_string): Support default expiration and no expiration. Set flag for no expiration. (main): Allow update of flags when generating new key. -- This makes the parsing of different values for expiration match the parsing done by gpg's --quick-gen-key. In particular, this makes it possible again to generate keys without expiration.
* tests: Remove unsupported option --status from usage helpIngo Klöcker2022-01-131-1/+0
| | | | | | | * tests/run-swdb.c (show_usage): Remove option --status. -- run-swdb does not support the option --status.
* core: Add new option --secret-subkey to help texts.Ingo Klöcker2022-01-041-0/+1
| | | | | | | | * src/gpgme-tool.c (hlp_export): Add new option. * tests/run-export.c (show_usage): Print new option. -- GnuPG-bug-id: 5757
* core: New export mode to export secret subkeys.Ingo Klöcker2022-01-041-0/+15
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET_SUBKEY): New. * src/export.c (check_mode): Allow new mode and check for invalid combinations. (export_keys_start): Return error if new mode flag is set. * src/engine-gpg.c (export_common): Implement. * src/gpgme-tool.c (cmd_export): New option --secret-subkey. * tests/run-export.c (main): New option --secret-subkey. -- This adds support for exporting secret subkeys (via gpg's --export-secret-subkeys) to gpgme_op_export[_ext][_start]. The flag is not supported by gpgme_op_export_keys[_start] because there is no way to specify which subkey(s) to export with these functions. GnuPG-bug-id: 5757
* core: Detect bad passphrase error on certificate importIngo Klöcker2021-12-222-5/+7
| | | | | | | | | | | | | | | | | | | | | * src/import.c (gpgme_op_import_result): Check fpr for NULL. (parse_error): New. (import_status_handler): Handle error status line. * doc/gpgme.texi (gpgme_import_status_t): Mention that fpr can be NULL. * tests/gpg/t-import.c (check_result): Check fpr for NULL. * tests/run-threaded.c (delete_impres): Check fpr for NULL. -- When importing an encrypted certificate a wrong passphrase may be entered. In this case gpgsm emits a status line with a bad passphrase error and an "invalid object" error. To make it possible for callers to handle a wrong passphrase error more gracefully, an import status with bad passphrase error is added to the import result for each status line with bad passphrase error. GnuPG-bug-id: 5713
* core: Allow setting import filters when importing keysIngo Klöcker2021-12-141-0/+14
| | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): New field import_filter. * src/engine-backend.h (struct engine_ops): Add arg import_filter to field 'import'. * src/engine-gpg.c (gpg_import): Add arg import_filter and pass option --import-filter with argument value to gpg. Adjust all callers. * src/engine-gpgsm.c (gpgsm_import): Add dummy arg import_filter. * src/gpgme.c (gpgme_release): Free 'import_filter'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "import-filter". * tests/run-import.c (main): Add option --import-filter. -- This makes the --import-filter option available in the GPGME API for key imports. GnuPG-bug-id: 5739
* core: Allow specifiying a key origin when importing keysIngo Klöcker2021-12-132-0/+39
| | | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): New field key_origin. * src/engine-backend.h (struct engine_ops): Add arg key_origin to field 'import'. * src/engine-gpg.c (gpg_import): Add arg key_origin and pass option --key-origin with argument value to gpg. Adjust all callers. * src/engine-gpgsm.c (gpgsm_import): Add dummy arg key_origin. * src/gpgme.c (gpgme_release): Free 'key_origin'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "key-origin". * tests/run-import.c (main): Add option --key-origin. * tests/gpg/t-import.c (main): Set and verify key origin. -- This makes the --key-origin option available in the GPGME API for key imports. GnuPG-bug-id: 5733
* core: Support all components with dirinfo()Ingo Klöcker2021-12-101-0/+5
| | | | | | | | | | | | | | | * src/dirinfo.c (WANT_KEYBOXD_NAME, WANT_AGENT_NAME, WANT_SCDAEMON_NAME, WANT_DIRMNGR_NAME, WANT_PINENTRY_NAME): New. (dirinfo): Add fields keyboxd_name, agent_name, scdaemon_name, dirmngr_name, pinentry_name. (parse_output): Support "keyboxd", "gpg-agent", "scdaemon", "dirmngr", "pinentry". (get_gpgconf_item): Return new components. tests/t-engine-info.c (main): Add new components to the output. -- GnuPG-bug-id: 5727
* tests: Silence libtool warning on Windows.Werner Koch2021-11-251-0/+6
| | | | * tests/Makefile.am (AM_LDFLAGS): Use --no-fast-install on Windows.
* core: Support dirinfo("socketdir")Werner Koch2021-11-251-0/+1
| | | | | | | | | | | | | | | | | | | * src/dirinfo.c (WANT_SOCKETDIR): New. (dirinfo): Add field socketdir. (parse_output): Support "socketdir". (get_gpgconf_item): Return socketdir. * tests/t-engine-info.c (main): Add socketdir to the output. * src/w32-util.c (_gpgme_create_process_utf8): Fix indentation. -- GnuPG-bug-id: 5613 This is not strictly necessary because we could deduce this from one of the other socket info items but it is more clean to have a dedicated info item. The socketdir item is available for 5 years now (GnuPG commit 8e3fa5a4b205c534de2142e5d071712f957cf06a)
* posix: Use poll instead, when available, removing use of select.NIIBE Yutaka2021-11-252-3/+127
| | | | | | | | | | | | | * configure.ac (HAVE_POLL_H): Add the check. * src/ath.c [!HAVE_POLL_H] (ath_select): Enable conditionally. * src/posix-io.c [HAVE_POLL_H] (_gpgme_io_select_poll): Use poll. * tests/gpg/t-cancel.c [HAVE_POLL_H] (do_select): Use poll. * tests/gpg/t-eventloop.c [HAVE_POLL_H] (do_select): Use poll. -- GnuPG-bug-id: 2385 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Build using GPG_ERROR_MT_LIBS for thread use.NIIBE Yutaka2021-11-121-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | * tests/gpg/Makefile.am (WITH_THREAD_CPPFLAGS): New. (WITH_THREAD_LDADD): New. (t_thread1_CPPFLAGS, t_thread_keylist_CPPFLAGS) (t_thread_keylist_verify_CPPFLAGS) (t_cancel_CPPFLAGS): Use WITH_THREAD_CPPFLAGS. (t_thread1_LDADD, t_thread_keylist_LDADD) (t_thread_keylist_verify_LDADD) (t_cancel_LDADD): Use WITH_THREAD_LDADD. -- For library dependency at runtime, it's not 100% right to use GPG_ERROR_MT_LIBS here, because those test programs don't use libgpg-error directly at runtime. But, it's OK, because these are test programs, which don't need specifying minimum library dependency. It would be too much for configure of gpgme, to check how threaded application should be built, just for these test programs. Co-authored-by: Ben Kibbey <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Use GPG_ERROR_MT_LIBS for a test with threads.NIIBE Yutaka2021-11-111-2/+3
| | | | | | | | | | | * tests/Makefile.am (run_threaded_CPPFLAGS): New. (run_threaded_LDADD): Replace GPG_ERROR_LIBS to GPG_ERROR_MT_LIBS. -- Reported-by: Ben Kibbey <[email protected]> Fixes-commit: d0402f886b720d03369887c807581bd980ee70cf Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Fix make distcheck problem.Werner Koch2021-08-272-4/+4
| | | | | | | * tests/start-stop-agent: Use -f with rm. Also use cat instead of cp. -- Also shorted some lines.
* Add missing files for distributionAndre Heinecke2021-08-271-1/+2
| | | | | * lang/qt/src/Makefile.am (private_qgpgme_headers): Add job_p.h * tests/gpg/Makefile.am (EXTRA_DIST): Add gpg.conf.in
* core: Ensure gpg.conf for tests is recreated if necessaryIngo Klöcker2021-07-082-5/+7
| | | | | | | | | | * tests/gpg/gpg.conf.in: New. * tests/gpg/Makefile.am (gpg.conf): Copy gpg.conf.in instead of using echo to fill gpg.conf. -- This change ensures that gpg.conf is updated whenever new options are added for some tests.
* core: Fix use-after-free issue in testIngo Klöcker2021-06-261-17/+37
| | | | | | | | | | | | * tests/gpg/t-edit-sign.c (sign_key, verify_key_signature): New. (main): Factored out signing and verifying the result. -- Factoring the two steps of the test into different functions fixes the use-after-free issue that was caused by accidentaly using a variable of the first step in the second step. GnuPG-bug-id: 5509
* core: Allow specifying an expiration date for key signaturesIngo Klöcker2021-06-222-1/+204
| | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): Add 'cert_expire'. * src/engine-gpg.c (append_args_from_cert_expire): New. (gpg_edit): Set option according to the new flag. * src/gpgme.c (gpgme_release): Free 'cert_expire'. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "cert-expire". * tests/gpg/Makefile.am (c_tests): Add new test. (gpg.conf): Write "allow-weak-key-signatures" to gpg.conf. * tests/gpg/t-edit-sign.c: New. -- The new context flag "cert-expire" allows setting the expiration date for key signatures created with gpgme_op_interact. GnuPG-bug-id: 5336, 5505
* core: New data flags "io-buffer-size" and "sensitive".Werner Koch2021-06-141-0/+34
| | | | | | | | | | | | | | | | | | | | | * src/data.c (_gpgme_data_release): Free buffers. (gpgme_data_seek): Adjust from renamed fields. (gpgme_data_set_flag): Implement new flags. (_gpgme_data_inbound_handler): Allow the use of a malloced buffer. (_gpgme_data_outbound_handler): Ditto. * src/data.h (BUFFER_SIZE): Move out of the struct definition. (struct gpgme_data): Remove pending filed and introduce inbound and outbound fields. * src/conversion.c (_gpgme_wipememory): New. Taken from GnuPG. * src/cJSON.c (wipememory): Use this here too. * tests/run-decrypt.c (main): Add options "--large-buffers" and "--sensitive". -- GnuPG-bug-id: 5478 Signed-off-by: Werner Koch <[email protected]>
* tests: Improve the output of the run-keylist helper.Werner Koch2021-05-281-8/+1
| | | | | | | | | | | | * tests/run-keylist.c (main): Print all infos from the primary key. -- The test tool printed only the computed infos for the key and not the detailed one fro the primary key. The new output better reflects the data structure. Related to GnuPG-bug-id: 5454
* core: Allow for older compilers.Werner Koch2021-05-122-2/+4
| | | | | | | | | | | | | | | * tests/run-verify.c (main): Remove C99-only syntax. * tests/run-threaded.c (start_keylistings): Ditto. -- Older gcc's do not grok this and there is no real need for it. run-verify.c:324: error: ‘for’ loop initial declarations are only allowed in C99 mode run-verify.c:324: note: use option -std=c99 or -std=gnu99 to compile your code Reported-by: Lars Hecking
* core: Extend gpgme_key_sig_t with trust signature members.Ingo Klöcker2021-05-051-0/+3
| | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_key_sig): Add fields 'trust_depth', 'trust_value', and 'trust_scope'. * src/key.c (gpgme_key_unref): Free trust_scope. * src/keylist.c (keylist_colon_handler): Set the fields. * tests/run-keylist.c (main): Print the fields. -- The trust signature values are part of gpg's output since the year 2003. This now adds support to gpgme. GnuPG-bug-id: 5245, 5419
* core: New flag GPGME_KEYSIGN_FORCE.Werner Koch2021-03-111-0/+6
| | | | | | | | | | * src/gpgme.h.in (GPGME_KEYSIGN_FORCE): New. * src/engine-gpg.c (gpg_keysign): Implement. * tests/run-keysign.c (show_usage): Add option --force -- GnuPG-bug-id: 4584
* core: Make listing of signatures work if only secret keys are listedIngo Klöcker2021-01-052-1/+629
| | | | | | | | | | * src/engine-gpg.c (gpg_keylist_build_options): Add "--with-sig-check" argument if signatures shall be listed. * tests/gpg/t-keylist-secret-sig.c: New. * tests/gpg/Makefile.am (c_tests): Add new test. -- GnuPG-bug-id: 3580
* core: New function gpgme_op_revsig.Ingo Klöcker2020-10-291-16/+43
| | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_revsig_start, gpgme_op_revsig): New. (GPGME_REVSIG_LFSEP): New. * src/context.h (ctx_op_data_id_t): Add OPDATA_REVSIG. * src/revsig.c: New. * src/Makefile.am (main_sources): Add revsig. * src/libgpgme.vers, src/gpgme.def: Add gpgme_op_revsig and gpgme_op_revsig_start. * src/engine.h, src/engine.c: (_gpgme_engine_op_revsig): New. * src/engine-backend.h (engine_ops): Add 'revsig' and adjust all engine initializers. * src/engine-gpg.c (gpg_revsig): New. (_gpgme_engine_ops_gpg): Set revsig to gpg_revsig. * doc/gpgme.texi: Document new functions. * tests/run-keysign.c: Add option --revoke. -- This extends GPGME to support the --quick-revoke-sig command added by GnuPG 2.2.24. This allows revoking key signatures. GnuPG-bug-id: 5094
* tests: Fix gcc incompatibilityWerner Koch2020-10-031-5/+13
| | | | | | | | | | * tests/json/t-json.c: Remove var definitions inside a for statement. -- This useful C99 feature seems to work only in recent gcc versions. We can't use it; see gnupg/doc/HACKING. GnuPG-bug-id: 5088
* core: Fully implement the inquire callback for assuan_transactWerner Koch2020-09-091-2/+2
| | | | | | | | | | | | | | | | | | | * src/engine-assuan.c (inquire_cb): Implement returning data. * tests/opassuan/t-command.c (inq_cb): Send some test data. -- The old code only allowed to send an empty response which was good enough for scdaemon's KNOWNCARDP inquire but not to send actual data. A quick test using a test smartcard might be ./t-command 'scd setattr --inquire PRIVATE-DO-1' and then reading the data back using gpg-connect-agent 'scd getattr PRIVATE-DO-1' /bye Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_setexpire.Ingo Klöcker2020-08-041-2/+77
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/genkey.c (setexpire): New. (gpgme_op_setexpire_start, gpgme_op_setexpire): New. * src/engine.h, src/engine.c: (_gpgme_engine_op_setexpire): New. * src/engine-backend.h (engine_ops): Add 'setexpire' and adjust all engine initializers. * src/engine-gpg.c (gpg_setexpire): New. (_gpgme_engine_ops_gpg): Set setexpire to gpg_setexpire. * doc/gpgme.texi: Document new functions. * tests/run-genkey.c: Add option --setexpire. -- This extends GPGME to support the --quick-set-expire command added by GnuPG 2.1.22. This allows changing subkeys expiry date without going through the editinteractor interface. Co-authored-by: Andre Heinecke <[email protected]> GnuPG-bug-id: 4999
* core: New export mode to export as OpenSSH public key.Werner Koch2020-07-161-36/+74
| | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SSH): New. * src/export.c (export_ext_start): Allow for new mode. * src/engine-gpg.c (export_common): Implement. * tests/run-export.c (status_cb): New. (main): New options --status and --ssh. -- GnuPG-bug-id: 4310 Signed-off-by: Werner Koch <[email protected]>
* core: Deprecate the non-working trustlist functions.Werner Koch2020-07-152-68/+1
| | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in: Clarify that the trustlist function should not be used. * src/engine.c (_gpgme_engine_op_trustlist): Always return an error. * src/engine-backend.h (struct engine_ops): Remove trustlist member. * src/engine-gpg.c (gpg_trustlist): Remove. (struct engine_ops): Remove that member. Also in all other engines. * tests/gpg/t-trustlist.c: Remove. * lang/python/tests/t-trustlist.py: Remove. -- This never worked in reality because the required feature has been removed from GnuPG version 1.3.2 soon after introduction of this feature in gpgme - 17 years ago. It was anyway marked as experimental. We keep the API and ABI, though. GnuPG-bug-id: 4834 Signed-off-by: Werner Koch <[email protected]>
* tests: Remove/change tests for GnuPG 2.3 with no gpg.keyserver.NIIBE Yutaka2020-05-111-4/+4
| | | | | | | * lang/qt/tests/t-config.cpp (testKeyserver): Remove. * tests/gpg/t-gpgconf.c (main): Test with dirmngr.keyserver. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests, json: Do not check for keygrip of pubkeysAndre Heinecke2020-05-081-2/+0
| | | | | | | | | | | | | | | | | | | * tests/json/t-keylist-secret.out.json: Do not check for keygrip of bravo key. -- Since GnuPG 2.2.19 the keygrip is not emitted for public keys in a keylisting --with-secret. As the GPGME test suite should pass with several versions the json test cannot test this as the suite does not allow version checks for different output. What the intended behavior is might still be up for discussion, always adding --with-keygip is not a good solution because it slows down keylistings for large keyrings. GnuPG-Bug-Id: T4820
* tests: Add ECC key generation for tests/gpgsm.NIIBE Yutaka2020-03-272-33/+65
| | | | | | * tests/gpgsm/t-genkey.c (check_result): New. Signed-off-by: NIIBE Yutaka <[email protected]>
* core: New context flags "include-key-block" and "auto-key-import".Werner Koch2020-03-172-1/+39
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_ctx_flag): Add flags "include-key-block" and "auto-key-import". (gpgme_get_ctx_flag): Ditto. * src/context.h (struct gpgme_context): Add flags include_key_block and auto_key_import. * src/engine-gpg.c (struct engine_gpg): Likewise. (gpg_set_engine_flags): Set the flags for gpg versions >= 2.2.20. (gpg_decrypt): Set option according to the new flags. (gpg_encrypt): Ditto. (gpg_encrypt_sign): Ditto. (gpg_sign): Ditto. (gpg_verify): Ditto. tests/run-verify: Add option --auto-key-import. tests/run-sign: add option --include-key-block. -- GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* Do not test for a bug in older GnuPG versionsAndre Heinecke2020-01-291-1/+0
| | | | | | | | | | | * tests/json/t-keylist-secret.out.json -- Since at least 2.2.19 GnuPG no longer emits secret = true for keys where it does not have a secret. To avoid failures with older versions we remove the check altogether. GnuPG-Bug-Id: T4820
* core: Extend gpgme_user_id_t with uidhash member.Werner Koch2019-12-131-0/+2
| | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_user_id): Add field 'uidhash'. * src/key.c (gpgme_key_unref): Free it. * src/keylist.c (keylist_colon_handler): Set it. * tests/run-keylist.c (main): Print it. -- The uidhash value is part of gpg's output since the year 2005. This now adds support to gpgme. The application for uidhash is to select a user id in an edit interactor: Instead of giving the number of the user id, the uidhash value can be be used to avoid tracking the user id numbers. Signed-off-by: Werner Koch <[email protected]>
* json: Fix t-decrypt-verify.out for GnuPG >= 2.3.NIIBE Yutaka2019-08-061-5/+0
| | | | | | | | | | | | | | | | | | | | | | * tests/json/t-decrypt-verify.out.json: Remove check with key of 04071FB807287134. -- GnuPG 2.3 changes how public key decryption works; It collects list of PUBKEY_ENC packets and then processes an ENCRYPTED* packet. At the stage of processing an ENCRYPTED* packet, it checks if private keys can decrypt any of PUBKEY_ENC packets. It does not necessarily examine all of PUBKEY_ENC packets. Only when it finds a PUBKEY_ENC packet cannot be decrypted, it reports STATUS_NO_SECKEY with keyid of that packet. GnuPG 2.2 or older tries PUBKEY_ENC packets in order, and the first successful PUBKEY_ENC packet is used. Rest of PUBKEY_ENC packets are not examined, but STATUS_NO_SECKEY with keyid is reported even when there is a valid private key. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Minor fix to run-threaded.c.Werner Koch2019-06-061-1/+5
| | | | | | | | | | * tests/run-threaded.c (random_data_close): Correct FD test. -- An invalid DS is -1 and not 0; this fix is for correctness and does not chnage anything in the real world. Signed-off-by: Werner Koch <[email protected]>
* tests: Add option "allow-del" to run-threadedAndre Heinecke2019-06-061-0/+74
| | | | | | | | | | | | | | | * tests/run-threaded.c (main): Handle allow-del. (allow-del): New. Variable to allow deletion of keys. (import): Delete key after import if allow-del is set. (delete_impres): Delete keys from an import result. (delete_fpr): Delete a key by fingerprint. -- This is intended to test write access and locking of the keyring by repeatedly importing and deleting pubkeys. It is an option because it might cause keyring corruption etc. so it should be explicitly enabled.
* tests: Implement import in run-threadedAndre Heinecke2019-06-051-0/+36
| | | | | * tests/run-threaded.c (import): New. (do_data_op): Call it.
* tests: Use synced output for error in run-threadedAndre Heinecke2019-06-051-2/+2
| | | | * tests/run-threaded.c (do_data_op): Use synced out macro.
* tests: Avoid variable named the same as a macroAndre Heinecke2019-06-051-8/+8
| | | | | | | | * tests/run-threaded.c (decrypt, verify): Don't use a variable name that is also a macro. -- It just looks confusing and strange at first glance.
* tests,w32: Fix thread creation in run-threadedAndre Heinecke2019-06-051-2/+4
| | | | | * tests/run-threaded.c (create_thread): Check proper return value and not return value of CloseHandle.