aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * common: Add new function b64decode.Werner Koch2023-10-025-18/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/b64dec.c (b64decode): New. * common/t-b64.c: Change license to LGPL. (oops): New macro. (hex2buffer): New. (test_b64decode): New. (main): Default to run the new test. * common/Makefile.am (module_maint_tests): Move t-b64 to ... (module_tests): here. -- Sometimes we have a short base64 encoded string we need todecode. This function makes it simpler. License change of the test module justified because I am the single author of the code.
| * dirmngr: Fix handling of the HTTP Content-LengthWerner Koch2023-09-261-16/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c (cookie_s): Add fields pending, up_to_empty_line, last_was_lf, and last_was_lfcr. (http_context_s): Add field keep-alive. (http_wait_response): Set up_to_empty_line. Take care of keep_alive flag. (coookie_read): Implement detection of empty lines. (cookie_write): Free the pending buffer. -- The problem we fix here is that we already buffered stuff beyond the empty line which marks the start of the content-length counting. Thus we tried to wait for more bytes despite that everything had already been read. This bug might have showed up more often in the real world since the we changed the BUFSIZ on Windows from 512 byte to 8k. It also depends on the length of the headers and whether the server closed the connection so that we ignored the Content-Length. The bug was introduced earlier than 2010 and could have the effect that a connection got stuck until the network layer timed out. Note that the keep-alive parts of the patch are not yet used.
| * common: Add gnupg_memstr to replace static versions.Werner Koch2023-09-264-62/+32
| | | | | | | | | | | | | | | | * common/stringhelp.c (gnupg_memstr): New. * common/mbox-util.c (my_memstr): Remove. (is_valid_mailbox_mem): Use gnupg_memstr. * common/recsel.c (my_memstr): Remove. (recsel_select): Use gnupg_memstr.
| * dirmngr: Require gnutls 3.2Werner Koch2023-09-262-139/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c: Remove gnutls version specific code. (send_request): Factor some code out to ... (run_proxy_connect): new. (mk_proxy_request): new. (mk_std_request): new. * configure.ac (NEED_GNUTLS_VERSION): Require 3.2. -- This patch is to factor out some code and also to remove support for legacy gnutls versions. Note that gnutls 3.2 was released 10 years ago.
| * dirmngr: Improve error codes returned from http fetching.Werner Koch2023-09-263-14/+20
| | | | | | | | | | | | * dirmngr/ks-engine-http.c (ks_http_fetch): Return better error codes. * dirmngr/ks-engine-hkp.c (send_request): Ditto. * dirmngr/t-http.c (main): New option --try-proxy.
| * dirmngr: Implement automatic proxy detection on Windows.Werner Koch2023-09-265-4/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c [W32]: Include winhttp.h (w32_get_internet_session): New. (w32_get_proxy): New. (get_proxy_for_url): Implement automatic proxy detection and fix error in last patch. (http_reinitialize): New. * dirmngr/dirmngr.c (dirmngr_sighup_action): Call reinitialize. * dirmngr/Makefile.am (NETLIBS) [W32]: Link with winhttp. -- GnuPG-bug-id: 5768
| * dirmngr: Further simplify the http code and improve a message.Werner Koch2023-09-261-125/+99
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c (make_fp_write, make_fp_read): New. (http_raw_connect): Use new functions. (http_wait_response): Ditto. (send_request): Ditto. Change proxy error diagnostic. (connect_server): Improve error message for host not found. -- GnuPG-bug-id: 5768
| * dirmngr: Cleanup the http module.Werner Koch2023-09-263-316/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (NEED_NTBTLS_VERSION): Require at least 0.2.0 so that we can remove a conditional compilation. * dirmngr/http.c (struct proxy_info_s): New. (release_proxy_info): New to keep proxy information in one object. (send_request): Factor some code out to ... (get_proxy_for_url): this, (send_request_basic_checks): this, (send_request_set_sni): this, (run_ntbtls_handshake): this, (run_gnutls_handshake): and this. -- Note that this also removes some never used code. For example the NTBTLS handshake has code taken from GNUTLS which was never used due to the different ways on how the certificates are checked. The proxy code has been factored out to make to prepare further authentication methods. The proxy_info_t was introduced for the same reason. Tested against gnutls and ntbtls builds. No proxy tests yet done, because we need more sophisticated tests anyway. GnuPG-bug-id: 5768
| * gpg: Fix --no-utf8-strings.Werner Koch2023-09-181-1/+1
| | | | | | | | | | | | | | | | * g10/gpg.c (main): Ignore --no-utf8-strings only on Windows. -- Fixes-commit: 8c41b8aac3efb78178fe1eaf52d8d1bbc44941a8 Reported-by: Ingo Klöcker
| * gpg: Add --list-filter properties sig_expires/sig_expires_dRobin H. Johnson via Gnupg-devel2023-09-152-0/+20
| | | | | | | | | | | | | | | | | | Modelled after key_expires/key_expires_d. This should be useful to detect upcoming certification expiry, so the certifications can be renewed in advance of the expiry. Signed-off-by: Robin H. Johnson <[email protected]>
| * dirmngr: Relax the detection of the "none" keyserver.Werner Koch2023-09-111-2/+7
| | | | | | | | | | | | | | | | | | * dirmngr/server.c (cmd_keyserver): Ignore also hkps://none. (ensure_keyserver): Better ignore also "none" with a hkp or hpks scheme. -- GnuPG-bug-id: 6708
| * common: Never remove /dev/null.Werner Koch2023-09-071-1/+6
| | | | | | | | | | | | | | * common/sysutils.c (gnupg_remove): Detect /dev/null. -- GnuPG-bug-id: 6556
| * gpg: Fix validity of re-imported keys.Werner Koch2023-09-061-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/trustdb.c (tdb_clear_ownertrusts): Detect stale validity records. -- GnuPG-bug-id: 6399 This problem was introduced by an actually very useful patch 2002-12-13 David Shaw <[email protected]> [...] * import.c (import_keys_internal): Used here so we don't rebuild the trustdb if it is still clean. (import_one, chk_self_sigs): Only mark trustdb dirty if the key that is being imported has any sigs other than self-sigs. Suggested by Adrian von Bidder. [the last part] The bug exhibited itself only after signing a key, deleting that key and then re-importing the original non-signed key.
| * dirmngr: Allow conf files to disable default keyservers.Werner Koch2023-09-063-5/+23
| | | | | | | | | | | | | | | | * dirmngr/server.c (ensure_keyserver): Detect special value "none" (cmd_keyserver): Ignore "none" and "hkp://none". -- GnuPG-bug-id: 6708
| * gpg: Fix last commit.Werner Koch2023-09-051-1/+1
| | | | | | | | | | | | | | * g10/keyid.c (hash_public_key): Do not pass the version. -- Fixes-commit: 1f76cbca35133969ccccfa324d633556e19a386c
| * gpg: Add option --with-v5-fingerprintWerner Koch2023-09-046-9/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oWithV5Fingerprint): New. (opts): Add new option. (main): Set option. * g10/options.h (opt): Add with_v5_fingerprint. * g10/keyid.c (hash_public_key): Factor out to ... (do_hash_public_key): this. Add new arg to foce v5 style hashing. (v5_fingerprint_from_pk): New. (v5hexfingerprint): New. * g10/keylist.c (print_fingerprint): Print v5 fingerprint for v4 keys if the option is set. -- GnuPG-bug-id: 6705
| * gpgsm: Add --always-trust feature.Werner Koch2023-08-316-7/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/gpgsm.h (opt): Re-purpose unused flag always_trust. (struct server_control_s): Add "always_trust". (VALIDATE_FLAG_BYPASS): New. * sm/gpgsm.c (oAlwaysTrust): New. (opts): Add "--always-trust" (main): Set option. * sm/server.c (option_handler): Add option "always-trust". (reset_notify): Clear that option. (cmd_encrypt): Ditto. (cmd_getinfo): Add sub-command always-trust. * sm/certchain.c (gpgsm_validate_chain): Handle VALIDATE_FLAG_BYPASS. * sm/certlist.c (gpgsm_add_to_certlist): Set that flag for recipients in always-trust mode. -- GnuPG-bug-id: 6559
| * doc: Add some hints for AD queries.Werner Koch2023-08-241-0/+65
| | | | | | | | | | | | -- This is repo only.
| * dirmngr: Fix LDAP time parser.Werner Koch2023-08-241-1/+2
| | | | | | | | | | | | | | | | | | * dirmngr/ldap-misc.c (rfc4517toisotime): Correct index. -- Obviously the parser assumes the standard ISO format with the 'T' before the hour. That is not correct here. We need this parser for the modifyTimestamp thingy.
| * build: Update libassuan.m4 to allow build with libassuan 3.NIIBE Yutaka2023-08-021-1/+4
| | | | | | | | | | | | | | | | * m4/libassuan.m4: Update from libassuan master. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpg: Add support for Subkey-Expire-Date.NIIBE Yutaka2023-07-251-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (enum para_name): Add pSUBKEYEXPIREDATE. (proc_parameter_file): Add support for pSUBKEYEXPIREDATE. (read_parameter_file): Add "Subkey-Expire-Date". -- Cherry-pick from master commit of: 23bcb78d279ebc81ec9340356401d19cf89985f1 Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpg: Fix expiration time when Creation-Date is specified.NIIBE Yutaka2023-07-251-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (parse_expire_string_with_ct): New function, optionally supply the creation time. (parse_expire_string): Use parse_expire_string_with_ct with no creation time. (proc_parameter_file): Use parse_expire_string_with_ct possibly with the creation time. -- Cherry-pick from master commit of: b07b5144ff6a9208ea27fe1e1518270bd22b382c GnuPG-bug-id: 5252 Signed-off-by: NIIBE Yutaka <[email protected]>
| * w32: Add keyboxd.exe to signed filesAndre Heinecke2023-07-211-0/+1
| | | | | | | | | | | | | | | | * build-aux/speedo.mk (AUTHENTICODE_FILES): Add keyboxd.exe -- This should prevent that keyboxd.exe is blocked on systems that only allow signed executables.
| * dirmngr: Add doc for faked-system-timeAndre Heinecke2023-07-212-2/+14
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (gpgrt_opt_t): Use string for oFakedSystemTime. (oFakedSystemTime): Use similar conversion as gpgsm has. * dirmngr/dirmngr.texi (faked-system-time): Document it. -- For testing X509 certificates this is usually required and then confusing that the example from the gpgsm man page does not work for dirmngr.
| * common:w32: Fix gnupg_w32_set_errno.NIIBE Yutaka2023-07-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | * common/sysutils.c (gnupg_w32_set_errno): Return EC. -- Cherry-pick master commit of: 4c6b759368bcf19a13df07c5c6080765ecac28ca Signed-off-by: NIIBE Yutaka <[email protected]>
| * dirmngr: Enable the call of ks_ldap_help_variables when USE_LDAP.NIIBE Yutaka2023-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/server.c [USE_LDAP] (cmd_ad_query): Conditionalize. -- Cherry-pick master commit of: dc13361524c1477b2106c7385f2059f9ea111b84 Signed-off-by: NIIBE Yutaka <[email protected]>
* | doc: Use the em dash to mark a break in a sentence.NIIBE Yutaka2023-11-073-21/+21
| | | | | | | | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | doc: Remove stray .RE in doc/gpgsm.texi.NIIBE Yutaka2023-11-061-1/+0
| | | | | | | | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | doc: Fix to avoid using en-dash for command options.NIIBE Yutaka2023-11-026-25/+26
| | | | | | | | | | | | | | -- GnuPG-bug-id: 6746 Signed-off-by: NIIBE Yutaka <[email protected]>
* | g10: Fix uninitalized variable use in sign_fileAndre Heinecke2023-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | * g10/sign.c (sign_file): Initialize gcry_md_hd_t to NULL. -- There are several jumps to leave before gcry_md_open is called so md should be initialized to NULL to avoid calling gcry_md_close on an uninitalized variable. GnuPG-Bug-Id: T6780
* | Minor style fixes.NIIBE Yutaka2023-10-0510-85/+85
| | | | | | | | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | tests:tpm2dtests: Modify tests with SWTPM and relax the condition.NIIBE Yutaka2023-10-053-32/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* | tests:tpm2dtests: Fix tests with SWTPM.NIIBE Yutaka2023-10-042-4/+7
| | | | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* | agent: Fix agent_update_private_key.NIIBE Yutaka2023-10-041-1/+1
| | | | | | | | | | | | | | | | | | * agent/findkey.c (agent_update_private_key): Check FNAME0. -- Fixes-commit: a216e9c028ee389c4bf0250b822d567ffe9ad85e Signed-off-by: NIIBE Yutaka <[email protected]>
* | build: Simplify detecting a TPM emulator.NIIBE Yutaka2023-10-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (TPMSERVER): Don't supply hard-coded path. (SWTPM, SWTPM_IOCTL, TSSSTARTUP): Likewise. -- Having hard-coded path has bad side effect; It may not be detected even if it's available with PATH. Signed-off-by: NIIBE Yutaka <[email protected]>
* | tools: Add TPM2DAEMON_SOCK_NAME for --remove-socketdir.NIIBE Yutaka2023-10-031-3/+7
| | | | | | | | | | | | | | | | * tools/gpgconf.c (main): Care about tpm2d. Emit correct ERR. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | 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 <[email protected]>
* | 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 <[email protected]>
* | tpm2d: Fix call to assuan_control.NIIBE Yutaka2023-10-021-1/+1
| | | | | | | | | | | | | | | | | | * tpm2d/tpm2daemon.c (main): Use ASSUAN_CONTROL_REINIT_SYSCALL_CLAMP. -- Fixes-commit: 9e4d52223945d677c1ffcb0e20dae48299e9aae1 Signed-off-by: NIIBE Yutaka <[email protected]>
* | tpm2d: Check SWTPM environment variable for swtpm support.NIIBE Yutaka2023-09-281-3/+9
| | | | | | | | | | | | | | | | * tpm2d/intel-tss.h (TSS_Create): Check SWTPM. -- Signed-off-by: James Bottomley <[email protected]>
* | agent: fix tpm2d keytotpm handlingNIIBE Yutaka2023-09-281-5/+28
| | | | | | | | | | | | | | | | | | | | | | * agent/divert-tpm2.c (agent_write_tpm2_shadow_key): Call agent_delete_key before agent_write_private_key. Recover from an error. -- Fixes-commit: a1015bf2fc07dabb1200eab5fa41f13e7bf98202 Signed-off-by: James Bottomley <[email protected]>
* | agent,common,gpg: Use unsigned int for 1-bit field.NIIBE Yutaka2023-09-263-11/+11
| | | | | | | | | | | | | | | | | | | | * agent/trustlist.c (struct trustitem_s): Use unsigned int. * common/audit.c (struct log_item_s): Likewise. * g10/packet.h (struct seckey_info): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent: Initialize FP for the case of error return.NIIBE Yutaka2023-09-261-1/+1
| | | | | | | | | | | | | | | | * agent/findkey.c (agent_write_private_key): Initialize FP. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | Use gpgrt_b64* API of libgpg-error.NIIBE Yutaka2023-09-2610-99/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/Makefile.am (common_sources): Remove b64enc.c and b64dec.c. (module_maint_tests): Remove t-b64. (t_b64_LDADD): Remove. * common/util.h: Remove the internal API. * common/ssh-utils.c (get_fingerprint): Use the gpgrt_b64 API. (ssh_public_key_in_base64): Likewise. * dirmngr/crlfetch.c (my_es_read, crl_close_reader): Likewise. * dirmngr/dirmngr-client.c (data_cb, do_lookup): Likewise. * dirmngr/misc.c (armor_data): Likewise. * g10/export.c (export_one_ssh_key, export_secret_ssh_key): Likewise. * tools/gpg-card.c (cmd_writecert): Likewise. * tools/mime-parser.c (parse_message_cb, mime_parser_release) (process_part_data): Likewise. * tools/wks-util.c (wks_armor_key): Likewise. -- GnuPG-bug-id: 6734 Signed-off-by: NIIBE Yutaka <[email protected]>
* | gpg: Fix last commit.Werner Koch2023-09-051-1/+1
| | | | | | | | | | | | | | * g10/keyid.c (hash_public_key): Do not pass the version. -- Fixes-commit: 1be7882344c5b3eae35539f6c3f490df197574bf
* | gpg: Add option --with-v5-fingerprintWerner Koch2023-09-046-9/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oWithV5Fingerprint): New. (opts): Add new option. (main): Set option. * g10/options.h (opt): Add with_v5_fingerprint. * g10/keyid.c (hash_public_key): Factor out to ... (do_hash_public_key): this. Add new arg to foce v5 style hashing. (v5_fingerprint_from_pk): New. (v5hexfingerprint): New. * g10/keylist.c (print_fingerprint): Print v5 fingerprint for v4 keys if the option is set. -- GnuPG-bug-id: 6705
* | agent: Fix timer round-up check when inserting an entry into cache.NIIBE Yutaka2023-09-041-1/+1
| | | | | | | | | | | | | | | | * agent/cache.c (insert_to_timer_list): Round up when >= a half second. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent: Fix sock_inotify_fd handling.NIIBE Yutaka2023-09-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (handle_connections): Also check SOCK_INOTIFY_FD when spawning check_onw_socket_thread. When removal of the socket is detected, do same as AGENT_PROBLEM_SOCKET_TAKEOVER. -- GnuPG-bug-id: 6692 Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent: Fix timer list management.NIIBE Yutaka2023-09-011-2/+6
| | | | | | | | | | | | | | | | | | * agent/cache.c (insert_to_timer_list): Update TV_SEC of the top entry when inserted. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent: Fix the previous commit.NIIBE Yutaka2023-09-011-3/+0
| | | | | | | | | | | | | | | | | | * agent/cache.c (remove_from_timer_list_new): Fix cut&paste error. TV_SEC field should not be touched. -- Signed-off-by: NIIBE Yutaka <[email protected]>