| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* src/init.c (utf8_for_new_threads): New var.
(_gpgrt_w32_utf8_for_new_threads): New func.
(get_tls): Init the TLS utf8 flag from the new var.
* src/w32-gettext.c (_gpg_w32_gettext_use_utf8): Implement new flag.
--
GnuPG-bug-id: 7185
|
|
|
|
|
|
|
|
|
|
|
| |
* src/init.c (_gpgrt_wipememory): New.
* src/visibility.c (gpgrt_wipememory): New.
* src/visibility.h: Add it.
* src/gpg-error.def.in: Ditto.
* src/gpg-error.vers: Ditto.
--
GnuPG-bug-id: 6954
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* contrib/*: Remove.
* Makefile.am: Remove contrib.
* autogen.sh: Remove Windows CE support.
* configure.ac (have_w32ce_system): Remove.
* src/Makefile.am [HAVE_W32CE_SYSTEM] (extra_cppflags): Remove.
(gpg_extra_headers): Remove.
(EXTRA_DIST): Remove mkw32errmap.c and w32ce-add.h
(BUILT_SOURCES): Remove mkw32errmap.map.c.
(tmp_files): Remove mkw32errmap.tab.h mkw32errmap.map.c
(CLEANFILES): Likewise.
* src/estream-printf.c [HAVE_W32CE_SYSTEM]: Remove.
* src/estream.c [HAVE_W32CE_SYSTEM]: Remove.
* src/gpg-error.def.in [HAVE_W32CE_SYSTEM]: Remove.
* src/gpgrt-int.h: Fix comment.
* src/init.c [HAVE_W32CE_SYSTEM]: Remove.
* src/init.h [HAVE_W32CE_SYSTEM]: Remove.
* src/mkheader.c: Remove Windows CE support.
* src/mkw32errmap.c, src/w32ce-add.h: Remove.
* src/spawn-posix.c [HAVE_W32CE_SYSTEM]: Remove.
* src/spawn-w32.c [HAVE_W32CE_SYSTEM]: Remove.
* src/sysutils.c [HAVE_W32CE_SYSTEM]: Remove.
* src/w32-estream.c [HAVE_W32CE_SYSTEM]: Remove.
* src/w32-reg.c [HAVE_W32CE_SYSTEM]: Remove.
* tests/Makefile.am [HAVE_W32CE_SYSTEM]: Remove.
--
GnuPG-bug-id: 5912
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
| |
* src/init.c (_gpgrt_free): Shortcut NULL and save ERRNO.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/init.c (_gpgrt_reallocarray): New.
* src/visibility.c (gpgrt_reallocarray): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add new function.
* src/gpg-error.h.in: Add new interface.
* tests/t-malloc.c: New.
* tests/Makefile.am (TESTS): Add new test.
--
Note that this function is different from the glibc function because
it has an extra parameter which allows to clear the new elements. A
realloc after a calloc with forgotten memset after it is a common
source of error, thus we introduce this slightly different function.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
| |
* src/init.c [DLL_EXPORT] (DllMain): Fix typo.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/w32-estream.c (reader): Use standard free.
(writer): Ditto.
--
There are two errors: The minor one is that we allocated with calloc
but released with _gpgrt_free. The major one is the recursive use of
npth_unprotect due to the syscall_clamp mechanism:
1. Around the call to _gpgrt_w32_poll
2. By gpgrt_lock_lock on behalf of a the custom allocation handler in
the worker threads at their _gpgrt_free.
This problem was exhibited by GnuPG's dirmngr component.
GnuPG-bug-id: 3937
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
| |
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/visibility.c (gpgrt_strdup): New API fucntion.
(gpgrt_strconcat): New API fucntion.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add them.
* src/gpg-error.vers: Add them.
* src/gpgrt-int.h (DIM): New macro.
* src/init.c (_gpgrt_strdup): New.
(_gpgrt_strconcat_core): New.
(_gpgrt_strconcat): New.
--
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/visibility.c (gpgrt_realloc): New API function.
(gpgrt_malloc): New API function.
(gpgrt_calloc): New API function.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add them.
* src/gpg-error.vers: Add them.
* src/init.c (_gpgrt_calloc): New.
* src/gpg-error.h.in: Add prototypes.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
| |
--
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpgrt-int.h (trace_errno): Add new parameter. Adjust all users.
* src/init.c (trace_fp, trace_with_errno, trace_missing_lf)
(trace_prefix_done): New vars.
(_gpgrt_internal_trace_begin): Add arg WITH_ERRNO. Open a trace file
on first use. Init new vars.
(print_internal_trace_prefix): New.
* src/estream.c, src/w32-estream.c: Improve tracing.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/init.c (trace_save_errno, trace_arg_module)
(trace_arg_file, trace_arg_line): New module vars.
(do_internal_trace): New.
(_gpgrt_internal_trace_printf): New.
(_gpgrt_internal_trace): New.
(_gpgrt_internal_trace_errno): New.
(_gpgrt_internal_trace_end): New.
* src/gpgrt-int.h (trace): New macro.
(trace_errno): New macro.
(trace_start): New macro.
(trace_append): New macro.
(trace_finish): New macro.
--
We want to be abale to use libgpg-error also with pre-c99 compilers
and thus we can use the __VA_ARGS__ but resort to the common macro
trick.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/estream.c (_gpgrt_es_init): Rename to _gpgrt_estream_init.
(es_fill): Rename to fill_stream.
(es_fflush): Rename to flush_stream.
(es_deinitialize): Rename to deinit_stream_obj.
(es_create): Rename to create_stream
(es_read_nbf): Rename to do_read_nbf.
(es_read_lbf): Rename to do_read_lbf.
(es_read_fbf): Rename to do_read_fbf.
(es_peek): Rename to peek_stream.
(es_skip): Rename to skip_stream.
(es_print): Rename to do_print_stream.
--
The use of the "es_" was confusing. Avoid that.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
* use https for bug reporting
* in comments and docs, use https to refer to:
- www.gnu.org
- creativecommons.org
- translationproject.org
- mail.gnome.org
- www.perl.org
- www.ctan.org
- www.cl.cam.ac.uk
- www.ntg.nl
- cygwin.com
- www.ethnologue.com
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/init.c (_gpgrt_realloc): Avoid calling 'malloc(0)'.
--
Previously, if '_gpgrt_realloc' was called with both A and N being
zero, malloc is invoked with a size of zero. This happens e.g. when
calling '_gpgrt_free' with a NULL pointer, which is supposed to be a
no-op.
Found using the Clang Static Analyzer.
Signed-off-by: Justus Winter <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (pre_mkheader_cmds): Avoid make diagnostic about
failed but ignored command. This confuses Emacs' compiler job parser.
* tests/t-lock.c [W32]: Include time.h.
* src/init.c: Reorganize Windows only code.
(wchar_to_utf8, utf8_to_wchar): Remove unused functions.
(_gpg_err_set_errno): Use only one copy for all platforms.
--
Note that there is a still a problem for W64 pertaining to the use of
an int to store a HANDLE. This will be fixed when we add a full
abstraction layer for Windows file objects.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/visibility.c (gpgrt_set_alloc_func): New.
* configure.ac (_ESTREAM_PRINTF_REALLOC): Define.
(_ESTREAM_PRINTF_EXTRA_INCLUDE): Define.
* src/estream.c (mem_alloc, mem_realloc, mem_free): Simplify.
(_gpgrt_free): Remove.
* src/init.c (custom_realloc): New var.
(_gpgrt_set_alloc_func): New.
(_gpgrt_realloc, _gpgrt_malloc, _gpgrt_free): New.
* src/visibility.h (gpg_err_deinit): Mark as visible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (gpgrt_init): New macro.
(gpgrt_check_version): New prototype.
* src/init.c (_gpg_err_init): Rename from gpg_err_init.
(_gpg_err_deinit): Rename from gpg_err_deinit.
* src/visibility.c (gpg_err_init): New.
(gpg_err_deinit): New.
(gpgrt_check_version): New.
* src/gpg-error.vers (gpg_err_init, gpg_err_deinit): Add missing
symbols.
(gpgrt_check_version): New.
* src/gpg-error.def.in (gpg_err_init, gpg_err_deinit): Add missing
symbols.
(gpgrt_check_version): New.
* src/gpg-error.c (main): Use gpgrt_init macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/posix-lock.c: Add weak program for pthread_mutex_trylock.
(_gpgrt_lock_trylock): New.
* src/w32-lock.c (_gpgrt_lock_init): Add missing return statement.
(_gpgrt_lock_trylock): New.
* src/visibility.c (gpgrt_set_syscall_clamp): New.
(gpgrt_lock_trylock): New.
(gpgrt_vsnprintf): Fix symbol name.
* src/init.c (DllMain): Mark unused arg.
* src/estream.c: Replace npth mutexes by our own locks. Replace yeild
macro by _gpgrt_yield.
(pre_syscall_func, post_syscall_func): New.
(do_deinit): Clear both new vars.
(es_func_fd_read, es_func_fd_write): Call pre and post syscall
functions instead of the former SYSCALL macros.
(es_func_w32_read, es_func_w32_write): Ditto.
(es_func_fd_seek, es_func_w32_seek, es_func_fp_read)
(es_func_fp_write, es_func_fp_seek, es_func_fp_destroy): Bracket
syscalls with the pre- and post-syscall fucntions.
(do_npth_read, do_npth_write): Remove.
(_gpgrt_es_init): Remove call to mutex init. It is now statically
initialized.
(_gpgrt_set_syscall_clamp): New.
(es_create): Destroy stream lock on error.
(do_close): Destroy stream lock.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: New option --enable-ld-version-script.
(GPGRT_USE_VISIBILITY): New ac_define.
(HAVE_LD_VERSION_SCRIPT): New am_conditional.
* src/gpg-error.vers: New.
* src/gpgrt-int.h: New.
* src/visibility.c, src/visibility.h: New. Lot of changes to symbold
names.
--
This is only doe for the old API. The estream API needs to be added.
|
|
|
|
|
|
|
| |
* m4/estream.m4: Check for memrchr.
* src/estream.c (memrchr) [!HAVE_MEMRCHR]: New.
* src/init.c: Include estream.h
(real_init): Init estream.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/w32-gettext.c: Guard include of <sys/types.h>. Do not
include <sys/stat.h>.
(CreateFileA) [HAVE_W32CE_SYSTEM]: New wrapper function.
(load_domain): Use native Windows API.
* src/init.c (TLS_OUT_OF_INDEXES) [HAVE_W32CE_SYSTEM,
!TLS_OUT_OF_INDEXES]: Define it.
(abort) [!__MINGW32CE__]: Define it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Prepare a new release.
|
| |
|
| |
|
|
|
|
|
| |
Fix non-w32ce dependency problem.
|
| |
|
|
|
|
|
|
|
| |
* src/init.c (get_locale_dir): Return NULL instead of garbage.
* src/gpg-error.c (get_locale_dir): Likewise.
Submitted by Simon Josefsson <[email protected]>.
|
|
|
|
|
|
|
|
| |
* src/init.c (gpg_err_init) [!ENABLE_NLS]: Do not initialize the
locale.
* src/gpg-error.c (i18n_init) [!ENABLE_NLS]: Likewise.
Patch submitted by Nils Durner <[email protected]>.
|
|
* src/Makefile.am (libgpg_error_la_SOURCES): Add init.c.
* src/init.c: New file.
* src/gpg-error.h.in (gpg_error_init): New function.
* src/gpg-error.def: Add gpg_err_init.
* src/gpg-error.c: Remove SIMPLE_GETTEXT stuff.
(i18n_init): Don't bind text domain.
(main): Call gpg_err_init.
|