aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpgrt-config: Support Libs.private and Requires.private.NIIBE Yutaka2019-09-041-0/+20
| | | | | | * src/gpgrt-config.in: Support Libs.private and Requires.private. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix gpgrt_poll at EOF.NIIBE Yutaka2019-08-231-1/+1
| | | | | | | | | | | | | | * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Catch POLLHUP event for want_read. -- At EOF, here is a difference of semantics between poll(2) and select(2). For poll(2), detection of EOF is an event of POLLHUP, not POLLIN. Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix gpgrt_poll to prevent waiting indefinitely for others.NIIBE Yutaka2019-08-231-0/+3
| | | | | | * src/estream.c (_gpgrt_poll): Go to leave, when something is ready. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix poll condition.NIIBE Yutaka2019-08-221-3/+4
| | | | | | * src/estream.c (_gpgrt_poll): Fix for want_oob. Signed-off-by: NIIBE Yutaka <[email protected]>
* New error codes NO_KEYBOXD, KEYBOXD, NO_SERVICE, and SERVICE.Werner Koch2019-08-051-0/+4
| | | | --
* w32: Fix cast to internal fd.NIIBE Yutaka2019-07-251-1/+1
| | | | | | * src/estream.c (tmpfd): Use intptr_t. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix IS_INVALID_FD.NIIBE Yutaka2019-07-251-5/+1
| | | | | | | | | | | | * src/estream.c (IS_INVALID_FD): Simply compare to -1. -- Perhaps, when it was written at first, use of HANDLE was in mind. Now, we have different set of methods for Windows, and this macro is only for integer fd access, no need of ifdef/endif. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix HANDLE to internal fd conversion.NIIBE Yutaka2019-07-241-6/+21
| | | | | | | | | | * src/spawn-w32.c (handle_to_fd): Use intptr_t type. -- See the section of _open_osfhandle in C Run-Time Library Reference. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Use {CFLAGS,CPPFLAGS, LDFLAGS}_FOR_BUILD for helper programsdkg-fix-T4643Daniel Kahn Gillmor2019-07-181-3/+6
| | | | | | | | | | | * doc/Makefile.am: add CPPFLAGS_FOR_BUILD for yat2m-for-build (other flags were already present). * src/Makefile.am: add {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for mkhelper, mkw32errmap, and mkerrcodes. Debian-bug-id: 932213 GnuPG-bug-id: 4643 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Fix signedness for a single-bit field.NIIBE Yutaka2019-07-111-3/+3
| | | | | | * src/gpgrt-int.h (struct _gpgrt_b64state): Use unsigned for bit flags. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Add missing malloc check.Werner Koch2019-06-271-1/+6
| | | | | | * src/estream.c (_gpgrt_poll): Check for malloc error. Signed-off-by: Werner Koch <[email protected]>
* estream: Don't use variable length array.NIIBE Yutaka2019-06-261-1/+7
| | | | | | | | | * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): No VLA. -- Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Use poll(2) when available.NIIBE Yutaka2019-06-261-0/+82
| | | | | | | | | | | * configure.ac: Detect poll.h. * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Use poll. -- Here, we use C99 feature of array declaration with variable. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Skip the test when pkg-config is too old.NIIBE Yutaka2019-06-181-0/+6
| | | | | | | | | | | * src/gpg-error-config-test.sh.in: Check pkg-config version. -- Use of sort and sed 1q for version check is taken from .m4 code in gettext. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Take care of POSIX shell path.NIIBE Yutaka2019-06-184-4/+4
| | | | | | | | | | | | * configure.ac (INSTALLSHELLPATH): New. * src/Makefile.am: Change invocation of gpg-error-config-test.sh. * src/gpgrt-config.in (INSTALLSHELLPATH): To be substituted. * src/gpg-error-config-test.sh.in: Likewise. -- GnuPG-bug-id: 4574 Signed-off-by: NIIBE Yutaka <[email protected]>
* Portability fix for PID.NIIBE Yutaka2019-06-181-1/+1
| | | | | | | | | | * src/spawn-posix.c (gpgrt_wait_processes): Cast to int. -- On some systems (like Solaris), pid_t is long int. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Add failure exit for gpg-error-config build.NIIBE Yutaka2019-06-181-0/+1
| | | | | | | | * src/Makefile.am (gpg-error-config): Exit 1 on failure. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Detect to use strerror_s.NIIBE Yutaka2019-05-291-1/+9
| | | | | | | | | | * configure.ac [mingw32*] (strerror_s): Detect. * src/strerror.c [HAVE_STRERROR_S] (system_strerror_r): Use strerror_s. -- GnuPG-bug-id: 4539 Signed-off-by: NIIBE Yutaka <[email protected]>
* awk: Prepare for Gawk 5.0.NIIBE Yutaka2019-04-156-10/+10
| | | | | | | | | | | | | | | | * src/Makefile.am: Use pkg_namespace (instead of namespace). * src/mkerrnos.awk: Likewise. * lang/cl/mkerrcodes.awk: Don't escape # in regexp. * src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto. -- In Gawk 5.0, regexp routines are replaced by Gnulib implementation, which only allows escaping specific characters. GnuPG-bug-id: 4459 Reported-by: Marius Schamschula Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Increase buffer size for Windows.Werner Koch2019-03-193-4/+10
| | | | | | | | * src/gpgrt-int.h (BUFFER_BLOCK_SIZE) [W32]: Increase from 512 to 8k. * src/w32-estream.c (READBUF_SIZE, WRITEBUF_SIZE): Increase from 4k to 8k. Signed-off-by: Werner Koch <[email protected]>
* syscfg: Add armv7a-unknown-linux-gnueabihf as an alias.Werner Koch2019-03-191-0/+1
| | | | | | | -- GnuPG-bug-id: 4409 Signed-off-by: Werner Koch <[email protected]>
* New error codes NO_AUTH and BAD_AUTHWerner Koch2019-02-111-0/+2
| | | | | | | | | -- In particular for PIV cards ithe use of BAD_PIN sounds worong, thus we now use dedicated codes. Signed-off-by: Werner Koch <[email protected]>
* build: Fix for Microsoft MSVC.Werner Koch2019-02-041-2/+2
| | | | | | | | | * src/gpgrt-int.h (_gpgrt_functions_w32_pollable): Declare with extern so that strict toolchains don't get confused. -- GnuPG-bug-id: 4356 Signed-off-by: Werner Koch <[email protected]>
* Release 1.34libgpg-error-1.34gpgrt-1.34Werner Koch2019-01-164-4/+4
| | | | | | * configure.ac: Bump LT version to C26/A26/R0. Signed-off-by: Werner Koch <[email protected]>
* Fix symbol name typo in gpg-error.def.inAndre Heinecke2019-01-141-1/+1
| | | | * src/gpg-error.def.in (gogrt_abort): Correct to gpgrt_abort.
* core: New functions gpgrt_abort and gpgrt_add_emergency_cleanup.Werner Koch2019-01-0415-46/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/init.c (emergency_cleanup_list): New gloabl var. (_gpgrt_add_emergency_cleanup): New. (_gpgrt_abort): New. Repalce all calls to abort by this. Also replace all assert by either log_assert or a stderr output followed by a _gpgrt_abort. (run_emergency_cleanup): New. * src/visibility.c (gpgrt_add_emergency_cleanup): New public API. (gpgrt_abort): New public API. -- Libgcrypt uses its own assert function which makes sure to terminate the secure memory. This is safe as log as an assert is triggered internally in Libgcrypt. GnuPG runs emergency cleanup handlers right before log_fatal etc to tell Libgcrypt to terminate the secure memory. With the move of the logging function to gpgrt in gnupg 2.3 this did not anymore. Thus we now provide a mechanism in gpgrt to do right that. Eventually Libgcrypt can also make use of this. What this does not handle are calls to abort or failed asserts in external libraries or in libc. We can't do anything about it in a library because a library may not setup signal handlers. Signed-off-by: Werner Koch <[email protected]>
* estream: Use correct POSIX name THOUSEP.Werner Koch2018-12-121-5/+5
| | | | | | | | | | | * src/estream-printf.c: Replace HAVE_LANGINFO_THOUSANDS_SEP by HAVE_LANGINFO_THOUSEP. (pr_integer): Use THOUSEP. -- GnuPG-bug-id: 4286 Reported-by: miod Signed-off-by: Werner Koch <[email protected]>
* syscfg: Add a riscv32 architectureAlistair Francis2018-12-112-0/+24
| | | | | | | | * src/syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h: New. * src/Makefile.am (lock_obj_pub): Add it. Signed-off-by: Alistair Francis <[email protected]> Signed-off-by: pino-kim <[email protected]>
* gpgrt-config: Portability fix for use of expr.NIIBE Yutaka2018-12-091-3/+3
| | | | | | | | | | | * src/gpgrt-config (sysroot): Care about possible interpretation of minus sign be considered an option to a program. (MAIN): Don't use 'match' of expr but use ':' instead. -- Reported-by: Roman Bogorodskiy <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* Silence cc warning about snprintf redefinitionWerner Koch2018-12-071-0/+1
| | | | | | | | * src/gpgrt-int.h: First undef snprintf. -- GnuPG-bug-id: 4285 Signed-off-by: Werner Koch <[email protected]>
* Add W32-only function gpgrt_w32_override_locale.Werner Koch2018-12-074-21/+95
| | | | | | | | | | | | * src/w32-gettext.c (struct override_locale): new. (my_nl_locale_name): Take care of that. (gpgrt_w32_override_locale): New. * src/gpg-error.def.in: Add gpgrt_w32_override_locale. * src/gpg-error.c: New command --locale for Windows. -- GnuPG-bug-id: 3733 Signed-off-by: Werner Koch <[email protected]>
* logging: Escape controls in string arguments of log_ functions.Werner Koch2018-12-061-1/+103
| | | | | | | | | | | | | | | | * src/logging.c (struct fmt_string_filter_s): New. (fmt_string_filter): New. (_gpgrt_logv_internal): Use the filter. -- This change has two advantages: a) There is no more need to first escape string arguments before passing them to a log function and b) you can't forget to do the escaping and thus attacks using diagnostic output to trick out users won't work. The drawback is that you see \n instead of a real LF and under Windows the backslash in file names are doubled. Signed-off-by: Werner Koch <[email protected]>
* core: Allow logging to an estream.Werner Koch2018-12-051-7/+14
| | | | | | | | | * src/logging.c (set_file_fd): Add and use new arg 'stream'. (_gpgrt_log_set_sink): Implement setting an estream sink. * tests/t-logging.c: New test. * tests/Makefile.am (TESTS): Add test. Signed-off-by: Werner Koch <[email protected]>
* Fix gpgrt_ftruncate declaration.Marcus Brinkmann2018-12-051-1/+1
|
* core: New functions gpgrt_fprintf_sf anf gpgrt_fprintf_sf_unlocked.Werner Koch2018-11-2610-35/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_string_filter_t): New type. (gpgrt_fprintf_sf, gpgrt_fprintf_sf_unlocked): New. * src/gpg-error.vers, src/gpg-error.def.in: Add them. * src/visibility.c (gpgrt_fprintf_sf): New. (gpgrt_fprintf_sf_unlocked): New. * src/estream-printf.c (pr_string): Add and use args sf, sfvalue and string_no. (do_format): Add args sf and sfvalue. Keep a string format counter. (_gpgrt_estream_format): Add args sf and sfvalue. Change all callers to provide NULL for them. * src/estream.c (_gpgrt_vfprintf_unlocked, _gpgrt_vfprintf): Add sf and sfvalue and adjust all callers. (do_print_stream): Ditto. * tests/t-printf.c (stream_to_string): New. (struct sfstate_s): New. (string_filter): New. (check_fprintf_sf): New. (main): Call new test. -- The actual reason to implement these functions is to enhance the internal logging function with a filter to sanitized strings so that control values or other things can be quoted. Signed-off-by: Werner Koch <[email protected]>
* core: Add a limited version of gpgrt_ftruncate.Werner Koch2018-11-267-1/+45
| | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_ftruncate, es_ftruncate): New. * src/gpg-error.def.in, src/gpg-error.vers: Add gpgrt_ftruncate. * src/visibility.c (gpgrt_ftruncate): new. * src/gpgrt-int.h (COOKIE_IOCTL_TRUNCATE): New. * src/estream.c (func_mem_ioctl): Support new internal IOCTL. (_gpgrt_ftruncate): New. -- Right now the ftruncate works only on memory streams. Can easily be added to other stream times. Signed-off-by: Werner Koch <[email protected]>
* core: New API gpgrt_cmp_versionWerner Koch2018-11-157-27/+183
| | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in: New API gpgrt_cmp_version. * src/visibility.c (gpgrt_cmp_version): New wrapper. * src/version.c (parse_version_string): Revamped. (do_cmp_version): New. (_gpgrt_cmp_version): New. (_gpg_error_check_version): Re-implemented using the new func. * tests/t-version.c: Include t-common.h. (t_gpgrt_cmp_version): New test. (main): Run new test. Change test for new version number to require a 2 level number. -- We have implementations of very similar functions in all out libs. Thus it makes sense to provide a generic version. This version is actually derived from the ftp-indexer.c we use for the gnupg website (see the gnupg-doc repo). Signed-off-by: Werner Koch <[email protected]>
* gpgrt-config: Prepend PKG_CONFIG_LIBDIR to PKG_CONFIG_PATH.NIIBE Yutaka2018-11-141-8/+23
| | | | | | | | | | | * src/gpgrt-config: Handle empty PKG_CONFIG_LIBDIR config, which should ignore --libdir option. Otherwise, prepend PKG_CONFIG_LIBDIR (instead of appending) to PKG_CONFIG_PATH. -- Suggested-by: Andre Heinecke <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix typo in the annotation.NIIBE Yutaka2018-11-131-1/+1
| | | | | | * src/init.c [DLL_EXPORT] (DllMain): Fix typo. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt.m4: Don't support --with-*-prefix or SYSROOT.NIIBE Yutaka2018-11-131-52/+4
| | | | | | | | | | | | | * src/gpgrt.m4: Remove old backward compatible support. -- Since this macro gpgrt.m4 has not yet been used by any, we can break now. The gpgrt-config script is for all hosts (switching by --libdir option), it's not switched by --with-*-prefix nor SYSROOT. Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix a typo.NIIBE Yutaka2018-11-071-1/+1
| | | | | | * src/spawn-w32.c (src/spawn-w32.c): Fix to use pid_to_handle. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt-config: Don't support variable reference in --libdir option.NIIBE Yutaka2018-11-023-44/+36
| | | | | | | | | | | | | | | | | * src/gpgrt-config: Simplify --libdir support, remove variable substituion. * src/gpg-error.m4: Expand possible ${prefix}, ${exec_prefix} in libdir. Simplify invocation of gpgrt-config. * src/gpgrt.m4: Likewise. -- The --libdir option for configure can include variable reference like --libdir='${exec_prefix}/lib/x86_64-linux-gnu', and this expression should be expanded (the variable should be substituted) beforehand to determine if there is gpg-error.pc file or not. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg-error.m4: Emit message when using gpgrt-config.NIIBE Yutaka2018-11-021-0/+2
| | | | | | * src/gpg-error.m4: Add AC_MSG_NOTICE. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg-error.m4: Find gpgrt_libdir by CC.NIIBE Yutaka2018-11-022-18/+44
| | | | | | | | | | | | | | * src/gpg-error.m4 (gpgrt_libdir): New. Bump the version date. * src/gpgrt.m4: Likewise. -- Locating gpg-error.pc file, when it's not found at target's $libdir, try system libdir defined by CC, assuming CC supports gcc compatible -print-file-name option. GnuPG-bug-id: 4239 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg-error.m4: Unset GPGRT_CONFIG when gpgrt-config doesn't work.NIIBE Yutaka2018-11-011-2/+8
| | | | | | * src/gpg-error.m4: Unset GPGRT_CONFIG when gpgrt-config doesn't work. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt-config: It's distributed script.NIIBE Yutaka2018-11-011-1/+2
| | | | | | | | | | | | * src/Makefile.am (dist_bin_SCRIPTS): Add gpgrt-config. (bin_SCRIPTS): Remove gpgrt-config. -- This is the automake thing; Since gpgrt-config is not generated script, we should use dist_bin_SCRIPTS here. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Remove cruft in w32-estream from olden times.Andre Heinecke2018-10-311-28/+0
| | | | | | | | | | | | | * src/w32-io.c (set_synchronize): Remove. (create_reader, create_writer): No need for set_synchronize. -- The set_synchronize dates back to 2001 at a time when gpgme got the Windows support on WindowsME and Windows2000. Maybe this was required then due to bugs in that old NT or partly NT based Windows versions. Removal similar to the removal in gpgme's w32-io.
* gpgrt-config: Fix typo in the script.NIIBE Yutaka2018-10-311-1/+1
| | | | | | * src/gpgrt-config: Add missing $ for libdir_option. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt-config: Better architecture independent support.NIIBE Yutaka2018-10-295-94/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Don't generate gpgrt-config. * src/gpgrt-config: Rename from gpgrt-config.in. (--prefix, --exec-prefix, --libdir): Use --libdir to determine PKG_CONFIG_LIBDIR. * src/Makefile.am (EXTRA_DIST): Remove gpgrt-config.in. * src/gpg-error-config-test.sh: Fix for path to gpgrt-config. * src/gpg-error.m4: Provide --prefix, --exec-prefix, --libdir option from configure. Don't use CC because we have --libdir. Bump version date. * src/gpgrt.m4: Likewise. -- Considering multilib support as well as multiarch support, it is better to provide the information for PKG_CONFIG_LIBDIR by --libdir directly, instead of CC. Difficulty is that configure allows variable reference like: --libdir='${exec_prefix}/i386-linux' So, it should also support --prefix and --exec_prefix options. Signed-off-by: NIIBE Yutaka <[email protected]>
* b64dec: Fix to use custom memory handlers.Ben Kibbey2018-10-271-2/+2
| | | | | | * src/b64dec.c (_gpgrt_b64dec_finish): Use xfree(). Signed-off-by: Ben Kibbey <[email protected]>