mbox series

[v2,0/2] gpg_sign: avoid unsupported gpg-agent argument passing

Message ID 20261202125343.310035-1-adarsh.jagadish.kamini@est.tech
Headers show
Series gpg_sign: avoid unsupported gpg-agent argument passing | expand

Message

Adarsh Jagadish Kamini Dec. 2, 2026, 12:53 p.m. UTC
Replace the "--agent-program=gpg-agent|--auto-expand-secmem" hack with a
lock around signing, with GPG_SIGN_SERIALIZE = "0" as an opt-out. Neither
GETINFO nor gpgconf reports whether a running agent has
auto-expand-secmem (GnuPG 2.4.4 and 2.5.24), so this can't be decided
per agent.

A launcher was also tested: a script passed with --agent-program that
starts gpg-agent with --auto-expand-secmem. gpg only runs it if no
agent is already running for GPG_PATH.

Signed core-image-minimal --runall=package_write_rpm, 141 tasks,
BB_NUMBER_THREADS = 64, gnupg-native 2.5.24. "Plain" is an agent
started without auto-expand-secmem:

  agent before build        lock  launcher  failed tasks
  plain, already running    no    no        138
  plain, already running    no    yes       137
  plain, already running    yes   no          0
  none                      no    yes         0
  none (auto-expand-secmem  no    no          0
  set in gpg-agent.conf)

No clear slowdown was observed in this build: with auto-expand-secmem
enabled, medians were 929s with the lock and 924s without, over three
runs each. The cost for sstate signing, which also takes the lock, was
not measured. The lock only serializes signing that shares a TMPDIR.

Adarsh Jagadish Kamini (2):
  lib/oe/gpg_sign.py: serialize signing instead of passing agent options
  oeqa: selftest: signing: test parallel signing and GPG_SIGN_SERIALIZE

 meta/classes/sign_ipk.bbclass           |  3 +
 meta/classes/sign_package_feed.bbclass  |  3 +
 meta/classes/sign_rpm.bbclass           |  3 +
 meta/lib/oe/gpg_sign.py                 | 22 +++---
 meta/lib/oeqa/selftest/cases/signing.py | 98 ++++++++++++++++++++++++-
 5 files changed, 117 insertions(+), 12 deletions(-)