diff options
author | Werner Koch <wk@gnupg.org> | 2016-07-13 13:31:12 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-07-13 13:31:12 +0200 |
commit | e148c3caa90fbadba32bdbfea9513392e3aea598 (patch) | |
tree | fff3a49be5c2659ab87195e5b0a4f88e51a49205 /g10/encrypt.c | |
parent | wks: Use correct key for the confirmation (diff) | |
download | gnupg2-e148c3caa90fbadba32bdbfea9513392e3aea598.tar.xz gnupg2-e148c3caa90fbadba32bdbfea9513392e3aea598.zip |
gpg: New option --mimemode.
* g10/gpg.c (oMimemode): New.
(opts): Add --mimemode.
(main): Use --mimemode only in rfc4880bis compliance mode.
* g10/options.h (struct opt): Add field "mimemode".
* g10/build-packet.c (do_plaintext): Allow for mode 'm'.
* g10/encrypt.c (encrypt_simple, encrypt_crypt): Use 'm' if requested.
* g10/plaintext.c (handle_plaintext): Handle 'm' mode.
* g10/sign.c (write_plaintext_packet): Handle 'm' mode.
(sign_file, sign_symencrypt_file): Use 'm' if requested.
--
Thsi patch prepares for a proposed change in RFC4880bis to support a
MIME flag. A literal data packet with the mime flag set is handled
like a 't' or 'u' but CR are not removed. The PLAINTEXT status line
will also indicate a MIME content.
If --mimemode is used without --rfc4880bis 't' will be used.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r-- | g10/encrypt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c index 57d24bef1..54a17c31e 100644 --- a/g10/encrypt.c +++ b/g10/encrypt.c @@ -335,7 +335,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey) { /* Note that PT has been initialized above in !no_literal mode. */ pt->timestamp = make_timestamp(); - pt->mode = opt.textmode? 't' : 'b'; + pt->mode = opt.mimemode? 'm' : opt.textmode? 't' : 'b'; pt->len = filesize; pt->new_ctb = !pt->len; pt->buf = inp; @@ -674,7 +674,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename, if (!opt.no_literal) { pt->timestamp = make_timestamp(); - pt->mode = opt.textmode ? 't' : 'b'; + pt->mode = opt.mimemode? 'm' : opt.textmode ? 't' : 'b'; pt->len = filesize; pt->new_ctb = !pt->len; pt->buf = inp; |