Ingo tested this and it worked.
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Mon, Jun 30
Thu, Jun 26
Mon, Jun 23
Fri, Jun 20
OK. I'll add a code for setting the fallback value in _gpgme_io_subsystem_init and use it from get_max_fds.
iirc we introduced sysconf (_SC_OPEN_MAX) for non-linux platforms and that fixed real world problems. What about getting this value at module initialization time and keep on using it as a fallback?
For issues of get_max_fds, I created a sub task, although it seems not the direct cause of this particular problem.
Thu, Jun 19
I test following test program (gcc -o t-gmf t-gmf.c) on Debian machine of S390x.
Tue, Jun 17
In the log, we can observe duplicated lines generated by
https://dev.gnupg.org/source/gpgme/browse/master/src/posix-io.c$545
Example is like:
2025-05-19 20:16:35 gpgme[21970.55d7] _gpgme_io_spawn: check: fd[0] = 0x1c -> 0x1 2025-05-19 20:16:35 gpgme[21970.55d7] _gpgme_io_spawn: check: fd[0] = 0x1c -> 0x1
Jun 5 2025
In practice, calling gpgme_get_key() will often pick up most changes because GPGME asks the underlying GPG agent daemon, which may re-read the keyring. That gives the impression that a long-lived context automatically reflects live updates. However, as aheinecke noted, some updates can still go unnoticed in a single gpgme_ctx_t, so it isn’t a strictly frozen snapshot nor a perfectly live view—behaviors are mixed.
In T7620#201528, @aheinecke wrote:Maybe we should make the documentation clearer about context key reuse. But the context is specifically designed to cache information about a key, so as to avoid memory overhead. I learned early on that its best for each new operation to use a new context. A context is basically an instance of gpg or gpgsm. So you start one process, ask it for a keylist, keep the process running, start another process, modify the key database, and then ask the first process again about his worldview. Either the first process is a bit confused because it has read data and then that data changed (what happens here) or it has no idea about the change since it was efficient and only read the database once. But here in this example you should be able to reproduce this also by making any other modifications to the key, adding other subkeys, userids etc. That GPGME even notices the secret key is more of a side effect of how the programming works because the GPGME gpg process will ask the gpg-agent (so a third process).
In T7673#201735, @werner wrote:We will keep the 1.24 branch for bug fixing. Do you really have a problem with gpgme 2.0? Ist that due to factoring out the c++ and qt bindings? That was actually a long standing request from the KDE community so that they can use their cmake stuff.
We will keep the 1.24 branch for bug fixing. Do you really have a problem with gpgme 2.0? Ist that due to factoring out the c++ and qt bindings? That was actually a long standing request from the KDE community so that they can use their cmake stuff.
I'm wondering whether gpgme v1 will still be supported? Or it will be abandoned from now on.
Jun 4 2025
No other processes that I have seen. However please see this last update by Kulbarsch. https://github.com/cri-o/cri-o/issues/8906#issuecomment-2936351035
@sj98ta
Does cri-o invokes processes (other than the ones of gpgme) by its threads?
Jun 3 2025
I am not sure that I am clear on what you are asking. I am not an expert on cri-o, but is does seem that there are multiple processes (threads), which all call gpgme_op_verify There are also calls to gpgme_op_import
@sj98ta Please let us know if cri-o invokes other processes (except the ones by gpgme) or not.
If cri-o invokes other processes (by other threads), my theory matters; With the interference by other processes holding pipe file descriptors, gpgme keeps polling pipe file descriptors.
Jun 2 2025
I have now seen instances where 1, 2, or 3 processes hang.
May 30 2025
Re: pipe2: In gpgme_io_pipe we set FD_CLOEXEC only for one end of the pipe. Thus simply using pipe2 would change the behaviour.
Here is a hypothetical application which may have similar problem.
(1) It is a multi threaded application using gpgme, forking another process (possibly, exec).
(2) One of threads invokes gpgme_new, gpgme_op_import and gpg_op_verify.
(3) When the control goes to gpgme_op_* then gpgme_io_spawn by a thread A, another thread B forks a process.
(3-1) While the thread A is polling pipe I/O, forked process holds pipe file descriptors too.
(3-2) Until the forked process exists, pipe I/O polling by the thread A continues (because pipe's other end is still active).
There is FD_CLOFORK on Solaris 11.4 as well. It is a part of POSIX-1.2024, but who knows how long until that becomes common.
I don't know if it is related to this particular case, but I found a possible race condition in _gpgme_io_pipe.
Between pipe and fcntl with FD_CLOEXEC, another thread may fork a process which keeps running.
It would be good to use pipe2 here:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/pipe.html
May 29 2025
Another possible cause is... gpgme uses closefrom in GNU C library, if available. if it doesn't work well, it would be possible invoked gpg keeps waiting its input.
Here is my observation.
May 28 2025
I do not think that this is the only place where such an issue occurs. Maybe we should make the documentation clearer about context key reuse. But the context is specifically designed to cache information about a key, so as to avoid memory overhead. I learned early on that its best for each new operation to use a new context. A context is basically an instance of gpg or gpgsm. So you start one process, ask it for a keylist, keep the process running, start another process, modify the key database, and then ask the first process again about his worldview. Either the first process is a bit confused because it has read data and then that data changed (what happens here) or it has no idea about the change since it was efficient and only read the database once. But here in this example you should be able to reproduce this also by making any other modifications to the key, adding other subkeys, userids etc. That GPGME even notices the secret key is more of a side effect of how the programming works because the GPGME gpg process will ask the gpg-agent (so a third process).
May 27 2025
May 23 2025
May 20 2025
looks good to me on gpg4win-4.4.1-beta59@win10
Checked with Gpg4win-4.4.1-beta59, too, which contains gpgme 1.24.3. Works!
May 19 2025
In T7627#200387, @werner wrote:
May 8 2025
In T7620#200845, @Saturneric wrote:I think it would be much better if GnuPG automatically performed a key listing immediately after key generation when a smartcard is involved. This would allow GnuPG to detect the presence of the subkey on the card right away, rather than leaving it marked as a stub until the user manually lists keys.
I see that you generated the secret encryption subkey with backup. This means that the secret subkey is generated on your computer, then copied to the card, and then deleted from your computer. The deletion is the reason why the subkey is marked as stub. Only after listing the keys on the card gpg notices that the secret key is actually on the card.
May 7 2025
works for me, thanks
May 6 2025
The first call of get_key receives the following key listing from gpg:
2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: sec:-:256:19:C4A24EB0B5F2E025:1746474606:::u:::s 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: cESCA:::D2760001240100000006180489130000::brainp 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: oolP256r1:23::0:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: fpr:::::::::DEC0948C398A6E7B50746EC6C4A24EB0B5F2 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: E025:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: grp:::::::::06BDACFBDEDBC5783A75AE5E7251FA3369C4 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: 0FF4:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: uid:-::::1746474606::2222D8E2F373B9BDEE0DEA2A20A 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: 9402214E9F984::Eric <eric@bktus.com>::::::::::0: 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: <LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: ssb:-:256:19:EAFC5EA29B758B22:1746474606::::::a: 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: ::D2760001240100000006180489130000::brainpoolP25 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: 6r1:23:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: fpr:::::::::1AD596DDEC9B8CF3C1AC6C41EAFC5EA29B75 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: 8B22:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: grp:::::::::52F0797C0B0439BBD718E2534D46656A6C45 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: 6A78:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: ssb:-:256:18:A874804DB497B91C:1746474606::::::e: 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: ::#::brainpoolP256r1:23:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: fpr:::::::::33B273C7BD46E4EB63DD6874A874804DB497 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: B91C:<LF> 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: grp:::::::::34A1F8D9B2AA0CF07C2E042D70E10F9D4EBE 2025-05-05 21:50:23 gpgme[57059] _gpgme_io_read: check: E734:<LF>
Note the line
ssb:-:256:18:A874804DB497B91C:1746474606::::::e:::#::brainpoolP256r1:23:<LF>
where the # marks the subkey as stub.
May 5 2025
I have now identified the exact conditions and a reproducible path for the issue I previously reported. I will also attach the relevant gpgme.log.
I doubt that this is a gpgme problem. With a gpgme log we will be able see the exact commands send to gpg and replicate this on the command line.
Should be fixed.
For gpgme 2 we changed the data types of the time fields to unsigned: rMf2d40473b522e348d96a70c089d2191d0b978098 . Since this change breaks the ABI we use the above change for the 1.24 branch.
tested @ikloecker's patch succesful on amdahl.
The following patch for gpgme 1.24 should fix the test.
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 42046aa..2b14d90 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -633,7 +633,7 @@ time_t Subkey::creationTime() const
I did a local change (on amdahl.d.o) changing _gpgme_subkey.expires to long long (ABI-break) and all tests succeeded.
It looks like the entirety of gpgme timestamping was missed when the 64bit time transition happened in Debian and Ubuntu.
This looks like a problem in gpgme. struct _gpgme_subkey stores the expiration date as long int expires which is a signed 32-bit value on all 32-bit architectures. gpgmepp casts this to time_t, but that doesn't help if the 32-bit value is already negative. The same problem exists with all other timestamps in gpgme (i.e. key creation date, signature expiration date, etc.).
The logs of gpgme would be helpful, i.e. run your test program with GPGME_DEBUG=8:$(pwd)/gpgme-$(date +"%Y-%m-%d-%H%M%S").log to create a log file with gpgme's logs.
Apr 26 2025
Apr 22 2025
Apr 16 2025
This is resolved in the final Beta15.
Apr 14 2025
Apr 11 2025
I tried to apply crude patches. Since _POSIX_C_SOURCE is defined when <string.h> is included (in pre-compiled source I see
That error code is actually not an error code but it is the ERROR state from the Kleo SFM. We have seen that yesterday already.
this exact case is fixed in VS-Desktop-3.3.90.12-Beta
Adding further UIDs and making more certifications still works, too.
Apr 10 2025
Very likely this bug exists since 2017 when support for promotion of local certifications to exportable certifications was added.
Fixed in gpgmepp for gpd5x. I think for VSD 3.3 we'll add a patch to gpg4win.
Mar 19 2025
Attached is a patch which adds gpgme_subkey_set_flag() to handle both encryption and signing keys. Or maybe it would be better to add another signing function that does recpstring?
Mar 14 2025
BTW, do we really need a C++ API for this? Might make sense due to the need for a context.
Mar 10 2025
This was using GCC to build, but on AIX. I believe support for dollar signs in identifiers are platform specific.
GCC allows dollars in identifier, that's the reason why we haven't encountered this issue, I suppose.
Thank you for your report.
Feb 28 2025
Feb 26 2025
New API gpgme_op_random_bytes is now in master (gpgme 2.0). Use tests/run-genrandom --help for testing. Extra features will come soon.
Feb 24 2025
Feb 21 2025
Finally removed with gpgme 2.0
Feb 16 2025
Feb 10 2025
Feb 4 2025
Okay, thanks!
Fixed in master and the new gpgme-1.24-branch. Thus this fix will be in 2.0.0 and 1.24.2
Feb 3 2025
I am pretty sure this was my fault: rM62b6c1f16 is the culprit.
Jan 20 2025
VSD-Beta-481: Encrypting/signing with gpgtar on the cli and decrypting/verifying with Kleopatra works
Jan 13 2025
works with VSD-beta-478