From 63a71c1ff9f016c925740e96733c15bcd006b475 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 6 Aug 2002 17:57:53 +0000 Subject: [PATCH] * options.h, g10.c (main), mainproc.c (proc_encrypted): --ignore-mdc-error option to turn a MDC check error into a warning. --- g10/ChangeLog | 4 ++++ g10/encode.c | 2 +- g10/g10.c | 3 +++ g10/mainproc.c | 4 ++-- g10/options.h | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 11e407bf2..704064d00 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,9 @@ 2002-08-06 David Shaw + * options.h, g10.c (main), mainproc.c (proc_encrypted): + --ignore-mdc-error option to turn a MDC check error into a + warning. + * encode.c (encode_crypt), g10.c (main), sign.c (sign_file, clearsign_file): Use the same --pgpX warning string everywhere to ease translations. diff --git a/g10/encode.c b/g10/encode.c index abc25c9ca..87289cf77 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -630,7 +630,7 @@ write_pubkey_enc_from_list( PK_LIST pk_list, DEK *dek, IOBUF out ) if(opt.throw_keyid && (opt.pgp2 || opt.pgp6 || opt.pgp7)) { log_info(_("you may not use %s while in %s mode\n"), - "throw-keyid", + "--throw-keyid", opt.pgp2?"--pgp2":opt.pgp6?"--pgp6":"--pgp7"); log_info(_("this message may not be usable by %s\n"), diff --git a/g10/g10.c b/g10/g10.c index ab9f6481f..c92d834d3 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -266,6 +266,7 @@ enum cmd_and_opt_values { aNull = 0, oIgnoreTimeConflict, oIgnoreValidFrom, oIgnoreCrcError, + oIgnoreMDCError, oShowSessionKey, oOverrideSessionKey, oNoRandomSeedFile, @@ -555,6 +556,7 @@ static ARGPARSE_OPTS opts[] = { { oIgnoreTimeConflict, "ignore-time-conflict", 0, "@" }, { oIgnoreValidFrom, "ignore-valid-from", 0, "@" }, { oIgnoreCrcError, "ignore-crc-error", 0,"@" }, + { oIgnoreMDCError, "ignore-mdc-error", 0,"@" }, { oShowSessionKey, "show-session-key", 0, "@" }, { oOverrideSessionKey, "override-session-key", 2, "@" }, { oNoRandomSeedFile, "no-random-seed-file", 0, "@" }, @@ -1420,6 +1422,7 @@ main( int argc, char **argv ) case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break; case oIgnoreValidFrom: opt.ignore_valid_from = 1; break; case oIgnoreCrcError: opt.ignore_crc_error = 1; break; + case oIgnoreMDCError: opt.ignore_mdc_error = 1; break; case oNoRandomSeedFile: use_random_seed = 0; break; case oAutoKeyRetrieve: case oNoAutoKeyRetrieve: diff --git a/g10/mainproc.c b/g10/mainproc.c index 2004da1c7..38aaac0d9 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -492,11 +492,11 @@ proc_encrypted( CTX c, PACKET *pkt ) m_free(c->dek); c->dek = NULL; if( result == -1 ) ; - else if( !result ) { + else if( !result || (result==G10ERR_BAD_SIGN && opt.ignore_mdc_error)) { write_status( STATUS_DECRYPTION_OKAY ); if( opt.verbose > 1 ) log_info(_("decryption okay\n")); - if( pkt->pkt.encrypted->mdc_method ) + if( pkt->pkt.encrypted->mdc_method && !result ) write_status( STATUS_GOODMDC ); else if(!opt.no_mdc_warn) log_info ("WARNING: message was not integrity protected\n"); diff --git a/g10/options.h b/g10/options.h index 814880360..3e7982588 100644 --- a/g10/options.h +++ b/g10/options.h @@ -161,6 +161,7 @@ struct { int ignore_time_conflict; int ignore_valid_from; int ignore_crc_error; + int ignore_mdc_error; int command_fd; const char *override_session_key; int show_session_key;