diff --git a/g10/ChangeLog b/g10/ChangeLog index 7ab7b43f0..655d204d8 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,12 @@ +2003-01-10 David Shaw + + * trustdb.h, trustdb.c (trust_letter): Make static. + (get_ownertrust_info, get_validity_info): Don't mask the trust + level twice. + + * armor.c (armor_filter): Comment about PGP's end of line tab + problem. + 2003-01-08 David Shaw * packet.h, pkclist.c (build_pk_list), free-packet.c diff --git a/g10/armor.c b/g10/armor.c index 9c7858fe6..70d4d5aac 100644 --- a/g10/armor.c +++ b/g10/armor.c @@ -1,5 +1,6 @@ /* armor.c - Armor flter - * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + * Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -871,6 +872,9 @@ armor_filter( void *opaque, int control, hashes &= 1|2|4|8; if( !hashes ) { hashes |= 4; /* default to MD 5 */ + /* This is non-ideal since PGP 5-8 have the same + end-of-line bugs as PGP 2. However, we only + enable pgp2mode if there is no Hash: header. */ if( opt.pgp2_workarounds ) afx->pgp2mode = 1; } diff --git a/g10/trustdb.c b/g10/trustdb.c index cfd2dd922..402dc9402 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -1,5 +1,6 @@ /* trustdb.c - * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + * Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -423,7 +424,7 @@ init_trustdb() * This function returns a letter for a trustvalue Trust flags * are ignore. */ -int +static int trust_letter (unsigned int value) { switch( (value & TRUST_MASK) ) @@ -557,7 +558,7 @@ get_ownertrust_info (PKT_public_key *pk) int c; otrust = get_ownertrust (pk); - c = trust_letter( (otrust & TRUST_MASK) ); + c = trust_letter( otrust ); if( !c ) c = '?'; return c; @@ -651,7 +652,7 @@ update_validity (PKT_public_key *pk, PKT_user_id *uid, ulong recno; byte namehash[20]; - if( uid->attrib_data ) + if(uid->attrib_data) rmd160_hash_buffer (namehash,uid->attrib_data,uid->attrib_len); else rmd160_hash_buffer (namehash, uid->name, uid->len ); @@ -798,7 +799,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid) if(uid) { - if( uid->attrib_data ) + if(uid->attrib_data) rmd160_hash_buffer (namehash,uid->attrib_data,uid->attrib_len); else rmd160_hash_buffer (namehash, uid->name, uid->len ); @@ -903,7 +904,7 @@ get_validity_info (PKT_public_key *pk, PKT_user_id *uid) return 'd'; if( trustlevel & TRUST_FLAG_REVOKED ) return 'r'; - c = trust_letter ( (trustlevel & TRUST_MASK) ); + c = trust_letter ( trustlevel ); if( !c ) c = '?'; return c; @@ -919,7 +920,7 @@ get_validity_counts (PKT_public_key *pk, PKT_user_id *uid) if(pk==NULL || uid==NULL) BUG(); - if( uid->attrib_data ) + if(uid->attrib_data) rmd160_hash_buffer (namehash,uid->attrib_data,uid->attrib_len); else rmd160_hash_buffer (namehash, uid->name, uid->len ); diff --git a/g10/trustdb.h b/g10/trustdb.h index 1757a30d2..41f2af57f 100644 --- a/g10/trustdb.h +++ b/g10/trustdb.h @@ -1,5 +1,6 @@ /* trustdb.h - Trust database - * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + * Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -45,8 +46,6 @@ int setup_trustdb( int level, const char *dbname ); void init_trustdb( void ); void sync_trustdb( void ); -int trust_letter( unsigned value ); - void revalidation_mark (void); int is_disabled(void *dummy,u32 *keyid);