1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-24 16:43:28 +02:00

See ChangeLog: Sun Dec 13 14:10:56 CET 1998 Werner Koch

This commit is contained in:
Werner Koch 1998-12-13 13:14:27 +00:00
parent e5666c8fef
commit c6be02da77
2 changed files with 22 additions and 7 deletions

View File

@ -1,3 +1,8 @@
Sun Dec 13 14:10:56 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* pcklist.c (select_algo_from_prefs): Preferences should
now work (lost the != ? )
Thu Dec 10 20:15:36 CET 1998 Werner Koch <wk@isil.d.shuttle.de> Thu Dec 10 20:15:36 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* ringedit.c (gdbm_store): Fix for inserts * ringedit.c (gdbm_store): Fix for inserts

View File

@ -595,12 +595,14 @@ select_algo_from_prefs( PK_LIST pk_list, int preftype )
if( !pkr->pk->local_id ) if( !pkr->pk->local_id )
BUG(); /* if this occurs, we can use get_ownertrust to set it */ BUG(); /* if this occurs, we can use get_ownertrust to set it */
if( preftype == PREFTYPE_SYM ) if( preftype == PREFTYPE_SYM )
bits[0] = (1<<2); /* 3DES is implicitly there */ mask[0] |= (1<<2); /* 3DES is implicitly there */
m_free(pref); m_free(pref);
pref = get_pref_data( pkr->pk->local_id, pkr->pk->namehash, &npref); pref = get_pref_data( pkr->pk->local_id, pkr->pk->namehash, &npref);
any = 0; any = 0;
if( pref ) { if( pref ) {
/*log_hexdump("raw: ", pref, npref );*/ #if 0
log_hexdump("raw: ", pref, npref );
#endif
for(i=0; i+1 < npref; i+=2 ) { for(i=0; i+1 < npref; i+=2 ) {
if( pref[i] == preftype ) { if( pref[i] == preftype ) {
mask[pref[i+1]/32] |= 1 << (pref[i+1]%32); mask[pref[i+1]/32] |= 1 << (pref[i+1]%32);
@ -613,14 +615,18 @@ select_algo_from_prefs( PK_LIST pk_list, int preftype )
compr_hack = 1; compr_hack = 1;
} }
/*log_debug("mask=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX\n", #if 0
log_debug("mask=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX\n",
(ulong)mask[7], (ulong)mask[6], (ulong)mask[5], (ulong)mask[4], (ulong)mask[7], (ulong)mask[6], (ulong)mask[5], (ulong)mask[4],
(ulong)mask[3], (ulong)mask[2], (ulong)mask[1], (ulong)mask[0]);*/ (ulong)mask[3], (ulong)mask[2], (ulong)mask[1], (ulong)mask[0]);
#endif
for(i=0; i < 8; i++ ) for(i=0; i < 8; i++ )
bits[i] &= mask[i]; bits[i] &= mask[i];
/*log_debug("bits=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX\n", #if 0
log_debug("bits=%08lX%08lX%08lX%08lX%08lX%08lX%08lX%08lX\n",
(ulong)bits[7], (ulong)bits[6], (ulong)bits[5], (ulong)bits[4], (ulong)bits[7], (ulong)bits[6], (ulong)bits[5], (ulong)bits[4],
(ulong)bits[3], (ulong)bits[2], (ulong)bits[1], (ulong)bits[0]);*/ (ulong)bits[3], (ulong)bits[2], (ulong)bits[1], (ulong)bits[0]);
#endif
} }
/* usable algorithms are now in bits /* usable algorithms are now in bits
* We now use the last key from pk_list to select * We now use the last key from pk_list to select
@ -635,6 +641,7 @@ select_algo_from_prefs( PK_LIST pk_list, int preftype )
if( pref[j] == preftype ) { if( pref[j] == preftype ) {
any = 1; any = 1;
if( (bits[pref[j+1]/32] & (1<<(pref[j+1]%32))) ) { if( (bits[pref[j+1]/32] & (1<<(pref[j+1]%32))) ) {
/* fixme: check whether this algoritm is available */
i = pref[j+1]; i = pref[j+1];
break; break;
} }
@ -644,11 +651,14 @@ select_algo_from_prefs( PK_LIST pk_list, int preftype )
if( !pref || !any ) { if( !pref || !any ) {
for(j=0; j < 256; j++ ) for(j=0; j < 256; j++ )
if( (bits[j/32] & (1<<(j%32))) ) { if( (bits[j/32] & (1<<(j%32))) ) {
/* fixme: check whether this algoritm is available */
i = j; i = j;
break; break;
} }
} }
/*log_debug("prefs of type %d: selected %d\n", preftype, i );*/ #if 0
log_debug("prefs of type %d: selected %d\n", preftype, i );
#endif
if( compr_hack && !i ) { if( compr_hack && !i ) {
/* selected no compression, but we should check whether /* selected no compression, but we should check whether
* algorithm 1 is also available (the ordering is not relevant * algorithm 1 is also available (the ordering is not relevant