mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Wed Mar 17 13:09:03 CET 1999 Werner Koch
This commit is contained in:
parent
dafcce0177
commit
8d255ff264
27 changed files with 863 additions and 286 deletions
29
g10/getkey.c
29
g10/getkey.c
|
@ -31,6 +31,7 @@
|
|||
#include "keydb.h"
|
||||
#include "options.h"
|
||||
#include "main.h"
|
||||
#include "trustdb.h"
|
||||
#include "i18n.h"
|
||||
|
||||
#define MAX_UNK_CACHE_ENTRIES 1000 /* we use a linked list - so I guess
|
||||
|
@ -832,6 +833,34 @@ get_keyblock_byfprint( KBNODE *ret_keyblock, const byte *fprint,
|
|||
|
||||
|
||||
|
||||
/****************
|
||||
* Search for a key with the given lid and return the complete keyblock
|
||||
*/
|
||||
int
|
||||
get_keyblock_bylid( KBNODE *ret_keyblock, ulong lid )
|
||||
{
|
||||
int rc;
|
||||
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
||||
struct getkey_ctx_s ctx;
|
||||
u32 kid[2];
|
||||
|
||||
if( keyid_from_lid( lid, kid ) )
|
||||
kid[0] = kid[1] = 0;
|
||||
memset( &ctx, 0, sizeof ctx );
|
||||
ctx.not_allocated = 1;
|
||||
ctx.nitems = 1;
|
||||
ctx.items[0].mode = 12;
|
||||
ctx.items[0].keyid[0] = kid[0];
|
||||
ctx.items[0].keyid[1] = kid[1];
|
||||
rc = lookup_pk( &ctx, pk, ret_keyblock );
|
||||
get_pubkey_end( &ctx );
|
||||
|
||||
free_public_key( pk );
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue