summaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-02-09 21:20:48 +0100
committerWerner Koch <wk@gnupg.org>2020-02-09 21:26:35 +0100
commit3a1fa13eedb969b561bae18cd3d7c2fb0b63d6ab (patch)
tree704e4441d3a713a82dd587e94c6874cd1615f87e /g10/keyid.c
parentcommon: Add OpenPGP<->Gcrypt pubkey id mapping functions. (diff)
downloadgnupg2-3a1fa13eedb969b561bae18cd3d7c2fb0b63d6ab.tar.xz
gnupg2-3a1fa13eedb969b561bae18cd3d7c2fb0b63d6ab.zip
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>
Diffstat (limited to 'g10/keyid.c')
-rw-r--r--g10/keyid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index a7a54e07b..e6298e5da 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -88,7 +88,10 @@ pubkey_letter( int algo )
"256E" - ECDSA using a curve with 256 bit
The macro PUBKEY_STRING_SIZE may be used to allocate a buffer with
- a suitable size.*/
+ a suitable size. Note that a more general version of this function
+ exists as get_keyalgo_string. However, that has no special
+ treatment for the old and unsupported Elgamal which we here print as
+ xxxNNNN. */
char *
pubkey_string (PKT_public_key *pk, char *buffer, size_t bufsize)
{