Index: kd_search.c =================================================================== RCS file: /home/mwa/Admin/cvsroot/home/mwa/src/pks/kd_search.c,v retrieving revision 1.5 diff -u -5 -r1.5 kd_search.c --- kd_search.c 1999/02/09 17:58:59 1.5 +++ kd_search.c 1999/03/11 18:16:56 @@ -371,11 +371,18 @@ soft_err(s, "Key block corrupt: signature decode failed"); return(1); } - if (sigclass == 0x20) { + if (s->ke == NULL) { + /* signature on nothing */ + soft_err(s, + "Key block corrupt: signature without key"); + return(1); + } + + if (sigclass == 0x20) { /* key revocation signature */ if (s->ke->revocation.len) { soft_err(s, "Key block corrupt: multiple revocations on single key"); return(1); @@ -796,10 +803,16 @@ int first; llist wdes; error *err; } wki_state; +static int sort_twelvebytes(const void *a, const void *b) +{ + /* the result should be most recent first, so reverse args to memcmp */ + return(memcmp(b, a, 12)); +} + int word_key_intersect(void *e, void *c) { words_elem *we = (words_elem *) e; wki_state *s = (wki_state *) c; /* since no userid can be > 255, it follows that no @@ -808,11 +821,10 @@ unsigned char word[256]; DBT key, data; llist db_wdes, merged_wdes; int i; unsigned char *wde; - static int sort_twelvebytes(); /* already 1 element selected */ if ( llist_count(&(s->wdes)) == 1 ) { return (1); } @@ -966,16 +978,10 @@ typedef struct _akte_state { xbuffer entries; error *err; } akte_state; - -static int sort_twelvebytes(const void *a, const void *b) -{ - /* the result should be most recent first, so reverse args to memcmp */ - return(memcmp(b, a, 12)); -} int add_key_to_entrylist(void *e, void *c) { keys_elem *ke = (keys_elem *) e; akte_state *s = (akte_state *) c;