1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* encode.c (encode_simple): Fix problem with using compression algo 2 and

symmetric compressed files.

* encode.c (encode_simple, encode_crypt): If we are not using a MDC,
compress even if a file is already compressed.  This is to help against
the chosen ciphertext attack.

* pkclist.c (select_algo_from_prefs): Fix requested algorithm bug so the
request succeeds even if the requested algorithm is not the first found.

* cipher.c (write_header), encode.c (use_mdc, encode_simple, encode_crypt,
encrypt_filter), g10.c (main): Be more eager to use a MDC.  We use a MDC
if the keys directly support it, if the keys list AES (any) or TWOFISH
anywhere in the prefs, or if the cipher chosen does not have a 64 bit
blocksize.
This commit is contained in:
David Shaw 2002-08-13 19:00:23 +00:00
parent d1f6ccd154
commit 1111da19a8
5 changed files with 114 additions and 47 deletions

View file

@ -1159,6 +1159,11 @@ select_algo_from_prefs(PK_LIST pk_list, int preftype, int request, void *hint)
i = -1;
any = 0;
/* Can we use the requested algorithm? */
if(request>-1 && (bits[request/32] & (1<<(request%32))) &&
algo_available(preftype,request,hint))
return request;
/* If we have personal prefs set, use them instead of the last key */
if(preftype==PREFTYPE_SYM && opt.personal_cipher_prefs)
prefs=opt.personal_cipher_prefs;
@ -1190,10 +1195,6 @@ select_algo_from_prefs(PK_LIST pk_list, int preftype, int request, void *hint)
}
}
/* Can we use the requested algorithm? */
if(request>-1 && request==i)
return i;
#if 0
log_debug("prefs of type %d: selected %d\n", preftype, i );
#endif