mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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. (openpgp_oid_or_name_to_curve): 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> (cherry picked from commit3a1fa13eed
) (cherry picked from commit332a72f734
)
This commit is contained in:
parent
398cec3ac7
commit
2e39fed109
4 changed files with 240 additions and 6 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue