diff options
Diffstat (limited to 'g10/sign.c')
-rw-r--r-- | g10/sign.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/g10/sign.c b/g10/sign.c index 61380d016..d1860b438 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -550,14 +550,22 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, if( fname && filenames->next && (!detached || encryptflag) ) log_bug("multiple files can only be detached signed"); - if(opt.expert && !opt.batch && !opt.force_v3_sigs && !old_style) + if(opt.expert && !opt.pgp2 && !opt.batch && + !opt.force_v3_sigs && !old_style) duration=ask_expire_interval(1); if( (rc=build_sk_list( locusr, &sk_list, 1, PUBKEY_USAGE_SIG )) ) goto leave; - if( !old_style && !duration ) + if( (!old_style && !duration) || opt.pgp2 ) old_style = only_old_style( sk_list ); + if(!old_style && opt.pgp2) + { + log_info(_("You can only sign with PGP 2.x style keys " + "while in --pgp2 mode\n")); + log_info(_("This message will not be usable by PGP 2.x\n")); + } + if( encryptflag ) { if( (rc=build_pk_list( remusr, &pk_list, PUBKEY_USAGE_ENC )) ) goto leave; @@ -719,14 +727,22 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile ) memset( &afx, 0, sizeof afx); init_packet( &pkt ); - if(opt.expert && !opt.batch && !opt.force_v3_sigs && !old_style) + if(opt.expert && !opt.pgp2 && !opt.batch && + !opt.force_v3_sigs && !old_style) duration=ask_expire_interval(1); if( (rc=build_sk_list( locusr, &sk_list, 1, PUBKEY_USAGE_SIG )) ) goto leave; - if( !old_style && !duration ) + if( (!old_style && !duration) || opt.pgp2 ) old_style = only_old_style( sk_list ); + if(!old_style && opt.pgp2) + { + log_info(_("You can only clearsign with PGP 2.x style keys " + "while in --pgp2 mode\n")); + log_info(_("This message will not be usable by PGP 2.x\n")); + } + /* prepare iobufs */ if( !(inp = iobuf_open(fname)) ) { log_error("can't open %s: %s\n", fname? fname: "[stdin]", |