aboutsummaryrefslogtreecommitdiffstats
path: root/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* w32: Free memory allocated by new function w32_write_console.Werner Koch2021-06-081-0/+1
| | | | | | | * common/ttyio.c (w32_write_console): Free buffer. -- (cherry picked from commit 31b708e268ebb725307856865f34a61670a35586)
* common,w32: Allow Unicode input and output with the console.Werner Koch2021-06-081-31/+73
| | | | | | | | | | | | | | * common/ttyio.c (do_get) [W32]: Use ReadConsoleW. (w32_write_console): New. (tty_printf, tty_fprintf) [W32]: Use new function. -- Note that due this change fixed stings (i.e. gettext translations) printed to the console will not be rendered correctly unless "chcp 65001" has been used. This needs to be fixed by followup patch. GnuPG-bug-id: 4365 (cherry picked from commit f165c8a737cc968554c9d78932c69869456108ff)
* common: Re-indent ttyio.c and remove EMX, RISCOS, and CE supportWerner Koch2021-06-081-310/+274
| | | | | | | | * common/ttyio.c: Remove cruft like EMX and RISCOS support. Translate a few strings. Re-indent. -- Backported-from-master: 8622f53994249d8fb49a488cfe480ffbeb8cbfba
* common: Rename w32-misc.c to w32-cmdline.cWerner Koch2021-06-083-4/+4
| | | | | | | | | * common/w32-misc.c: Rename to .... * common/w32-cmdline.c: this. * common/Makefile.am: Adjust. -- (cherry picked from commit 7262d602d802c4a3840097d5de217fcfb9728b49)
* common,w32: Implement globing of command line args.Werner Koch2021-06-086-18/+380
| | | | | | | | | | | | | | | | | | | | | | * common/w32-misc.c [W32]: Include windows.h (struct add_arg_s): New. (add_arg): New. (glob_arg): New. (parse_cmdstring): Add arg argvflags and set it. (w32_parse_commandline): Add arg r_itemsalloced. Add globing. * common/init.c (prepare_w32_commandline): Mark glob created items as leaked. * common/t-w32-cmdline.c : Include windows.h (test_all): Add simple glob test for Unix. (main): Add manual test mode for Windows. * common/xasprintf.c (xtryreallocarray): New. -- GnuPG-bug-id: 4398 Backported-from-master: 089c9439674e8ecbc64f0ba924e6fb447bbc2b9d)
* common,w32: Refine the command line parsing for \ in quotes.Werner Koch2021-06-082-6/+33
| | | | | | | | | | | * common/t-w32-cmdline.c (test_all): Add new test cases. * common/w32-misc.c (strip_one_arg): Add arg endquote. (parse_cmdstring): Take care of backslashes in quotes. -- I found some new test vectors from Microsoft. (cherry picked from commit 20c60076866904187a09393de596deef286116f8)
* common: First take on handling Unicode command line args.Werner Koch2021-06-085-6/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | * common/w32-misc.c: New. * common/t-w32-cmdline.c: New. * common/init.c: Include w32help.h. (prepare_w32_commandline): New. (_init_common_subsystems) [W32]: Call prepare_w32_commandline. * common/Makefile.am (common_sources) [W32]: Add w32-misc.c (module_tests): Add t-w32-cmdline (t_w32_cmdline_LDADD): New. -- The rules for the command line parser are not cleary specified - if at all. See the comment in t-w32-cmdline.c. We can't use the mingw version because that would require to change all argv handling to be wchar_t and that only for Windows. That would be too ugly. Parsing the command line into argv by us is much easier and we can do that only if needed - i.e. if globing is required (we are prepared for this) or a non-ASCII character has been encountered. This way we keep things stable and only fix the currently not working Unicode problem. GnuPG-bug-id: 4398 (cherry picked from commit deb6c94362c0f179de1cac18707aad2f51a21e10)
* sm: Support AES-GCM decryption.Werner Koch2021-06-021-1/+2
| | | | | | | | | | | | | | | | | * sm/gpgsm.c (main): Use gpgrt_fcancel on decryption error if gpgrt supports this. * sm/decrypt.c (decrypt_gcm_filter): New. (gpgsm_decrypt): Use this filter if requested. Check authtag. * common/compliance.c (gnupg_cipher_is_allowed): Allow GCM for gpgsm in consumer (decrypt) de-vs mode. -- Backported-from-master: 4980fb3c6dde8c1dda975e8a36d6086c8456a631 We allow GCM in de-vs mode for decryption although this has not been evaluation. It is decryption and thus no serious harm may happen. Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: Simplify keyserver spec parsing.Werner Koch2021-05-262-74/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/keyserver.h: Remove. * sm/gpgsm.h (struct keyserver_spec): Remove. (opt): Change keyserver to a strlist_t. * sm/gpgsm.c (keyserver_list_free): Remove. (parse_keyserver_line): Remove. (main): Store keyserver in an strlist. * sm/call-dirmngr.c (prepare_dirmngr): Adjust for the strlist. Avoid an ambiguity in dirmngr by adding a prefix if needed. * g10/options.h (struct keyserver_spec): Move definition from keyserver.h to here. Remove most fields. * g10/keyserver.c (free_keyserver_spec): Adjust. (cmp_keyserver_spec): Adjust. (parse_keyserver_uri): Simplify. (keyidlist): Remove fakev3 arg which does not make any sense because we don't even support v3 keys. -- We now rely on the dirmngr to parse the keyserver specs. Thus a bad specification will not be caught immediately. However, even before that dirmngr had stricter tests. Signed-off-by: Werner Koch <[email protected]>
* common: Avoid double-freeJakub Jelen2021-05-201-0/+1
| | | | | | | | | | * common/name-value.c (do_nvc_parse): reset to null after ownership change -- Signed-off-by: Jakub Jelen <[email protected]> GnuPG-bug-id: 5393
* sm: Support decryption of password based encryption (pwri)Werner Koch2021-05-172-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | * sm/decrypt.c (string_from_gcry_buffer): New. (pwri_parse_pbkdf2): New. (pwri_decrypt): New. (prepare_decryption): Support pwri. (gpgsm_decrypt): Test for PWRI. Move IS_DE_VS flag to DFPARM. * common/sexputil.c (cipher_mode_to_string): New. -- Note that this is not finished because we need to implement a password callback. For now "abc" is used as passwort. Latest libksba is also required to return the required info. Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 02029f9eab87e9fd667829dfb083846275576398 Note that this change also prints the used algorithm and shows some existsing diagnostics only in verbose mode. Signed-off-by: Werner Koch <[email protected]>
* common: Fix gnupg_wait_processes, by skipping invalid PID.NIIBE Yutaka2021-05-031-1/+6
| | | | | | | | | * common/exechelp-posix.c (gnupg_wait_processes): Skip invalid PID. -- Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit d82dae5d2229a30dbc78aadc4d544d30dac76a1c)
* common: Extend the openpgp_curve_to_oid function.Werner Koch2021-04-293-4/+13
| | | | | | | | | | | * common/openpgp-oid.c (openpgp_curve_to_oid): Add optional arg R_NBITS. Change all callers. -- In particular for ed25519 and cv25519 it is quite useful to have an ability to get the required algorithm. (cherry picked from commit 24095101a5069f15a9aea7512498ac436a76814a)
* common: New module to compute openpgp fingerprintsWerner Koch2021-04-293-0/+306
| | | | | | | | | | | | * common/openpgp-fpr.c: New. * common/Makefile.am (common_sources): Add it. -- This function is targeted to handle keys on smartcards. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 2f2bdd9c0894eb43f719da8b529b4c7a46f742a0) Signed-off-by: Werner Koch <[email protected]>
* common: New function to uncompress an ECC public key.Werner Koch2021-04-293-1/+593
| | | | | | | | | | | | | * common/sexputil.c (ec2os): New. (uncompress_ecc_q_in_canon_sexp): New. * common/t-sexputil.c (fail2): new. (test_ecc_uncompress): New. (main): Run new test. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 935765b451aadc63fbba763a4a00f4efa0254436)
* common: New function cmp_canon_sexp.Werner Koch2021-04-294-2/+200
| | | | | | | | | | | | | * common/sexputil.c (cmp_canon_sexp): New. (cmp_canon_sexp_def_tcmp): New. * common/t-sexputil.c (test_cmp_canon_sexp): Add a simple test. -- To be used to fix GnuPG-bug-id: 5061 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b6ba6a79ce9336f1b53f16f3d1190dd009fb166e)
* scd: Extend iso7816_select_pathWerner Koch2021-04-291-0/+2
| | | | | | | | | | | | | * scd/iso7816.c (iso7816_select_path): Add arg top_fd. * scd/app-nks.c (do_readkey): Adjust for this change (select_ef_by_path: Ditto. * common/tlv.h: Include membuf.h. -- Including membuf.h is just for easier backporting. In 2.3 it is actually required in tlv.h but in 2.2 we right now only use it indirect.
* common: Make the compliance check more robust.Werner Koch2021-04-011-16/+60
| | | | | | | | | | | | | | | * common/compliance.c (get_compliance_cache): New. (gnupg_rng_is_compliant): Use per mode cache. (gnupg_gcrypt_is_compliant): Ditto. -- This addresses the problem tha the check might be called with different compliance values and thus it should return the corresponding cached result. Signed-off-by: Werner Koch <[email protected]> Backported from 2.3. Added PGP6 support which was removed from 2.3.
* common: New function dotlock_is_locked.Werner Koch2021-03-022-4/+19
| | | | | | | | | | | | | * common/dotlock.c (dotlock_is_locked): New. (dotlock_take): Set locked flag also in disabled mode. No more warning if the lock has already been taken. (dotlock_release): Clear locked flag also in disabled mode. No more warning if the lock has not been taken. -- This allow to use dotlock_take and dotlock_release even if they have already been called. Before this changes this worked too but a diagnostic was printed.
* common: Fix compiler warningWerner Koch2021-02-171-1/+1
| | | | --
* Include the library version in the compliance checks.Werner Koch2021-01-282-15/+64
| | | | | | | | | | | | | | | | | | | * common/compliance.c (gnupg_gcrypt_is_compliant): New. (gnupg_rng_is_compliant): Also check library version. * g10/mainproc.c (proc_encrypted): Use new function. (check_sig_and_print): Ditto. * sm/decrypt.c (gpgsm_decrypt): Ditto. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/verify.c (gpgsm_verify): Ditto -- This will eventually allow us to declare Libgcrypt 1.9 to be de-vs compliant. GnuPG can use this information then for its own checks. As of now GnuPG tests the version of the used library but that is a bit cumbersome to maintain. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 90c514868ff5fcf6d39490d4874ac3a31ba9e85f)
* Update copyright notices.Werner Koch2021-01-111-1/+1
| | | | --
* gpg,w32: Fix gnupg_remove.Werner Koch2021-01-113-1/+132
| | | | | | | | | | | | | | | | | | | | | | | | * common/sysutils.c (map_w32_to_errno): New. (gnupg_w32_set_errno): New. (gnupg_remove) [w32]: Set ERRNO -- To support Unicode gnupg_remove was changed to use DeleteFileW and not properly tested because the code was alreadt used in Windows CE. However, ERRNO was not set and thus Dirmngr failed due to if (!gnupg_remove (fname)) log_info (_("removed stale te[...] file '%s'\n"), fname); else if (errno != ENOENT) { err = gpg_error_from_syserror (); log_error (_("problem remov[...] file '%s': %s\n"), fname, gpg_strerror (err)); goto leave; } GnuPG-bug-id: 5230 (cherry picked from commit b6967d31912912ad3c0a2ff6bf6eb9822a194562)
* common: Remove superfluous debug output from dotlock.c.Werner Koch2020-12-211-2/+0
| | | | | | | | | | * common/dotlock.c (dotlock_create_unix): Remove debug output. -- This was left over from developement about 10 years ago. Exhibits itself when using sshfs. GnuPG-bug-id: 5193
* common: Fix the "ignore" meta command in argparse.cWerner Koch2020-12-213-36/+122
| | | | | | | | | | | | | | | | * src/argparse.c (gnupg_argparse): Factor some code out to ... (prepare_arg_return): new. (gnupg_argparse): No missing arg error in ignore sections. * common/sysutils.c: Include pwd.h. (gnupg_getusername): New. -- Options in an [ignore] section do not anymore lead to an error if an argument is missing. However, if the option is also in a force section the error is thrown. This is a port of the fix from libgpg-error. Also fixes the username fixme.
* Backport of the new option parser from 2.3Werner Koch2020-12-043-693/+1841
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (GPGRT_ENABLE_ARGPARSE_MACROS): Define. * common/argparse.c, common/argparse.h: Rewrite. * tests/gpgscm/main.c: Switch to the new option parser. * g10/gpg.c: Switch to the new option parser and enable a global conf file. * g10/gpgv.c: Ditto. * agent/gpg-agent.c: Ditto. * agent/preset-passphrase.c: Ditto. * agent/protect-tool.c: Ditto. * scd/scdaemon.c: Ditto. * dirmngr/dirmngr.c: Ditto. * dirmngr/dirmngr_ldap.c: Ditto * dirmngr/dirmngr-client.c: Ditto. * kbx/kbxutil.c: Ditto. * tools/gpg-card.c: Ditto. * tools/gpg-check-pattern.c: Ditto. * tools/gpg-connect-agent.c: Ditto. * tools/gpg-pair-tool.c: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpgconf.c: Ditto. * tools/gpgsplit.c: Ditto. * tools/gpgtar.c: Ditto. * g13/g13.c: Ditto. * g13/g13-syshelp.c: Ditto. Do not force verbose mode. * sm/gpgsm.c: Ditto. Add option --no-options. -- This is backport from master commit cdbe10b762f38449b86da69076209324b0c99982 commit ba463128ce65a0f347643f7246a8e097c5be19f1 commit 3bc004decd289810bc1b6ad6fb8f47e45c770ce6 commit 2c823bd878fcdbcc4f6c34993e1d0539d9a6b237 commit 0e8f6e2aa98c212442001036fb5178cd6cd8af59 but without changing all functions names to gpgrt. Instead we use wrapper functions which, when building against old Libgpg-error versions, are implemented in argparse.c using code from the current libgpg-error. This allows to keep the dependency requirement at libgpg-error 1.27 to support older distributions. Tested builds against 1.27 and 1.40-beta. Note that g13-syshelp does not anymore default to --verbose because that can now be enabled in /etc/gnupg/g13-syshelp.conf. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* common: Fix fallback handling to utf-8.NIIBE Yutaka2020-11-271-1/+1
| | | | | | | | | | | * common/utf8conv.c (handle_iconv_error): Set NO_TRANSLATION. -- GnuPG-bug-id: 5038 Fixes-commit: 99c9bf7defd6c1ac9cc49c84e6c78eeb886a6952 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 393dcdd61c3b2da00a97176c647d9bd1c908ceba)
* w32: Support Unicode also for config files etc.Werner Koch2020-11-102-1/+52
| | | | | | | | | | | | | | * common/sysutils.c (gnupg_fopen) [W32]: Use _wfopen if needed. Use new function in most places where fopen is used. -- The config files in 2.2 are still read using fopen - we need to change this to allow Unicode directory names. There is also one case where files are written using the old fopen. The new option parser in 2.3 does not have this problem but at some places fopen is also still used. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]>
* w32: Support utf8 for getcwd even if build with gpgrt < 1.40.Werner Koch2020-11-101-8/+28
| | | | | | | | | | | * common/sysutils.c (gnupg_getcwd) [W32]: Use Unicode version. -- gpgrt 1.40 has not yet been released, so to make getcwd work properly on Windows we need to have the code here as well. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]>
* Require Libgpg-error 1.27Werner Koch2020-11-091-20/+0
| | | | | | | | | | | | * configure.ac (NEED_GPG_ERROR_VERSION): Require 1.27 * common/util.h: Remove compatibility macros. -- This is just a minor change to align with the need for Libgcrypt 1.8. The latter was first released in summer 2017 while Libgpg-error 1.27 was released earlier in spring that year. Signed-off-by: Werner Koch <[email protected]>
* Require Libgcrypt 1.8Werner Koch2020-11-091-4/+0
| | | | | | | | | | | | | | | | | * configure.ac (NEED_LIBGCRYPT_VERSION): Require 1.8. * tools/gpgconf.c (show_version_libgcrypt): Remove conditional case for Libgcrypt < 1.8. * common/compliance.c (gnupg_rng_is_compliant): Ditto. * agent/pksign.c: Ditto. * agent/gpg-agent.c (thread_init_once): Ditto. (agent_libgcrypt_progress_cb): Ditto. * agent/command.c (cmd_getinfo): Ditto. -- Libgcrypt 1.7 reached end-of-life more than a year ago. Thus there is no reason to keep backward support for it. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add canceled status message.Ben Kibbey2020-11-091-0/+1
| | | | | | | | | | | | | * common/status.h (STATUS_CANCELED_BY_USER): New. * g10/passphrase.c (passphrase_to_dek): Send STATUS_CANCELED_BY_USER instead of STATUS_MISSING_PASSPHRASE when canceled is set. -- This is to prevent further pinentry tries when the pinentry is canceled by the user during symmetric decryption. Signed-off-by: Ben Kibbey <[email protected]> (cherry picked from commit 31e47dfad0f40e31e8b3113b933696e8e4105136)
* common: Fix duplicate implementation of try_make_homedir.Werner Koch2020-11-042-0/+34
| | | | | | | | | | | * g10/openfile.c (try_make_homedir): Move core of the code to ... * common/homedir.c (gnupg_maybe_make_homedir): new. * sm/keydb.c (try_make_homedir): Implement using new function. * common/homedir.c: Include i18n.h. * po/POTFILES.in: Add common/homedir.c. Signed-off-by: Werner Koch <[email protected]>
* w32: Add another pinentry search pathAndre Heinecke2020-11-041-0/+2
| | | | | | | | | | * common/homedir.c (get_default_pinentry_name): Try ../bin/pinentry.exe -- In an installation layout where GnuPG is installed as a component of another software it might be useful to have pinentry placed in a different bin directory without the forced folder name of Gpg4win.
* w32: Fix strftime problem on Windows.Werner Koch2020-11-031-2/+31
| | | | | | | | | * common/gettime.c: Include locale.h. (asctimestamp): Increase buffer. On Windows use setlocale. -- GnuPG-bug-id: 5073 Signed-off-by: Werner Koch <[email protected]>
* common: Fix gnupg_access for older libgpg-error.Werner Koch2020-10-261-1/+3
| | | | | | -- Fixes-commit: dd5fd4a760b8cf6ae05ff878bcf36cf2465e744c
* common: New functions gnupg_opendir et al.Werner Koch2020-10-232-0/+178
| | | | | | | | | | | | * common/sysutils.h (struct gnupg_dirent_s): New. * common/sysutils.c: Include dirent.h. (struct gnupg_dir_s): New. (gnupg_opendir, gnupg_readdir, gnupg_closedir): New. Change all callers of opendir, readdir, and closedir to use these functions. -- GnuPG-bug-id: 5098 Backported-from-master: 7e22e08e2ab09cd3c2317f5e80e8ee47d46eff4b
* w32: Make gnupg_remove and gnupg_rename_file Unicode awareWerner Koch2020-10-231-3/+33
| | | | | | | | | | * common/sysutils.c (w32_rename): New. (gnupg_rename_file) [W32]: Support Unicode. (gnupg_remove) [W32]: Support Unicode. Drop Windows-CE support. -- GnuPG-bug-id: 5098 (cherry picked from commit 9a0197b6fe412cfc66b0cece521267180e454416)
* Replace all calls to stat by gnupg_stat.Werner Koch2020-10-233-1/+50
| | | | | | | | | | | | * common/sysutils.c (gnupg_stat): New. * common/sysutils.h: Include sys/stat.h. -- Yet another wrapper for Unicode support on Windows. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 18e5dd7b03ced51611c9ba1345cf498a0aaf14a6)
* Replace most calls to open by a new wrapper.Werner Koch2020-10-233-15/+67
| | | | | | | | | | | | | * common/sysutils.c (any8bitchar) [W32]: New. (gnupg_open): New. Replace most calls to open by this. * common/iobuf.c (any8bitchar) [W32]: New. (direct_open) [W32]: Use CreateFileW if needed. -- This is yet another step for full Unicode support on Windows. GnuPG-bug-id: 5098 (cherry picked from commit 4dcef0e17836e8725c31a3b76f2bf7144345c808)
* w32: Allow Unicode filenames for dotlockWerner Koch2020-10-212-27/+192
| | | | | | | | | | | | | * common/dotlock.c (any8bitchar) [W32]: New. (dotlock_create_w32): Use strconcat and CreateFileW. * common/t-dotlock.c: Source include dotlock.c and modify to allow manual testing on Windows. -- GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b47c355b18d9537ccc3dd3e80cc1825b018ecff7)
* Replace most of the remaining stdio calls by estream calls.Werner Koch2020-10-211-6/+6
| | | | | | | | | | | | | -- We need to use es_fopen on Windows to cope with non-ascii file names. This is quite a large but fortunately straightforward change. At a very few places we keep using stdio (for example due to the use of popen). GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 390497ea115e1aca93feec297a5bd6ae7b1ba6dd
* Replace all calls to access by gnupg_accessWerner Koch2020-10-216-50/+81
| | | | | | | | | | | | | | | | | * common/sysutils.c (gnupg_access): New. Replace all calls to access by this wrapper. * common/homedir.c (w32_shgetfolderpath): Change to return UTF-8 directory name. (standard_homedir): Adjust for change. (w32_commondir, gnupg_cachedir): Ditto. -- Also use SHGetFolderPathW instead of SHGetFolderPathA on Windows. This is required to correctly handle non-ascii filenames on Windows. GnuPG-bug-id: 5098 (cherry picked from commit c94ee1386e0d5cdac51086c4d5b92de59c09c9b5)
* common,w32: Change copyright holder notice.Werner Koch2020-10-021-0/+14
| | | | --
* gpgconf,w32: Add manifest so we get the correct windows version.Werner Koch2020-10-021-2/+2
| | | | | | | | | | | | | | * common/w32info-rc.h.in: Update copyright info. * tools/gpg-connect-agent-w32info.rc: Tweak file info. * tools/gpgconf-w32info.rc: New. * tools/gpgconf.w32-manifest.in: New. * configure.ac: Add new .in file. * tools/Makefile.am (EXTRA_DIST): Add them. (gpg_connect_agent_robjs, gpgconf_robjs): New. (gpgconf_LDADD): Add resource file. (gpg_connect_agent_LDADD): Change name of resource macro. Signed-off-by: Werner Koch <[email protected]>
* agent: Keep some permissions of private-keys-v1.d.Werner Koch2020-09-101-24/+42
| | | | | | | | | * common/sysutils.c (modestr_to_mode): Re-implement. (gnupg_chmod): Support keeping of permissions. -- GnuPG-bug-id: 2312 Signed-off-by: Werner Koch <[email protected]>
* common: Use gpgrt functions for mkdir and chdir if availableWerner Koch2020-08-221-3/+15
| | | | | | | | | | | | | | | * common/sysutils.c (gnupg_mkdir): Divert to gpgrt_mkdir. (gnupg_chdir): Divert to gpgrt_chdir -- To avoid bumping up the build dependency on libgpg-error 1.28 we use the gpgrt version only if at least this libgpg-error version was used at build time. This won't fix any bugs though and it is in general advisable to use the latest libgpg-error. There are actually a couple of very useful bug fixes for Windows in the upcoming libgpg-error 1.39 but on Unix you can live without them. Signed-off-by: Werner Koch <[email protected]>
* common,w32: Do not assume the ANSI codepage during string conversion.Werner Koch2020-08-221-2/+21
| | | | | | | | | | | | | | * common/utf8conv.c (get_w32_codepage): New. (wchar_to_native): Use instead oc CP_ACP. (native_to_wchar): Ditto. -- This should fix quite some issue; we fixed it when using the iconv based machinery about 14 years ago. At some point we introduced the new conversion functions because Windows started to support UTF-8 natively. The fix comes late but well, it is done. Signed-off-by: Werner Koch <[email protected]>
* common: Strip trailing CR,LF from w32_strerror.Werner Koch2020-08-222-1/+7
| | | | | | | | | | | | | | | | * common/stringhelp.c (w32_strerror): Strip trailing CR,LF. * common/iobuf.c (iobuf_get_filelength): Use -1 and not 0 for the arg to w32_strerror. -- This is in particular annoying since we started to use a string argument sanitizer in the logging code. Before that we just add an extra blank line. The second patch corrects a never yet seen error message. Signed-off-by: Werner Koch <[email protected]>
* gpgtar: Make --files-from and --null work as described.Werner Koch2020-08-203-1/+32
| | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Add args files_from and null_names. Improve reading from a file. * tools/gpgtar.c: Make global vars static. (main): Remove tests for --files-from and --null option combinations. Pass option variables to gpgtar_create. -- GnuPG-bug-id: 5027 Signed-off-by: Werner Koch <[email protected]>