Home GnuPG
Diffusion GnuPG 3a1fa13eedb9

common: New function get_keyalgo_string.

Description

common: New function get_keyalgo_string.

* common/openpgp-oid.c (struct keyalgo_string_s): New.
(keyalgo_strings): New.
(keyalgo_strings_size, keyalgo_strings_used): New.
(get_keyalgo_string): New.

This function is intended as a more general version of gpg's
pubkey_string function. It has the advantage to avoid mallocs and
uses static table of algorithm strings instead. There should be only
a few dozen of such strings (if at all) and thus all those allocations
we do internally in gpg's pubkey_string and the static buffers all
over the place are not too nice.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Feb 9 2020, 9:20 PM
Parents
rG49c891a9bfac: common: Add OpenPGP<->Gcrypt pubkey id mapping functions.
Branches
Unknown
Tags
Unknown