aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index a74c9a2f2..9bc18777e 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1697,12 +1697,18 @@ ask_expire_interval(u32 timestamp,int object,const char *def_expire)
? _("Key expires at %s\n")
: _("Signature expires at %s\n"),
asctimestamp((ulong)(timestamp + interval) ) );
- /* FIXME: This check yields warning on alhas: Write a
- configure check and to this check here only for 32 bit
- machines */
- if( (time_t)((ulong)(timestamp+interval)) < 0 )
- tty_printf(_("Your system can't display dates beyond 2038.\n"
- "However, it will be correctly handled up to 2106.\n"));
+#if SIZEOF_TIME_T <= 4
+ if ((time_t)((ulong)(timestamp+interval)) < 0 )
+ tty_printf (_("Your system can't display dates beyond 2038.\n"
+ "However, it will be correctly handled up to"
+ " 2106.\n"));
+ else
+#endif /*SIZEOF_TIME_T*/
+ if ( (time_t)((unsigned long)(timestamp+interval)) < timestamp )
+ {
+ tty_printf (_("invalid value\n"));
+ continue;
+ }
}
if( cpr_enabled() || cpr_get_answer_is_yes("keygen.valid.okay",