1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: Add OpenPGP<->Gcrypt pubkey id mapping functions.

* g10/misc.c (map_pk_gcry_to_openpgp): Move to ...
* common/openpgp-oid.c (map_gcry_pk_to_openpgp): here and rename.
Change all 4 callers.
(map_openpgp_pk_to_gcry): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-02-09 14:00:57 +01:00
parent 9df9996b41
commit 49c891a9bf
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
5 changed files with 41 additions and 21 deletions

View file

@ -523,21 +523,6 @@ map_cipher_gcry_to_openpgp (enum gcry_cipher_algos algo)
}
}
/* Map Gcrypt public key algorithm numbers to those used by OpenPGP.
FIXME: This mapping is used at only two places - we should get rid
of it. */
pubkey_algo_t
map_pk_gcry_to_openpgp (enum gcry_pk_algos algo)
{
switch (algo)
{
case GCRY_PK_EDDSA: return PUBKEY_ALGO_EDDSA;
case GCRY_PK_ECDSA: return PUBKEY_ALGO_ECDSA;
case GCRY_PK_ECDH: return PUBKEY_ALGO_ECDH;
default: return algo < 110 ? (pubkey_algo_t)algo : 0;
}
}
/* Return the block length of an OpenPGP cipher algorithm. */
int