From 49c891a9bfac24a1d95e76d33d44a49426247777 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sun, 9 Feb 2020 14:00:57 +0100 Subject: 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 --- g10/misc.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'g10/misc.c') diff --git a/g10/misc.c b/g10/misc.c index 07ce1d41d..8ace21f09 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -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 -- cgit v1.2.3