1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

* keyring.c (keyring_rebuild_cache): Lock the keyring while rebuilding the

signature caches to prevent another gpg from tampering with the temporary
copy.

* keydb.c: Double the maximum number of keyrings to 40.

* parse-packet.c (dump_sig_subpkt): Show the notation names for
not-human-readable notations.  Fix cosmetic off-by-one length counter.
This commit is contained in:
David Shaw 2003-03-03 20:27:02 +00:00
parent 16c925f68a
commit 208509950c
4 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,15 @@
2003-03-03 David Shaw <dshaw@jabberwocky.com>
* keyring.c (keyring_rebuild_cache): Lock the keyring while
rebuilding the signature caches to prevent another gpg from
tampering with the temporary copy.
* keydb.c: Double the maximum number of keyrings to 40.
* parse-packet.c (dump_sig_subpkt): Show the notation names for
not-human-readable notations. Fix cosmetic off-by-one length
counter.
2003-03-02 Timo Schulz <twoaday@freakmail.de> 2003-03-02 Timo Schulz <twoaday@freakmail.de>
* seckey-cert.c (do_check): Issue the RSA_OR_IDEA status when * seckey-cert.c (do_check): Issue the RSA_OR_IDEA status when

View File

@ -42,7 +42,7 @@ typedef enum {
KEYDB_RESOURCE_TYPE_NONE = 0, KEYDB_RESOURCE_TYPE_NONE = 0,
KEYDB_RESOURCE_TYPE_KEYRING KEYDB_RESOURCE_TYPE_KEYRING
} KeydbResourceType; } KeydbResourceType;
#define MAX_KEYDB_RESOURCES 20 #define MAX_KEYDB_RESOURCES 40
struct resource_item { struct resource_item {
KeydbResourceType type; KeydbResourceType type;

View File

@ -1316,6 +1316,10 @@ keyring_rebuild_cache (void *token)
memset (&desc, 0, sizeof desc); memset (&desc, 0, sizeof desc);
desc.mode = KEYDB_SEARCH_MODE_FIRST; desc.mode = KEYDB_SEARCH_MODE_FIRST;
rc=keyring_lock (hd, 1);
if(rc)
goto leave;
while ( !(rc = keyring_search (hd, &desc, 1)) ) while ( !(rc = keyring_search (hd, &desc, 1)) )
{ {
desc.mode = KEYDB_SEARCH_MODE_NEXT; desc.mode = KEYDB_SEARCH_MODE_NEXT;
@ -1410,6 +1414,7 @@ keyring_rebuild_cache (void *token)
m_free (tmpfilename); m_free (tmpfilename);
m_free (bakfilename); m_free (bakfilename);
release_kbnode (keyblock); release_kbnode (keyblock);
keyring_lock (hd, 0);
keyring_release (hd); keyring_release (hd);
return rc; return rc;
} }

View File

@ -752,12 +752,12 @@ dump_sig_subpkt( int hashed, int type, int critical,
type, (unsigned)length ); type, (unsigned)length );
} }
buffer++;
length--;
printf("\t%s%ssubpkt %d len %u (", /*)*/ printf("\t%s%ssubpkt %d len %u (", /*)*/
critical ? "critical ":"", critical ? "critical ":"",
hashed ? "hashed ":"", type, (unsigned)length ); hashed ? "hashed ":"", type, (unsigned)length );
buffer++;
length--;
if( length > buflen ) { if( length > buflen ) {
printf("too short: buffer is only %u)\n", (unsigned)buflen ); printf("too short: buffer is only %u)\n", (unsigned)buflen );
return; return;
@ -823,8 +823,6 @@ dump_sig_subpkt( int hashed, int type, int critical,
fputs("notation: ", stdout ); fputs("notation: ", stdout );
if( length < 8 ) if( length < 8 )
p = "[too short]"; p = "[too short]";
else if( !(*buffer & 0x80) )
p = "[not human readable]";
else { else {
const byte *s = buffer; const byte *s = buffer;
size_t n1, n2; size_t n1, n2;
@ -837,7 +835,11 @@ dump_sig_subpkt( int hashed, int type, int critical,
else { else {
print_string( stdout, s, n1, ')' ); print_string( stdout, s, n1, ')' );
putc( '=', stdout ); putc( '=', stdout );
print_string( stdout, s+n1, n2, ')' );
if( *buffer & 0x80 )
print_string( stdout, s+n1, n2, ')' );
else
p = "[not human readable]";
} }
} }
} }