aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2005-05-05 19:21:40 +0000
committerDavid Shaw <[email protected]>2005-05-05 19:21:40 +0000
commitc71639cfffc8796d3109afff1340cd8fac1504f6 (patch)
treed8bfb2c6bc946b9e3ae62f62506f17efce152680 /g10/sign.c
parent* gpg.sgml: Clarify --min-cert-level a bit. (diff)
downloadgnupg-c71639cfffc8796d3109afff1340cd8fac1504f6.tar.gz
gnupg-c71639cfffc8796d3109afff1340cd8fac1504f6.zip
* options.h, g10.c (main): Add new --default-sig-expire and
--default-cert-expire options. Suggested by Florian Weimer. * main.h, keygen.c (parse_expire_string, ask_expire_interval): Use defaults passed in, or "0" to control what default expiration is. * keyedit.c (sign_uids), sign.c (sign_file, clearsign_file, sign_symencrypt_file): Call them here, so that default expiration is used when --ask-xxxxx-expire is off.
Diffstat (limited to '')
-rw-r--r--g10/sign.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/g10/sign.c b/g10/sign.c
index c65b8275e..d3df1bf60 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -1,6 +1,6 @@
/* sign.c - sign data
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
- * 2004 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -744,8 +744,13 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
&& (rc=setup_symkey(&efx.symkey_s2k,&efx.symkey_dek)))
goto leave;
- if(opt.ask_sig_expire && !opt.force_v3_sigs && !opt.batch && !RFC1991)
- duration=ask_expire_interval(1);
+ if(!opt.force_v3_sigs && !opt.batch && !RFC1991)
+ {
+ if(opt.ask_sig_expire)
+ duration=ask_expire_interval(1,opt.def_sig_expire);
+ else
+ duration=parse_expire_string(opt.def_sig_expire)*86400L;
+ }
if( (rc=build_sk_list( locusr, &sk_list, 1, PUBKEY_USAGE_SIG )) )
goto leave;
@@ -1009,8 +1014,13 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
memset( &afx, 0, sizeof afx);
init_packet( &pkt );
- if(opt.ask_sig_expire && !opt.force_v3_sigs && !opt.batch && !RFC1991)
- duration=ask_expire_interval(1);
+ if(!opt.force_v3_sigs && !opt.batch && !RFC1991)
+ {
+ if(opt.ask_sig_expire)
+ duration=ask_expire_interval(1,opt.def_sig_expire);
+ else
+ duration=parse_expire_string(opt.def_sig_expire)*86400L;
+ }
if( (rc=build_sk_list( locusr, &sk_list, 1, PUBKEY_USAGE_SIG )) )
goto leave;
@@ -1163,8 +1173,13 @@ sign_symencrypt_file (const char *fname, STRLIST locusr)
memset( &cfx, 0, sizeof cfx);
init_packet( &pkt );
- if(opt.ask_sig_expire && !opt.force_v3_sigs && !opt.batch && !RFC1991)
- duration=ask_expire_interval(1);
+ if(!opt.force_v3_sigs && !opt.batch && !RFC1991)
+ {
+ if(opt.ask_sig_expire)
+ duration=ask_expire_interval(1,opt.def_sig_expire);
+ else
+ duration=parse_expire_string(opt.def_sig_expire)*86400L;
+ }
rc = build_sk_list (locusr, &sk_list, 1, PUBKEY_USAGE_SIG);
if (rc)