1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Make the get_pubkey_byname interface easier to understand.

* g10/keydb.h (enum get_pubkey_modes): New.
* g10/getkey.c (get_pubkey_byname): Repalce no_akl by a mode arg and
change all callers.
--

This change prepares the implementation of GET_PUBKEY_NO_LOCAL.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-07-04 10:42:48 +02:00
parent 8b113bb148
commit 9980f81da7
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
6 changed files with 57 additions and 32 deletions

View file

@ -345,12 +345,21 @@ typedef struct pubkey_s *pubkey_t;
/* Free a list of public keys. */
void pubkeys_free (pubkey_t keys);
/* Mode flags for get_pubkey_byname. */
enum get_pubkey_modes
{
GET_PUBKEY_NORMAL = 0,
GET_PUBKEY_NO_AKL = 1,
GET_PUBKEY_NO_LOCAL = 2
};
/* Find a public key identified by NAME. */
int get_pubkey_byname (ctrl_t ctrl,
int get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
GETKEY_CTX *retctx, PKT_public_key *pk,
const char *name,
KBNODE *ret_keyblock, KEYDB_HANDLE *ret_kdbhd,
int include_unusable, int no_akl );
int include_unusable);
/* Likewise, but only return the best match if NAME resembles a mail
* address. */