diff options
author | Werner Koch <wk@gnupg.org> | 2015-10-12 09:31:44 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-10-12 09:31:44 +0200 |
commit | 4584125802be11833a5b289e864b45eedc2b45fd (patch) | |
tree | c9c1196c84f70b0bfc69a50adfe216da06c30408 /g10/sign.c | |
parent | Post release updates. (diff) | |
download | gnupg2-4584125802be11833a5b289e864b45eedc2b45fd.tar.xz gnupg2-4584125802be11833a5b289e864b45eedc2b45fd.zip |
gpg: Try hard to use MDC also for sign+symenc.
* g10/encrypt.c (use_mdc): Make it a global func.
* g10/sign.c (sign_symencrypt_file): Use that function to decide
whether to use an MDC.
* tests/openpgp/conventional-mdc.test: Add a simple test case.
--
We used --force-mdc in sign+symenc mode (-cs) only with --force-mdc.
That broke our assumption from commit 625e292 (GnuPG 2.1.9) that all
uses of modern ciphers are using MDC.
Reported-by: Ben Kibbey <bjk@luxsci.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/sign.c')
-rw-r--r-- | g10/sign.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/g10/sign.c b/g10/sign.c index 782b9fcfa..fadf4ccb5 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -1261,12 +1261,7 @@ sign_symencrypt_file (const char *fname, strlist_t locusr) goto leave; } - /* We have no way to tell if the recipient can handle messages - with an MDC, so this defaults to no. Perhaps in a few years, - this can be defaulted to yes. Note that like regular - encrypting, --force-mdc overrides --disable-mdc. */ - if(opt.force_mdc) - cfx.dek->use_mdc=1; + cfx.dek->use_mdc = use_mdc (NULL, cfx.dek->algo); /* now create the outfile */ rc = open_outfile (-1, fname, opt.armor? 1:0, 0, &out); @@ -1309,7 +1304,11 @@ sign_symencrypt_file (const char *fname, strlist_t locusr) /* Push the compress filter */ if (default_compress_algo()) - push_compress_filter(out,&zfx,default_compress_algo()); + { + if (cfx.dek && cfx.dek->use_mdc) + zfx.new_ctb = 1; + push_compress_filter (out, &zfx,default_compress_algo() ); + } /* Write the one-pass signature packets */ /*(current filters: zip - encrypt - armor)*/ |