mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* packet.h, build-packet.c (hash_public_key): Remove function ...
* keydb.h, keyid.c (hash_public_key, do_fingerprint_md): ... and make a new one here that shares code with the fingerprint calculations. This removes some duplicated functionality, and is also around 14% faster. (Every bit helps). * import.c (import_one): No longer need the Elgamal import warning. * getkey.c (get_pubkey_fast): This one is sort of obscure. get_pubkey_fast returns the primary key when requesting a subkey, so if a user has a key signed by a subkey (we don't do this, but used to), AND that key is not self-signed, AND the algorithm of the subkey in question is not present in GnuPG, AND the algorithm of the primary key that owns the subkey in question is present in GnuPG, then we will try and verify the subkey signature using the primary key algorithm and hit a BUG(). The fix is to not return a hit if the keyid is not the primary. All other users of get_pubkey_fast already expect a primary only.
This commit is contained in:
parent
888a6c2980
commit
db5ab5e730
7 changed files with 108 additions and 143 deletions
|
@ -1,5 +1,5 @@
|
|||
/* keydb.h - Key database
|
||||
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -237,6 +237,7 @@ KEYDB_HANDLE get_ctx_handle(GETKEY_CTX ctx);
|
|||
|
||||
/*-- keyid.c --*/
|
||||
int pubkey_letter( int algo );
|
||||
void hash_public_key( MD_HANDLE md, PKT_public_key *pk );
|
||||
u32 keyid_from_sk( PKT_secret_key *sk, u32 *keyid );
|
||||
u32 keyid_from_pk( PKT_public_key *pk, u32 *keyid );
|
||||
u32 keyid_from_sig( PKT_signature *sig, u32 *keyid );
|
||||
|
@ -250,13 +251,11 @@ const char *datestr_from_sig( PKT_signature *sig );
|
|||
const char *expirestr_from_pk( PKT_public_key *pk );
|
||||
const char *expirestr_from_sk( PKT_secret_key *sk );
|
||||
const char *expirestr_from_sig( PKT_signature *sig );
|
||||
|
||||
const char *colon_strtime (u32 t);
|
||||
const char *colon_datestr_from_pk (PKT_public_key *pk);
|
||||
const char *colon_datestr_from_sk (PKT_secret_key *sk);
|
||||
const char *colon_datestr_from_sig (PKT_signature *sig);
|
||||
const char *colon_expirestr_from_sig (PKT_signature *sig);
|
||||
|
||||
byte *fingerprint_from_sk( PKT_secret_key *sk, byte *buf, size_t *ret_len );
|
||||
byte *fingerprint_from_pk( PKT_public_key *pk, byte *buf, size_t *ret_len );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue