<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libgpg-error/src/init.c, branch gniibe/t5912</title>
<subtitle>Error codes used by GnuPG et al.</subtitle>
<id>http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniibe%2Ft5912</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniibe%2Ft5912'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/'/>
<updated>2022-06-07T07:16:14Z</updated>
<entry>
<title>Remove WindowsCE support.</title>
<updated>2022-06-07T07:16:14Z</updated>
<author>
<name>NIIBE Yutaka</name>
<email>gniibe@fsij.org</email>
</author>
<published>2022-06-07T07:16:14Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=13e7650f4924cfdf94fad72f47f62a88e1c835ec'/>
<id>urn:sha1:13e7650f4924cfdf94fad72f47f62a88e1c835ec</id>
<content type='text'>
* Makefile.am: Remove contrib/ChangeLog-2011.
* configure.ac (have_w32ce_system): Remove.
(HAVE_W32CE_SYSTEM): Remove.
* contrib/*: Remove.
* src/w32ce-add.h: Remove
* src/Makefile.am [HAVE_W32CE_SYSTEM]: Remove.
* src/estream-printf.c [HAVE_W32CE_SYSTEM]: Remove.
* src/estream.c: Likewise.
* src/gpg-error.def.in: Likewise.
* src/gpgrt-int.h: Fix comments.
* src/init.c: Remove HAVE_W32CE_SYSTEM support.
* src/init.h: Likewise.
* src/spawn-posix.c: Likewise.
* src/spawn-w32.c: Likewise.
* src/sysutils.c: Likewise.
* src/w32-estream.c: Likewise.
* src/w32-reg.c: Likewise.
* tests/Makefile.am: Remove HAVE_W32CE_SYSTEM support.

--

GnuPG-bug-id: 5912
Signed-off-by: NIIBE Yutaka &lt;gniibe@fsij.org&gt;
</content>
</entry>
<entry>
<title>core: Make gpgrt_free robust against legacy free implementations.</title>
<updated>2021-05-20T07:19:44Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2021-05-20T07:18:49Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=448bf7b01cade87f45fb39f455f37a6aadeeceda'/>
<id>urn:sha1:448bf7b01cade87f45fb39f455f37a6aadeeceda</id>
<content type='text'>
* src/init.c (_gpgrt_free): Shortcut NULL and save ERRNO.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New function gpgrt_reallocarray.</title>
<updated>2020-03-03T14:41:39Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-03-03T14:41:39Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=969abd302211262562df93ae5412ee319aae69e6'/>
<id>urn:sha1:969abd302211262562df93ae5412ee319aae69e6</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New functions gpgrt_abort and gpgrt_add_emergency_cleanup.</title>
<updated>2019-01-04T12:13:53Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2019-01-04T12:13:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=933bfd7b652a907c0d8dd5337c6b5b9cb82ce7b7'/>
<id>urn:sha1:933bfd7b652a907c0d8dd5337c6b5b9cb82ce7b7</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>Fix typo in the annotation.</title>
<updated>2018-11-13T02:50:26Z</updated>
<author>
<name>NIIBE Yutaka</name>
<email>gniibe@fsij.org</email>
</author>
<published>2018-11-13T02:50:26Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=4b41cf3bd16c8afcb4ba152ab9d5d679a7cb91e7'/>
<id>urn:sha1:4b41cf3bd16c8afcb4ba152ab9d5d679a7cb91e7</id>
<content type='text'>
* src/init.c [DLL_EXPORT] (DllMain): Fix typo.

Signed-off-by: NIIBE Yutaka &lt;gniibe@fsij.org&gt;
</content>
</entry>
<entry>
<title>core,w32: Avoid recursive use of npth_unprotect.</title>
<updated>2018-05-01T17:45:00Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-05-01T17:35:28Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=b26a227173e8e9b91be14f06ee781c6e214e50ff'/>
<id>urn:sha1:b26a227173e8e9b91be14f06ee781c6e214e50ff</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>doc: Typo fixes.</title>
<updated>2018-02-21T16:54:30Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-02-21T16:54:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=a8cf20c47ee092da2ed6f75f104e27685764abac'/>
<id>urn:sha1:a8cf20c47ee092da2ed6f75f104e27685764abac</id>
<content type='text'>
--
</content>
</entry>
<entry>
<title>core: New API functions gpgrt_strdup and gpgrt_strconcat.</title>
<updated>2017-11-17T10:26:03Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2017-11-17T10:26:03Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=0d8d46c76a32176be440b062d2501bbb044fb99d'/>
<id>urn:sha1:0d8d46c76a32176be440b062d2501bbb044fb99d</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc.</title>
<updated>2017-11-17T10:00:39Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2017-11-17T10:00:39Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=80c18e1b212cc91946864db7a53da50e9f91b861'/>
<id>urn:sha1:80c18e1b212cc91946864db7a53da50e9f91b861</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>doc: Typo fix</title>
<updated>2017-07-05T07:04:26Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2017-07-05T07:01:59Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=d2aa2204cc7fc6b481412ed8ba9f65dfc64c6627'/>
<id>urn:sha1:d2aa2204cc7fc6b481412ed8ba9f65dfc64c6627</id>
<content type='text'>
--
</content>
</entry>
</feed>
