aboutsummaryrefslogtreecommitdiffstats
path: root/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * common: Support not-removing the lockfile by dotlock_destroy.NIIBE Yutaka2023-12-201-1/+4
| | | | | | | | | | | | | | | | | | * common/dotlock.c (dotlock_destroy): Keep the lock when DOTLOCK_LOCK_BY_PARENT. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * common: Fix a possible resource leak for dotlock.NIIBE Yutaka2023-12-201-2/+5
| | | | | | | | | | | | | | | | | | * common/dotlock.c (dotlock_destroy_unix): Don't release ->TNAME here. (dotlock_destroy): Release the memory unconditionally. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * common: Improve the parsing of gpgconf.ctl variables.Werner Koch2023-12-191-30/+27
| | | | | | | | | | | | | | | | * common/homedir.c (unix_rootdir): Simplify. -- This also relaxes the syntax in that the equal sign may now be surrounded by any number of spaces.
| * common: Enhance dotlock, so that we can have a CLI util.NIIBE Yutaka2023-12-192-11/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dotlock.h (DOTLOCK_LOCK_BY_PARENT, DOTLOCK_LOCKED): New. * common/dotlock.c [HAVE_POSIX_SYSTEM]: Include <dirent.h>. (dotlock_get_process_id, dotlock_detect_tname): New. (dotlock_create_unix): Handle the case when no_write option is specified. Not creating the lock file, but detect the the file of tname. (dotlock_create) [HAVE_POSIX_SYSTEM]: Add support of DOTLOCK_LOCK_BY_PARENT and DOTLOCK_LOCKED for dotlock CLI util. (dotlock_take_unix): Support the case of DOTLOCK_LOCK_BY_PARENT. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * common: Add an info callback to dotlock.Werner Koch2023-12-183-11/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/dotlock.h (enum dotlock_reasons): New. (DOTLOCK_PREPARE_CREATE): New flag. * common/dotlock.c (struct dotlock_handle): Add info_cb and info_cb_value. (dotlock_create): Support the new flag. (dotlock_finish_create): New. (read_lockfile): Silence in case of ENOENT. (dotlock_set_info_cb): New. Use callback after all error and info messages. (dotlock_take_unix, dotlock_take_w32): Allow termination by callback.
| * common: Improve error return for dotlock.Werner Koch2023-12-121-2/+8
| | | | | | | | | | | | * common/dotlock.c (dotlock_take_unix): Return a ETIMEDOUT insteaad of EACCESS on timeout. (dotlock_take_w32): Ditto.
| * common: Check wether to set the modified flag in nve_set.Werner Koch2023-11-211-22/+8
| | | | | | | | | | * common/name-value.c (nvc_set): Factor code out to ... (nve_set): here.
| * agent: Update the key file only if not changed.Werner Koch2023-11-212-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/name-value.c (struct name_value_container): Add flag "modified". (nvc_modified): New. (nvc_new): Set flag. (_nvc_add): Set flag. (nvc_delete): Set flag. (nvc_set): Set flag unless value did not change. (nve_set): Add arg PK. Change the caller. * agent/findkey.c (agent_write_private_key): Update only if modified. -- This helps software which uses a file system watcher to track changes to private keys. In particular smartcard triggered changes are a problem for such software because this may at worst trigger another smartcard read. GnuPG-bug-id: 6829
| * gpg: Report BEGIN_* status before examining the input.NIIBE Yutaka2023-11-164-108/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/miscellaneous.c (is_openpgp_compressed_packet) (is_file_compressed): Moved to ... * common/iobuf.c: ... in this file. (is_file_compressed): Change the argument to INP, the iobuf. * common/util.h (is_file_compressed): Remove. * common/iobuf.h (is_file_compressed): Add. * g10/cipher-aead.c (write_header): Don't call write_status_printf here. (cipher_filter_aead): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/cipher-cfb.c (write_header): Don't call write_status_printf here. (cipher_filter_cfb): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/encrypt.c (encrypt_simple): Use new is_file_compressed function, after call of iobuf_push_filter. (encrypt_crypt): Likewise. * g10/sign.c (sign_file): Likewise. -- Cherry-pick from master commit of: 2f872fa68c6576724b9dabee9fb0844266f55d0d GnuPG-bug-id: 6481 Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpgsm: Support ECDSA in de-vs mode.Werner Koch2023-11-082-2/+12
| | | | | | | | | | | | | | | | | | | | | | * common/compliance.h (PK_ALGO_FLAG_ECC18): New. * common/compliance.c (gnupg_pk_is_allowed): Implement. * sm/decrypt.c (gpgsm_decrypt): Pass new flag. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6802
| * common: Declare two LibrePGP constants for future useWerner Koch2023-11-081-0/+3
| | | | | | | | | | * common/openpgpdefs.h (SIGSUBPKT_META_HASH): New. (SIGSUBPKT_TRUST_ALIAS): New.
* | gpg: Implement a parser for Kyber encrypted packets.Werner Koch2023-11-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/misc.c (pubkey_get_nenc): Add ky768 and ky1024 values. * g10/parse-packet.c (read_octet_string): New. (read_size_body): Rename to ... (read_sized_octet_string): this and change args to update-able PKTLEN. (parse_pubkeyenc): Split general parsing loop for easier reading. Implement parser for the Kyber algorithms. -- Take care: this has not been tested at all, it merely passes the regression test for the other algos. Kyber is also known as ML-KEM in FIPS-203. The list mode is slighly changed: In case of a parsing error no data is printed - before that already parsed data was printed. GnuPG-bug-id: 6815
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2023-11-0719-1063/+1360
|\| | | | | | | | | | | | | * common/b64dec.c (b64decode): Move to ... * common/miscellaneous.c: here. * common/t-b64.c: Re-inroduce and keep only the b64decode test code.
| * w32: Use utf8 for the asctimestamp function.Werner Koch2023-10-271-1/+1
| | | | | | | | | | | | | | | | * common/gettime.c (asctimestamp) [W32]: Use ".UTF8" for the locale. -- This has been suggested by the reporter of GnuPG-bug-id: 6741
| * common: New functions timegm_u64, isotime2epoch_u64.Werner Koch2023-10-264-154/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/mischelp.c (timegm): Move to ... * common/gettime.c (timegm): here. On Windows use timegm_u32. (timegm_u32): New. (isotime2epoch): Factor code out to ... (isotime_make_tm): new helper. (isotime2epoch_u64): New. (_win32_timegm): Remove duplicated code. (parse_timestamp): Use of timegm. (scan_isodatestr): Fallback to isotime2epoch_u64. -- This mainly helps on 32 bit Windows. For Unix we assume everyone is using 64 bit or shall wait until the libc hackers finally provide a time64_t. GnuPG-bug-id: 6736
| * common: Provide API to parse BER/TLV encodings.Werner Koch2023-10-243-2/+855
| | | | | | | | | | | | | | | | | | * sm/minip12.c: Factor parsing code out to ... * common/tlv-parser.c: new. Extend function names and provide a few extra functions. * common/Makefile.am (common_sources): Add new file. * sm/minip12.c: Adjust to use the new parser API.
| * common: New function scan_secondsstr.Werner Koch2023-10-144-2/+76
| | | | | | | | | | | | | | * common/gettime.c (scan_secondsstr): New. * common/t-gettime.c (test_scan_secondsstr): (main): Call it.
| * scd:openpgp: Return better error codes for the Reset Code.Werner Koch2023-10-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (do_change_pin): Use GPG_ERR_BAD_RESET_CODE where appropriate. * common/util.h: Add error codes missing in gpgrt 1.46. * agent/call-pinentry.c (unlock_pinentry): Handle GPG_ERR_BAD_RESET_CODE. (agent_askpin): Ditlo. Also simply condition. (agent_get_passphrase): Ditto. * g10/call-agent.c (status_sc_op_failure): Handle GPG_ERR_BAD_RESET_CODE. * g10/card-util.c (write_sc_op_status): Ditto. * tools/card-call-scd.c (status_sc_op_failure): Ditto.
| * common: Improve lock strategy for dotlock.Werner Koch2023-10-021-40/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dotlock.c (next_wait_interval): New. (dotlock_take_unix): Use new function. (dotlock_take_w32): Ditto. -- In particular when using a dotlock file for protecting the spawning and several processes try to spawn the agent or another component, we often run into long delays. The solution is to is to exponential backoff and also to reduce the initial delay from 50ms to 4ms. We further limit the maximum wait period to about 2 seconds and then repeat at intervals of 512, 1024 and 2048ms. In the wait-forever case we add a small random value to have different intervals per process. GnuPG-bug-id: 3380 For testing this code snippet in the spawning function might be useful: const char *s; if ((s=getenv("hold_gpg_file"))) while (!gnupg_access (s, F_OK)) gnupg_sleep (1);
| * 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.
| * 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.
| * common: Never remove /dev/null.Werner Koch2023-09-071-1/+6
| | | | | | | | | | | | | | * common/sysutils.c (gnupg_remove): Detect /dev/null. -- GnuPG-bug-id: 6556
| * 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]>
* | agent,common,gpg: Use unsigned int for 1-bit field.NIIBE Yutaka2023-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | * 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]>
* | Use gpgrt_b64* API of libgpg-error.NIIBE Yutaka2023-09-263-44/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* | common: Prepare for more flags in start_new_service.Werner Koch2023-08-293-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/asshelp.h (ASSHELP_FLAG_AUTOSTART): New. * common/asshelp.c (start_new_service): Rename arg autostart to flags and adjust checks. (start_new_gpg_agent): Likewise. Change all callers. (start_new_keyboxd): Likewise. Change all callers. (start_new_dirmngr): Likewise. Change all callers. -- It is easier to have a generic flags arg instead of adding more and more dedicated args. verbose and debug are kept as they are because they are not boolean.
* | commond: Introduce FD2NUM to express conversion to number of fds.NIIBE Yutaka2023-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.h (FD2NUM): New. * agent/call-pinentry.c (watch_sock): Use FD2NUM. * agent/gpg-agent.c (handle_connections): Likewise. * dirmngr/dirmngr.c (handle_connections): Likewise. * dirmngr/http.c (connect_with_timeout): Likewise. * kbx/keyboxd.c (handle_connections): Likewise. * scd/scdaemon.c (handle_connections): Likewise. * tpm2d/tpm2daemon.c (handle_connections): Likewise. -- GnuPG-bug-id: 6598 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common,w32: Fix FD2INT macro.NIIBE Yutaka2023-07-181-1/+5
| | | | | | | | | | | | | | | | | | | | * common/sysutils.h [HAVE_W32_SYSTEM] (FD2INT): Use intptr_t for 64-bit Windows. -- GnuPG-bug-id: 6598 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common: Introduce FD_DBG to display gnupg_fd_t value.NIIBE Yutaka2023-07-182-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.h (FD_DBG): New. * agent/gpg-agent.c (check_nonce): Use FD_DBG. (do_start_connection_thread, start_connection_thread_ssh): Likewise. * common/iobuf.c (fd_cache_close, file_filter, do_open): Likewise. (do_iobuf_fdopen): Likewise. * dirmngr/dirmngr.c (check_nonce, start_connection_thread) (handle_connections): Likewise. * dirmngr/http.c (_my_socket_new, _my_socket_ref): Likewise. (_my_socket_unref): Likewise. * g10/decrypt.c (decrypt_message_fd): Likewise. * g10/encrypt.c (encrypt_crypt): Likewise. * g10/openfile.c (open_outfile): Likewise. * g10/plaintext.c (get_output_file, hash_datafile_by_fd): Likewise. * g10/verify.c (gpg_verify): Likewise. * kbx/keyboxd.c (check_nonce, do_start_connection_thread): Likewise. * scd/scdaemon.c (start_connection_thread): Likewise. (handle_connections): Likewise. * sm/gpgsm.c (open_es_fread, open_es_fwrite): Likewise. * tpm2d/tpm2daemon.c (start_connection_thread): Likewise. (handle_connections): Likewise. -- GnuPG-bug-id: 6597 Signed-off-by: NIIBE Yutaka <[email protected]>
* | gpg: Use gnupg_fd_t for iobuf_get_fd and is_secured_file.NIIBE Yutaka2023-07-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * common/iobuf.c (iobuf_get_fd): Return type is now gnupg_fd_t. * common/iobuf.h (iobuf_get_fd): Fix the return type. * g10/misc.c (is_secured_file): Argument is now gnupg_fd_t. * g10/main.h (is_secured_file): Fix the argument type. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common: Change iobuf_fdopen argument type to gnupg_fd_t.NIIBE Yutaka2023-07-112-4/+3
| | | | | | | | | | | | | | | | | | | | | | * common/iobuf.h (iobuf_fdopen): Use gnupg_fd_t. * common/iobuf.c (iobuf_fdopen): Use gnupg_fd_t. (iobuf_sockopen): Call do_iobuf_fdopen. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common: Add gnupg_check_special_filename.NIIBE Yutaka2023-07-113-36/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.h (gnupg_check_special_filename): New. * common/sysutils.c (gnupg_check_special_filename): New. * common/iobuf.c (translate_file_handle): Remove. (iobuf_is_pipe_filename): Use gnupg_check_special_filename. (do_open): Use gnupg_check_special_filename. * g10/plaintext.c (get_output_file): Use gnupg_check_special_filename and open_stream_nc. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common,gpg,kbx: Factor out open_stream_nc.NIIBE Yutaka2023-07-102-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.h (open_stream_nc): New. * common/sysutils.c (open_stream_nc): New. * g10/decrypt.c (decrypt_message_fd): Use open_stream_nc. * g10/server.c (cmd_verify): Likewise. * kbx/kbxserver.c (prepare_outstream): Likewise. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common:w32: Fix gnupg_w32_set_errno.NIIBE Yutaka2023-07-101-0/+1
| | | | | | | | | | | | | | | | * common/sysutils.c (gnupg_w32_set_errno): Return EC. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | gpg: Add algo constants for PQC.Werner Koch2023-07-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (PUBKEY_ALGO_KY768_25519): New. (PUBKEY_ALGO_KY1024_448): New. (PUBKEY_ALGO_DIL3_25519): New. (PUBKEY_ALGO_DIL5_448): New. (PUBKEY_ALGO_SPHINX_SHA2): New. * g10/keygen.c (parse_key_parameter_part): Force v5 keys for these algos. * g10/keyid.c (pubkey_string): Add mapping. * g10/misc.c (openpgp_pk_algo_usage): Add standard key usage. -- See draft-wussler-openpgp-pqc-01.txt for the code points. To limit the number of algorithms, only MUST and SHOULD algorithms are considered.
* | gpg: Use gnupg_fd_t for encrypt_crypt and gpg_verify.NIIBE Yutaka2023-07-052-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/iobuf.h (iobuf_fdopen_nc): Use gnupg_t. * common/iobuf.c (iobuf_fdopen_nc): Use gnupg_t. * g10/main.h (encrypt_crypt, gpg_verify): Use gnupg_fd_t. * g10/encrypt.c (encrypt_crypt): Use gnupg_fd_t. (encrypt_crypt_files): Follow the change. * g10/gpg.c (main): Follow the change. * g10/verify.c (gpg_verify): Use gnupg_fd_t. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-4' into masterWerner Koch2023-07-0410-84/+176
|\|
| * common,w32: Add missing GetLastError->errno mapping.Werner Koch2023-07-043-6/+8
| | | | | | | | | | | | | | * common/iobuf.c (file_filter, sock_filter): Add missing mapping. -- GnuPG-bug-id: 6528
| * sm: Remove duplicated code.Werner Koch2023-06-281-3/+6
| | | | | | | | | | | | * sm/minip12.c (struct tag_info): Change type of length and nhdr. (dump_tag_info): Adjust. (parse_tag): Re-implement using the parse_ber_header.
| * gpgsm: Print PROGRESS status lines.Werner Koch2023-06-152-7/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/ksba-io-support.c (struct writer_cb_parm_s): Add field progress. (struct gnupg_ksba_io_s): Add field is_writer. (update_write_progress): New. (base64_writer_cb, plain_writer_cb): Call update_write_progress. (base64_finish_write): Ditto. (gnupg_ksba_create_writer): Set is_writer. (gnupg_ksba_set_progress_cb): New. (gnupg_ksba_set_total): New. * common/ksba-io-support.h (gnupg_ksba_progress_cb_t): New type. * sm/server.c (gpgsm_status2): Return error from statusfp writes. (gpgsm_progress_cb): New. * sm/decrypt.c (gpgsm_decrypt): Set progress handler. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6534
| * gpg: Make progress work for large files on Windows.Werner Koch2023-06-132-57/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/iobuf.c (iobuf_get_filelength): Change return type to uint64_t and remove the overflow args. For Windows always use GetFileSizeEx which is available since the long EOL-ed Windows XP. * g10/sign.c (write_plaintext_packet): Adjust for changed iobuf_get_filelength. * g10/encrypt.c (encrypt_simple, encrypt_crypt): Ditto. * g10/photoid.c (generate_photo_id): Ditto. Also add an upper limit. * g10/filter.h (progress_filter_context_t): Change amount values to use uint64_t. * g10/progress.c (write_status_progress): Change accordingly. -- GnuPG-bug-id: 6534
| * gpg: Print status line and proper diagnostics for write errors.Werner Koch2023-06-091-3/+6
| | | | | | | | | | | | | | | | | | * common/iobuf.c (file_filter): Improve diagnostics. * g10/build-packet.c (do_plaintext): Make sure to cache all error cases. -- GnuPG-bug-id: 6528
| * w32: Map ERROR_FILE_INVALID to EIO.Werner Koch2023-06-091-0/+3
| | | | | | | | | | | | | | * common/sysutils.c (map_w32_to_errno): Add mapping. -- We see this error sometimes when writing to an USB connected disk.
| * dirmngr: Extend the AD_QUERY command.Werner Koch2023-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/server.c (cmd_ad_query): Add options --help and --subst. (cmd_getinfo): Add sub-command "sid". * dirmngr/ks-engine.h (KS_GET_FLAG_SUBST): New. * dirmngr/ks-engine-ldap.c (ks_ldap_help_variables): New. (getval_for_filter): New. (map_rid_to_dn): New. (ks_ldap_query): Support variables. -- The new variables features makes it easier to write AD queries without requiring domain specific expressions.
| * common: New function substitute_vars.Werner Koch2023-06-062-7/+42
| | | | | | | | | | | | | | | | | | * common/stringhelp.c (substitute_envvars): Factor code out to (substitute_vars): new. (subst_getenv): New. -- This is a generalized version of substitute_envvars.
| * common: New function nve_setWerner Koch2023-05-262-0/+27
| | | | | | | | | | | | | | * common/name-value.c (nve_set): New. -- Taken from 2.2 commit 706adf669173ec604158e4a2f4337e3da6cb1e45
| * common,w32: Set a proper error code when creating an output file.Werner Koch2023-05-231-2/+10
| | | | | | | | | | | | * common/iobuf.c (direct_open) [W32]: Set errno. (fd_cache_open): Ditto. --
* | common:iobuf: Avoid losing bits of HANDLE on Windows 64-bit.NIIBE Yutaka2023-06-301-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/iobuf.c (translate_file_handle): Change the return type to gnupg_fd_t, not to lose the bits for HANDLE silently. (do_iobuf_fdopen): Use the type gnupg_fd_t for the first argument. (do_open): Use do_iobuf_fdopen instead of iobuf_fdopen. (iobuf_fdopen, iobuf_fdopen_nc): Follow the change of API. -- GnuPG-bug-id: 6508 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common: Fix the cast for 64-bit Windows.NIIBE Yutaka2023-06-291-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.c (translate_sys2libc_fd_int): Fix the cast. -- FD should have a valid value here. For erroneous cases, it must be rejected by argparse handling. GnuPG-bug-id: 6551 Signed-off-by: NIIBE Yutaka <[email protected]>
* | common: Raise an error correctly in check_special_filename.NIIBE Yutaka2023-06-291-2/+21
| | | | | | | | | | | | | | | | | | | | * common/sysutils.c (check_special_filename): Use gnupg_parse_fdstr to check an error. -- GnuPG-bug-id: 6551 Signed-off-by: NIIBE Yutaka <[email protected]>