Home GnuPG
Diffusion GnuPG 5651b2c460a7

agent: correct length for uri and comment on 64-bit big-endian platforms

Description

agent: correct length for uri and comment on 64-bit big-endian platforms

* agent/findkey.c (agent_public_key_from_file): pass size_t as int to
gcry_sexp_build_array's %b.

This is only a problem on big-endian systems where size_t is not the
same size as an int. It was causing failures on debian's s390x,
powerpc64, and sparc64 platforms.

There may well be other failures with %b on those platforms in the
codebase, and it probably needs an audit.

Once you have a key in private-keys-v1.d/$KEYGRIP.key with a comment
or a uri of reasonable length associated with it, this fix can be
tested with:

gpg-agent --server <<<"READKEY $KEYGRIP"

On the failing platforms, the printed comment will be of length 0.

  • Gnupg-bug-id: T4501
  • Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

Details

Provenance
dkgAuthored on May 14 2019, 6:05 AM
wernerCommitted on May 14 2019, 10:23 AM
Parents
rG3c2198e907c6: doc: Minor edit for a gpg option.
Branches
Unknown
Tags
Unknown
Tasks
T4501: gpg --generate-key --batch from existing key (with Key-Grip:) fails on 64-bit big-endian architectures