User Details
- User Since
- Mar 27 2017, 4:47 PM (449 w, 2 d)
- Roles
- Administrator
- Availability
- Busy Busy until Jun 29 2031.
Today
That's my mistake with KEM API.
Here is my idea to implement the feature:
(1) Extend struct iobuf_struct to have a field of temporary output (of int), just after real_fname.
- OUTPUTFILE: When it's 1, a file generated with real_fname original suffix removed and appended .tmp is used for the output
(2) Modify get_output_file in plaintext.c and make_outfile_name in openfile.c, so that OUTPUTFILE above is used and the field in iobuf_struct is marked.
(3) Modify proc_encrypted in mainproc.c so that rename .tmp file to the OUTPUTFILE or remove it when failure.
Applied to 1.11 branch.
Let me explain the background.
Yesterday
For gpgrt/argparse this could be an option (to remove hard-coded /etc):
Tue, Nov 4
Pushed the revised change to master.
Mon, Nov 3
Fixed in 2.5.13.
@onickolay The change was originally introduced for PQC stuff. And then, we applied use of KEM API (of libgcrypt) also for ordinary ECDH, so, it affected ordinary ECDH encryption (between 2.5.9 and 2.5.12).
The intention is follow the recommendation of use of KEM. IIUC, next FIPS certification will require use of KEM, possibly.
Thu, Oct 30
Thank you for your report.
Note that:
If we consider backporting this to 1.10/1.11 branch, we also need to apply: rCdef1d4ea8f66: random:jent: Fix build with address sanitizer.
@jukivili
Thanks for your feedback.
Wed, Oct 29
For the initial attempt, I push: rCfe06287003a1: secmem: Handle HAVE_BROKEN_MLOCK for the case with ASAN.
This is better than nothing.
Thu, Oct 23
Wed, Oct 22
Still, there is a fundamental problem with keydb locking.
- It only assures no-data-corruption.
- When a process doing write access, another process reading the resource may encounter a problem (inconsistent data read), since data could be changed while accessing.
- Currently, write access may occur with keybox compress, this means that users are not safe to invoke multiple gpg/gpgsm simultaneously (to be sure).
- It would be: only keybox compress when users explicitly ask.
- We could introduce a lock to read access... BUT naively adding a lock (both for read and write or read-multiple-write-one) results possible deadlock in gpgsm
- in gpgsm, gpgsm_walk_cert_chain and gpgsm_validate_chain access the resource of keydb in a way of:
- While it has a handle kh, by find_up routine, it may call keydb_store_cert by callback routine; The callback does write access to the resource opening another handle.
- Currently, it works because of no lock for read access and keydb_store_cert appends data at the end.
- in gpgsm, gpgsm_walk_cert_chain and gpgsm_validate_chain access the resource of keydb in a way of:
- Currently, write access may occur with keybox compress, this means that users are not safe to invoke multiple gpg/gpgsm simultaneously (to be sure).
All changes in gniibe/t7855 are pushed into master.
Tue, Oct 21
This issue should be fixed in 2.6, too.
Pushed the change to gnupg master: rG61ff3759e827: common,dirmngr:w32: Fix for semi-hosted environment.
In libgpg-error, I pushed thread-safe version : rE0313b660f8bd: w32: Don't convert slash->backslash when it's under Wine.
I'm going to push similar code to gnupg master.
Fri, Oct 17
Lastly, pushed a change into gniibe/t7855 branch.
rGf861b2a33f96: gpg,gpgsm: Fix thinko for FP closing under no lock.
Thu, Oct 16
I pushed further changes into gniibe/t7855 branch.
rG2fe62809014e: gpg,gpgsm: Serialize write access to keybox/keyring to protect.
Wed, Oct 15
For remaining changes in 2.2, I pushed changes into gniibe/t7855 branch.
rGbd65b06b74c2: gpg,gpgsm: Don't lock recursively when KEEP_LOCK is enabled.
rG423fd047da87: kbx,gpg,gpgsm: Add FP-close method for keydb to close before unlock.
rG966258ac5f99: gpgsm: Fix delete and store certificate locking glitches.
I pushed changes into gniibe/t7855 for compressing the keybox.
rG8cc2a0e0ffee: gpg: Minor clean up for keydb_lock API.
rGe4d3c3aa2220: kbx,gpg,gpgsm: Introduce keybox_compress_when_no_other_users.
rG3e441d5b299f: kbx,gpg,gpgsm: More changes for compressing the keybox.
Tue, Oct 14
Then, we need to integrate following commits of 2.2 into gniibe/t7855 branch:
rG43fe9073aa81: gpg,gpgsm: Tweak the locking of the pubring.kbx
rG8491aca73cff: gpg: Revert the always locking introduced with 43fe9073aa
rGad4a5117ab1c: gpgsm: Properly release the lock when compressing a pubring.
rG7962eca3a023: gpgsm: Change delete and store certificate locking glitches.
rG22f9c4a3b3c1: gpg: Release lock after close also in the compress code path.
I created gniibe/t7855 branch for this issue.
To start with, I forward-port/cherry-pick 2.2 commits to the branch:
rG39430d9f78dc: build,common,g13,sm,tools: Require GpgRT 1.56.
rGe71aca2a628d: common: New function gnupg_remove_ext.
rGe38c5f7d5873: w32:common: Take care of possible race on startup under Windows.
rG7bfd37e305c0: common,w32: Always use share mode readwrite for the keybox.
@timegrid Thank you for your confirmation.
Sorry for my late review. I should have reviewed earlier.
Mon, Oct 13
Fri, Oct 10
I understand that this is for 2.6.
Thu, Oct 9
Here are places where I found problems.
Wed, Oct 8
Fixed in 1.56.
Fixed in 1.3.2.
Tue, Oct 7
Oct 7 2025
Oct 6 2025
Reading the commit log message in rG6dc3846d7819: sm: Support creation of EdDSA certificates.
I created a file to keygen.
Key-Type: ECDSA Key-Length: 1024 Key-Grip: 0286DCA85E771F64AB9FD9C89717369524D55471 Key-Usage: sign,encrypt Hash-Algo: sha384 Serial: random Name-DN: CN=dummy test nistp384
Oct 3 2025
I updated the branch.
Oct 2 2025
I think that modifying gnupg_remove is a bit risky because it's used in many places.
I'd rather introduce new function for Windows; gnupg_w32_delete_file for this particular purpose.
Factoring out wait_when_sharing_violation function from gnupg_rename_file.
Oct 1 2025
Here is a possible fix:
Sep 26 2025
This is current work of mine: