summaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tests:gpgscm: Raise an error correctly for process spawning.NIIBE Yutaka2024-09-131-3/+13
| | | | | | | | | | * tests/gpgscm/ffi.c (do_process_spawn_io): Handle ERR. (do_process_spawn_fd): Likewise. -- Reported-by: Marcel Telka <marcel@telka.sk> Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Updated PQC test data to the final Kyber algo id.Werner Koch2024-09-1110-342/+529
| | | | | | | | -- We actually reuse the private keys here by having deleted the subkey and crated a new one using the option "From existing key". Of course the encrypted data changed while the plaintext stayed the same.
* tests: Add two plaintext test mailsWerner Koch2024-08-292-0/+48
| | | | --
* common: On Windows, we care about how PIPE handles are inherited.NIIBE Yutaka2024-07-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (handle_connections): It's for POSIX. * kbx/keyboxd.c (handle_connections): Ditto. * scd/app.c (handle_connections): Ditto. * scd/scdaemon.c (handle_connections): Ditto. tpm2d/tpm2daemon.c (handle_connections): Ditto. * tests/gpgscm/ffi.c (do_pipe): Use GNUPG_PIPE_BOTH. (do_inbound_pipe): Use GNUPG_PIPE_INBOUND. (do_outbound_pipe): Use GNUPG_PIPE_OUTBOUND. * common/call-gpg.c (_gpg_encrypt): Specify outbound and inbound. (_gpg_decrypt): Likewise. * common/exechelp-posix.c (gnupg_create_pipe): Add an argument. * common/exechelp-w32.c (create_pipe_and_estream): Care about how PIPE handles are inherited to child process. (gnupg_create_pipe): Add an argument. * common/exechelp.h: Add enum values. -- Fixes-commit: af6c47b2910f394faf582800d60d88e9b4dcf834 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* common,kbx,tests: Clean up the PIPE function API.NIIBE Yutaka2024-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * common/call-gpg.c (_gpg_encrypt, _gpg_decrypt): Simply, use gnupg_create_pipe. * tests/gpgscm/ffi.c (do_inbound_pipe): Likewise. * common/exechelp.h (gnupg_create_inbound_pipe): Use gnupg_fd_t for native pipe descriptor and don't expose other end of pipe. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-posix.c (create_pipe_and_estream): Clean up. (gnupg_create_inbound_pipe): Fail if R_FD or R_FP is NULL. (gnupg_create_outbound_pipe: Ditto. * common/exechelp-w32.c (create_pipe_and_estream): Clean up. (gnupg_create_inbound_pipe): Fail if R_FD or R_FP is NULL. (gnupg_create_outbound_pipe: Ditto. (gnupg_create_pipe): Move the code from original create_pipe_and_estream to call _open_osfhandle. * common/exectool.c (gnupg_exec_tool_stream): Follow the change of API. * kbx/kbx-client-util.c (prepare_data_pipe): Likewise. -- GnuPG-bug-id: 7194 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Use gpgrt_process_spawn API from libgpg-error.NIIBE Yutaka2024-07-091-30/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/genkey.c (do_check_passphrase_pattern): Use the gpgrt API. * common/asshelp.c (start_new_service): Ditto. * common/exechelp.h: Remove gnupg_process_spawn API. * common/exechelp-posix.c: Remove gnupg_process_spawn implementation. * common/exechelp-w32.c: Likewise. * common/exectool.c (gnupg_exec_tool_stream): Use the gpgrt API. * common/t-exechelp.c (test_pipe_stream): Remove. * dirmngr/ldap-wrapper.c (destroy_wrapper, ldap_reaper_thread): Use the gpgrt API. (ldap_wrapper_connection_cleanup, ldap_wrapper): Ditto. * dirmngr/ldap.c, g10/call-keyboxd.c: No need to include exechelp.h. * g10/photoid.c (run_with_pipe, show_photo): Use the gpgrt API. * g13/be-encfs.c (run_umount_helper, run_encfs_tool): Ditto. * g13/g13.c, g13/mount.c, g13/runner.c: No need to include exechelp.h. * scd/apdu.c: No need to include exechelp.h. * scd/app.c (report_change): Use the gpgrt API. * sm/export.c, sm/import.c: No need to include exechelp.h. * tests/gpgscm/ffi.c (proc_object_finalize, proc_wrap) (do_process_spawn_io, do_process_spawn_fd, do_process_wait): Use the gpgrt API. * tools/gpg-auth.c: No need to include exechelp.h. * tools/gpg-card.c (cmd_gpg): Use the gpgrt API. * tools/gpg-connect-agent.c: No need to include exechelp.h. * tools/gpg-mail-tube.c (mail_tube_encrypt, prepare_for_appimage) (start_gpg_encrypt): Use the gpgrt API. * tools/gpgconf-comp.c (gpg_agent_runtime_change) (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Ditto. * tools/gpgconf.c (show_versions_via_dirmngr): Ditto. * tools/gpgtar-create.c (gpgtar_create): Ditto. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. -- GnuPG-bug-id: 7192 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* indent: Fix spellingDaniel Kahn Gillmor2024-05-315-6/+6
| | | | | | | | | | | | | -- These are non-substantive corrections for minor spelling mistakes within the GnuPG codebase. With something like this applied to the codebase, and a judiciously tuned spellchecker integrated as part of a standard test suite, it should be possible to keep a uniform orthography within the project. GnuPG-bug-id: 7116
* spawn: Remove spawn callback, introduce gnupg_spawn_actions.NIIBE Yutaka2024-05-311-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (call_spawn_cb): Remove. (gnupg_spawn_actions_new, gnupg_spawn_actions_release) (gnupg_spawn_actions_set_environ, gnupg_spawn_actions_set_atfork) (gnupg_spawn_actions_set_redirect) (gnupg_spawn_actions_set_inherit_fds): New. (my_exec, spawn_detached): Use spawn actions. (gnupg_spawn_helper): Remove. (gnupg_process_spawn): Remove callback, introduce gnupg_spawn_actions. * common/exechelp-w32.c: Ditto. * common/exechelp.h: Ditto. * agent/genkey.c (do_check_passphrase_pattern): Follow the change of gnupg_process_spawn API. * common/asshelp.c (start_new_service): Likewise. * common/exectool.c (gnupg_exec_tool_stream): Likewise. * common/t-exechelp.c (test_pipe_stream): Likewise. * dirmngr/ldap-wrapper.c (ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Likewise. * scd/app.c (report_change): Likewise. * tests/gpgscm/ffi.c (do_process_spawn_io, do_process_spawn_fd): Likewise. * tools/gpg-card.c (cmd_gpg): Likewise. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Likewise. (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Likewise. * tools/gpgconf.c (show_versions_via_dirmngr): Likewise. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* gpg: Support Kyber with Brainpool512r1.Werner Koch2024-04-2317-3/+726
| | | | | | | | | | | | | | * common/openpgp-oid.c (oidtable): Add GCRY_KEM_RAW_BP512. * agent/pkdecrypt.c (ecc_table): Support bp512 * g10/pkglue.c (do_encrypt_kem): Ditto. * tests/openpgp/samplekeys: Add sample keys for kyber_bp256, bp384, and bp512. * tests/openpgp/privkeys: Add corresponding private keys. * tests/openpgp/samplemsgs: Add sample messages for those keys. -- GnuPG-bug-id: 6815
* tests: Add two Kyber sample keys and messages.Werner Koch2024-04-2312-4/+562
| | | | | | -- GnuPG-bug-id: 6815
* tests: Avoid new C23 keyword true.Werner Koch2024-04-221-4/+4
| | | | | | | * tests/asschk.c (eval_boolean): s/true/tru/ -- GnuPG-bug-is: 7093
* tests: Add a sample PDF with a signatureWerner Koch2024-04-031-0/+0
| | | | --
* Merge branch 'STABLE-BRANCH-2-4'Werner Koch2024-03-121-1/+1
|\ | | | | | | | | | | | | | | -- Resolved conflicts: NEWS common/exechelp-w32.c configure.ac
| * doc: Fix spelling errors found by lintian.Werner Koch2024-01-291-1/+1
| | | | | | | | | | | | -- Reported-by: Andreas Metzler <ametzler@debian.org>
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2024-01-264-0/+15
|\| | | | | | | | | | | | | | | -- Fixed conflicts: NEWS configure.ac doc/gpg.texi
| * tests: Add two more sample p12 filesWerner Koch2024-01-234-0/+14
| | | | | | | | | | -- GnuPG-bug-id: 6940
| * speedo: Patch ELF binaries to use built librariesWerner Koch2024-01-121-0/+1
| | | | | | | | | | | | | | | | * build-aux/speedo.mk: Remove GUI stuff. Add patchelf feature. * Makefile.am (speedo): New target. -- GnuPG-bug-id: 6710
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2023-11-075-0/+24
|\| | | | | | | | | | | | | * common/b64dec.c (b64decode): Move to ... * common/miscellaneous.c: here. * common/t-b64.c: Re-inroduce and keep only the b64decode test code.
| * sm: Another partly rewrite of minip12.cWerner Koch2023-10-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (struct tlv_ctx_s): Add origbuffer and origbufsize. Remove pop_count. Rename offset to length. (dump_tag_info, _dump_tag_info): Rewrite. (dump_tlv_ctx, _dump_tlv_ctx): Rewrite. (tlv_new): Init origbuffer. (_tlv_peek): Add arg ti. (tlv_peek): New. (tlv_peek_null): New. (_tlv_push): Rewrite. (_tlv_pop): Rewrite. (tlv_next): New macro. Move old code to ... (_tlv_next): this. Add arg lno. Pop remaining end tags. (tlv_popped): Remove. (tlv_expect_object): Handle ndef. (tlv_expect_octet_string): Ditto. (parse_bag_encrypted_data): Use nesting level to control the inner loop. (parse_shrouded_key_bag): Likewise. (parse_bag_data): Handle surplus octet strings. (p12_parse): Ditto. * sm/minip12.c (decrypt_block): Strip the padding. (tlv_expect_top_sequence): Remove. Replace callers by tlv_expect_sequence. * tests/cms/samplekeys/t6752-ov-user-ff.p12: New sample key. * tests/cms/samplekeys/Description-p12: Add its description -- This patch improves the BER parser by simplifying it. Now tlv_next pops off and thus closes all containers regardless on whether they are length bounded or ndef. tlv_set_pending is now always used to undo the effect of a tlv_next in a loop condition which was terminated by a nesting level change. Instead of using the length as seen in the decrypted container we now remove the padding and let the BER parser do its work. This might have a negative effect on pkcs#12 objects which are not correctly padded but we don't have any example of such broken objects. GnuPG-bug-id: 6752
| * sm: Support more HMAC algos in the pkcs#12 parser.Werner Koch2023-10-063-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (oid_hmacWithSHA1): New. Also for the SHA-2 algos. (digest_algo_from_oid): New. (set_key_iv_pbes2): Add arg digest_algo. (crypt_block): Ditto. (decrypt_block): Ditto. (parse_bag_encrypted_data): Parse the optional prf part and get the hmac algorithm. (parse_shrouded_key_bag): Ditto. (p12_build): Pass SHA1 for digest_algo. * sm/t-minip12.c (run_one_test): Print failed values in verbose mode. * tests/cms/samplekeys/nistp256-openssl-self-signed.p12: New. * tests/cms/samplekeys/Description-p12: Add this one. * tests/cms/Makefile.am (EXTRA_DIST): Ditto. -- This supports the modern algorithms, i.e. using SHA256 for the KDF which is the default in openssl unless the -legacy option is used. GnuPG-bug-id: 6536
| * tests:tpm2dtests: Modify tests with SWTPM and relax the condition.NIIBE Yutaka2023-10-062-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (SWTPM_IOCTL): Remove. (TEST_LIBTSS): Fix the condition. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Remove SWTPM_IOCTL. * tests/tpm2dtests/start_sw_tpm.sh: Add --flags to invoke SWTPM, not requiring SWTPM_IOCTL and TSSSTARTUP any more. -- Cherry-picked from master commit of: 227b3b14f4be2f33ed721818c2186e7fca4cebdf GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
| * tests:tpm2dtests: Fix tests with SWTPM.NIIBE Yutaka2023-10-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (TEST_LIBTSS): Fix the condition with SWTPM. * tests/tpm2dtests/start_sw_tpm.sh: Use --daemon and --pid to run SWTPM. -- Cherry-picked from master commit of: 98dd6f7af6aa3dcce19f20c22e3f825676e6b184 GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
| * tests:tpm2dtests: Fix tests with TPM2D.NIIBE Yutaka2023-10-063-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Fix. * tests/tpm2dtests/all-tests.scm: Follow the change of gpgscm. * tests/tpm2dtests/run-tests.scm: Likewise. -- Cherry-picked from master commit of: 321f9c0a3f2873cb3007e2bc2a542bbd0b2cc974 GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
| * sm: Improve the octet string cramming for pkcs#12Werner Koch2023-10-053-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (need_octet_string_cramming): New. (tlv_expect_object, tlv_expect_octet_string): Run the test before cramming. * sm/minip12.c (ENABLE_DER_STRUCT_DUMPING): New but undefined macro for debug purposes. (bag_decrypted_data_p, bag_data_p): Use macro to allow dumping. -- This bug was exhibited by importing a gpgsm exported EC certificate. We use an extra test instead of retrying to allow retruning an error from malloc failure. And well, for easier reading of the code. GnuPG-bug-id: 6536
* | tests:tpm2dtests: Modify tests with SWTPM and relax the condition.NIIBE Yutaka2023-10-052-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (SWTPM_IOCTL): Remove. (TEST_LIBTSS): Fix the condition. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Remove SWTPM_IOCTL. * tests/tpm2dtests/start_sw_tpm.sh: Add --flags to invoke SWTPM, not requiring SWTPM_IOCTL and TSSSTARTUP any more. -- GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | tests:tpm2dtests: Fix tests with SWTPM.NIIBE Yutaka2023-10-041-3/+6
| | | | | | | | | | | | | | | | | | | | | | * configure.ac (TEST_LIBTSS): Fix the condition with SWTPM. * tests/tpm2dtests/start_sw_tpm.sh: Use --daemon and --pid to run SWTPM. -- GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | tests:tpm2dtests: Fix tests with TPM2D.NIIBE Yutaka2023-10-033-11/+16
| | | | | | | | | | | | | | | | | | | | | | * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Fix. * tests/tpm2dtests/all-tests.scm: Follow the change of gpgscm. * tests/tpm2dtests/run-tests.scm: Likewise. -- GnuPG-bug-id: 6052 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | tests:gpgscm: Fix process select loop.NIIBE Yutaka2023-10-031-8/+2
| | | | | | | | | | | | | | | | | | * tests/gpgscm/ffi.c (do_process_spawn_io): Clear READ_FDSET in the loop. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | Merge branch 'STABLE-BRANCH-2-4' into masterWerner Koch2023-07-045-8/+40
|\|
| * sm: Adding missing stuff to the PKCS#12 parser rewrite.Werner Koch2023-06-294-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c (struct bufferlist_s): New. (struct tlv_ctx_s): Add bufferlist. (tlv_register_buffer): New. (tlv_release): Release bufferlist. (tlv_expect_object): Handle octet string cramming. (tlv_expect_octet_string): Ditto. (cram_octet_string): Changed interface. We don't need the input_consumed value anymore. * sm/minip12.c (parse_shrouded_key_bag): Also parse the attribute set. * sm/t-minip12.c (main): Add option --no-extra. (cert_collect_cb, run_tests_from_file): Fix memory leak * tests/cms/samplekeys/t5793-openssl.pfx: New from T5793. * tests/cms/samplekeys/t5793-test.pfx: Ditto. * tests/cms/samplekeys/Description-p12: Add them. * tests/cms/Makefile.am (EXTRA_DIST): Add samplekeys. -- This should finish the rewrite of the pkcsc#12 parser for now. More fun is likely to come. GnuPG-bug-id: 6536, 5793
| * sm: Major rewrite of the PKCS#12 parserWerner Koch2023-06-282-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/minip12.c: Reworked most of the parser. (p12_set_verbosity): Add arg debug and change all callers. * sm/t-minip12.c: Major rewrite to run regression tests unattended. * sm/Makefile.am (module_maint_tests): Move t-Minit to ... (module_tests): here. * tests/cms/samplekeys/Description-p12: New. -- Note that cram_octet_string stuff has not yet been reworked. I need to locate the sample files first. GnuPG-bug-id: 6536
* | tests:gpgscm: Add annotation for unreachable code for GCC.NIIBE Yutaka2023-06-261-0/+4
| | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme.c [__GNUC__] (type_to_string): Use __builtin_unreachable for GCC. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | tests: Fix call-with-io deadlock.NIIBE Yutaka2023-06-082-46/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/ffi.c (es_wrap): Ifdef-out. [HAVE_W32_SYSTEM] (read_from_pipe): New. (do_process_spawn_io): Rename from do_process_spawn. Do I/O with no deadlock. * tests/gpgscm/tests.scm (call-with-io): Use process-spawn-io. (es-read-all): Remove. -- GnuPG-bug-id: 6523 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | common,agent,gpg,dirmngr,g13,scd,tests,tools: New spawn function.NIIBE Yutaka2023-05-115-167/+174
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (do_exec, gnupg_spawn_process): Remove. (check_syscall_func, pre_syscall, post_syscall) : New. (do_create_socketpair, posix_open_null, call_spawn_cb): New. (my_exec, spawn_detached, gnupg_spawn_helper): New. (gnupg_process_spawn, process_kill, gnupg_process_terminate): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_release): New. (gnupg_process_wait_list): New. * common/exechelp-w32.c: Add definition of _WIN32_WINNT as 0x600. (check_syscall_func, pre_syscall, post_syscall): New. (gnupg_spawn_process): Remove. (check_windows_version): New. (spawn_detached, gnupg_spawn_helper, gnupg_process_spawn): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_kill, process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_terminate): New. (gnupg_process_release, gnupg_process_wait_list): New. * common/exechelp.h: Re-write for new API. * common/exectool.c (gnupg_exec_tool_stream): Follow the change. * common/asshelp.c (start_new_service): Likewise. * agent/genkey.c (do_check_passphrase_pattern): Likewise. * dirmngr/ldap-wrapper.c (struct wrapper_context_s): Use PROC. (destroy_wrapper): Follow the change of API. (read_log_data): Follow the change of API, use printable_pid. (ldap_reaper_thread, ldap_wrapper_release_context): Likewise. (ldap_wrapper_connection_cleanup, ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Follow the change of API. (show_photo): Likewise. * g13/be-encfs.c (run_umount_helper): Likewise. (run_encfs_tool): Likewise. * g13/g13.c: Add including ./common/exechelp.h. * g13/mount.c: Likewise. * g13/runner.c: Follow the change of API. * g13/runner.h: Follow the change of API. * scd/app.c (setup_env): New. (report_change): Follow the change of API. * tests/gpgscm/ffi.c (proc_object_finalize): New. (proc_object_to_string): New. (proc_wrap, proc_unwrap): New. (do_spawn_process): Remove. (do_process_spawn): New. (setup_std_fds): New. (do_spawn_process_fd): Remove. (do_process_spawn_fd): New. (do_wait_process): Remove. (do_process_wait): New. (do_wait_processes): Remove. * tests/gpgscm/t-child.scm: Follow the change of API. * tests/gpgscm/tests.scm: Likewise. * tests/openpgp/defs.scm: Likewise. * tests/tpm2dtests/defs.scm: Likewise. * tools/gpg-card.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgconf.c: Likewise. * tools/gpgtar-create.c: Likewise. * tools/gpgtar-extract.c: Likewise. * tools/gpgtar-list.c: Likewise. -- GnuPG-bug-id: 6275 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Fix tests/gpgme for in-source-tree builds.NIIBE Yutaka2022-12-212-5/+4
| | | | | | | | | | | * tests/gpgme/Makefile.am: Don't use setup.scm/ dir. * tests/gpgme/all-tests.scm: Fix the name of the environment. -- GnuPG-bug-id: 6313 Fixes-commit: c19ea75f10d6278569619f90977ce7c820e9319d Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Fix missing test message.Werner Koch2022-12-161-2/+2
| | | | --
* tests: Fix make check with GPGME.NIIBE Yutaka2022-12-161-0/+5
| | | | | | | | * tests/gpgme/Makefile.am: Create directories for logs. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Simplify fake-pinentry to use the option only.NIIBE Yutaka2022-12-021-31/+41
| | | | | | | | | | | * tests/openpgp/fake-pinentry.c (parse_pinentry_user_data): New. (main): Don't use PINENTRY_USER_DATA env var. -- Since environment variable is unreliable, use the option only. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Fix fake-pinentry for Windows.NIIBE Yutaka2022-12-021-8/+1
| | | | | | | | | | | | | | * tests/openpgp/fake-pinentry.c (main): Override PINENTRY_USER_DATA, by the option. -- In the Assuan implementation for Windows, spawn function doesn't call the atfork callback. Thus, the environment variable is not updated by gpg-agent when it spawns pinentry. Reliable way is the interaction to override the option. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Put a workaround for semihosted environment.NIIBE Yutaka2022-12-011-0/+3
| | | | | | | | | | | | * tests/openpgp/defs.scm [*win32*]: Use --build-prefix option. -- On the semihosted environment, output of simple gpgconf --list-components includes drive name (like Z:), which results failure of command invocation. This is a workaround. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: More fix for semihosted environment.NIIBE Yutaka2022-12-012-1/+3
| | | | | | | | | | * common/all-tests.scm: Conditionalize by *win32*. * tests/cms/Makefile.am (GPGSM): Add missing GPGSM. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Fix tests under cms.NIIBE Yutaka2022-12-011-2/+0
| | | | | | | | | * tests/cms/all-tests.scm: Remove merge mistake. -- Fixes-commit: 1246e16432b4240ad81c0bd757d7458b609dfd96 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests,w32: Fix for semihosted environment.NIIBE Yutaka2022-12-011-1/+1
| | | | | | | | * tests/cms/Makefile.am (OLD_TESTS_ENVIRONMENT): Add EXEEXT. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Fix to support --enable-all-tests and variants.NIIBE Yutaka2022-11-248-16/+36
| | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (test::scm): Add VARIANT argument. (tests::new): Likewise. (open-log-file, report): Support VARIANT. * tests/gpgme/all-tests.scm (setup-c, setup-py): Follow the change. * tests/cms/all-tests.scm: Likewise. * tests/cms/run-tests.scm: Likewise. * tests/migrations/all-tests.scm: Likewise. * tests/migrations/run-tests.scm: Likewise. * tests/openpgp/all-tests.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. -- Forward port from 2.2 branch of: 0fd7a902070ad9bdd835fa57dbadff25917bca42 Fixes-commit: 1c88104a3f00f7ca3790fbaab8f67b2b68cd6e18 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests:w32: Fix for non-dot file name for Windows.NIIBE Yutaka2022-11-241-1/+1
| | | | | | | | | | | | * tests/migrations/from-classic.scm (assert-migrated): Handle the case on Windows. -- Forward port from 2.2 branch of: 754175a46d3bc34e9ef8098dbd05abdfd61ada64 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests:gpgscm:w32: Fix for GetTempPath.NIIBE Yutaka2022-11-241-0/+5
| | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_temp_path): Remove the last backslash. -- Forward port from 2.2 branch of: 9a75460652d6055983930e80e022396f613ed6f7 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Keep .log files in objdir.NIIBE Yutaka2022-11-241-1/+3
| | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (open-log-file): Keep the log file in objdir. -- Forward port from 2.2 branch of: 1c88104a3f00f7ca3790fbaab8f67b2b68cd6e18 Before the change, it is at ephemeral temp directory which is removed. This is not useful at all. Possibly, it was done before the introduce of ephemeral temp directory for each test and not changed. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Use 233 for invalid value of FD.NIIBE Yutaka2022-11-241-1/+1
| | | | | | | | | | | | | | * tests/openpgp/issue2941.scm: Use 233. -- Forward port from 2.2 branch of: 43722438a826e1a162723a23452018ccf1b640ec On Windows machine (emulated by Wine), 23 may be valid value for handle. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* tests: Add tests to check that OCB is only used for capable keys.Werner Koch2022-11-048-11/+121
| | | | | | | | | * tests/openpgp/samplekeys/ed25519-cv25519-sample-2.asc: New. * tests/openpgp/samplekeys/ed25519-cv25519-sample-1.asc: Add AEAD preference. * tests/openpgp/defs.scm (tr:gpgstatus): New. (create-legacy-gpghome): Also import .key private keys. * tests/openpgp/encrypt.scm: Add OCB tests.
* tests: Add symmetric decryption tests.Werner Koch2022-11-026-0/+83
| | | | | | | | | | | | | * tests/openpgp/decrypt-sym.scm: New. * tests/openpgp/samplemsgs/enc-sym-cfb-1.asc: New. * tests/openpgp/samplemsgs/enc-sym-cfb-2.asc: New. * tests/openpgp/samplemsgs/enc-sym-ocb-1.asc: New. * tests/openpgp/samplemsgs/enc-sym-ocb-2.asc: New. -- It's time to have some OCB tests in our suite so that we don't forget to run the tests from our RNP interop tests. Also adds new tests for CFB messages.