diff options
author | David Shaw <[email protected]> | 2004-01-28 01:04:30 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-01-28 01:04:30 +0000 |
commit | 654ba16db55cdab42c4c1f381a967e006dfe10cd (patch) | |
tree | 881e962566dbe7dbc5e80e9b4f96e145bbd661dc /g10/getkey.c | |
parent | * NEWS: Note --enable-key-cache, the OpenBSD/i386 and HPPA fixes, and (diff) | |
download | gnupg-654ba16db55cdab42c4c1f381a967e006dfe10cd.tar.gz gnupg-654ba16db55cdab42c4c1f381a967e006dfe10cd.zip |
* getkey.c: Set MAX_PK_CACHE_ENTRIES and MAX_UID_CACHE_ENTRIES to
PK_UID_CACHE_SIZE (set in ./configure).
* getkey.c (get_pubkey): When reading key data into the cache, properly
handle keys that are partially (pk, no UIDs) cached already. This is
Debian bug #176425 and #229549.
* compress.c (init_compress, push_compress_filter2): Do the right thing
(i.e. nothing) with compress algo 0.
* main.h, decrypt.c (decrypt_messages): Accept filenames to decrypt on
stdin. This is bug #253.
Diffstat (limited to 'g10/getkey.c')
-rw-r--r-- | g10/getkey.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index e5c311832..3f0997e2d 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -35,14 +35,13 @@ #include "trustdb.h" #include "i18n.h" -#define MAX_PK_CACHE_ENTRIES 200 -#define MAX_UID_CACHE_ENTRIES 200 +#define MAX_PK_CACHE_ENTRIES PK_UID_CACHE_SIZE +#define MAX_UID_CACHE_ENTRIES PK_UID_CACHE_SIZE #if MAX_PK_CACHE_ENTRIES < 2 #error We need the cache for key creation #endif - struct getkey_ctx_s { int exact; KBNODE keyblock; @@ -320,16 +319,21 @@ get_pubkey( PKT_public_key *pk, u32 *keyid ) int rc = 0; #if MAX_PK_CACHE_ENTRIES - { /* Try to get it from the cache */ + if(pk) + { + /* Try to get it from the cache. We don't do this when pk is + NULL as it does not guarantee that the user IDs are + cached. */ pk_cache_entry_t ce; - for( ce = pk_cache; ce; ce = ce->next ) { - if( ce->keyid[0] == keyid[0] && ce->keyid[1] == keyid[1] ) { - if( pk ) - copy_public_key( pk, ce->pk ); + for( ce = pk_cache; ce; ce = ce->next ) + { + if( ce->keyid[0] == keyid[0] && ce->keyid[1] == keyid[1] ) + { + copy_public_key( pk, ce->pk ); return 0; - } - } - } + } + } + } #endif /* more init stuff */ if( !pk ) { |