diff --git a/g10/ChangeLog b/g10/ChangeLog index 1989b8f29..f74f93be2 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +Wed Jun 7 17:25:38 CEST 2000 Werner Koch + + * cipher.c (write_header): Use plain CFB mode for MDC encrypted packets. + * encr-data.c (decrypt_data): Ditto. + Mon Jun 5 23:41:54 CEST 2000 Werner Koch * seskey.c (do_encode_md, encode_md_value): Add new arg v3compathack to work diff --git a/g10/cipher.c b/g10/cipher.c index 0bed51300..344e2b7b6 100644 --- a/g10/cipher.c +++ b/g10/cipher.c @@ -75,7 +75,9 @@ write_header( cipher_filter_context_t *cfx, IOBUF a ) temp[nprefix] = temp[nprefix-2]; temp[nprefix+1] = temp[nprefix-1]; print_cipher_algo_note( cfx->dek->algo ); - cfx->cipher_hd = cipher_open( cfx->dek->algo, CIPHER_MODE_AUTO_CFB, 1 ); + cfx->cipher_hd = cipher_open( cfx->dek->algo, + use_mdc? CIPHER_MODE_CFB + : CIPHER_MODE_AUTO_CFB, 1 ); /* log_hexdump( "thekey", cfx->dek->key, cfx->dek->keylen );*/ cipher_setkey( cfx->cipher_hd, cfx->dek->key, cfx->dek->keylen ); cipher_setiv( cfx->cipher_hd, NULL, 0 ); diff --git a/g10/encr-data.c b/g10/encr-data.c index c584f49d3..3d43c5752 100644 --- a/g10/encr-data.c +++ b/g10/encr-data.c @@ -80,7 +80,9 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek ) dfx.mdc_hash = md_open( ed->mdc_method, 0 ); /*md_start_debug(dfx.mdc_hash, "checkmdc");*/ } - dfx.cipher_hd = cipher_open( dek->algo, CIPHER_MODE_AUTO_CFB, 1 ); + dfx.cipher_hd = cipher_open( dek->algo, + ed->mdc_method? CIPHER_MODE_CFB + : CIPHER_MODE_AUTO_CFB, 1 ); /* log_hexdump( "thekey", dek->key, dek->keylen );*/ rc = cipher_setkey( dfx.cipher_hd, dek->key, dek->keylen ); if( rc == G10ERR_WEAK_KEY )