aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-12-09 13:33:50 +0000
committerJustus Winter <[email protected]>2016-12-09 13:38:31 +0000
commitd568a1561642ed9b7b7b6282b86c56786d10a956 (patch)
tree78e6e17740c053061fbabd638c031176ce4b5d77
parenttests: Add a test for '--quick-addkey'. (diff)
downloadgnupg-d568a1561642ed9b7b7b6282b86c56786d10a956.tar.gz
gnupg-d568a1561642ed9b7b7b6282b86c56786d10a956.zip
g10: Create keys that expire in simple key generation mode.
* g10/keygen.c (default_expiration_interval): New variable. (generate_keypair): Use the new default. -- Cursory discussion on gnupg-devel@ suggested two years as a good default expiration interval. GnuPG-bug-id: 2701 Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--g10/keygen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index ad96cdd43..ebb2d7027 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -53,6 +53,10 @@
#define DEFAULT_STD_KEY_PARAM "rsa2048/cert,sign+rsa2048/encr"
#define FUTURE_STD_KEY_PARAM "ed25519/cert,sign+cv25519/encr"
+/* When generating keys using the streamlined key generation dialog,
+ use this as a default expiration interval. */
+const char *default_expiration_interval = "2y";
+
/* Flag bits used during key generation. */
#define KEYGEN_FLAG_NO_PROTECTION 1
#define KEYGEN_FLAG_TRANSIENT_KEY 2
@@ -4306,7 +4310,8 @@ generate_keypair (ctrl_t ctrl, int full, const char *fname,
}
- expire = full? ask_expire_interval (0, NULL) : 0;
+ expire = full? ask_expire_interval (0, NULL)
+ : parse_expire_string (default_expiration_interval);
r = xcalloc (1, sizeof *r + 20);
r->key = pKEYEXPIRE;
r->u.expire = expire;