summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2016-01-29 02:54:45 +0000
committerDamien Miller <djm@mindrot.org>2016-01-30 11:19:13 +1100
commit921ff00b0ac429666fb361d2d6cb1c8fff0006cb (patch)
tree555f5a0348185ea84bdf43a298d8811390233cc7 /readconf.c
parentc0060a65296f01d4634f274eee184c0e93ba0f23 (diff)
upstream commit
Allow RekeyLimits in excess of 4G up to 2**63 bits (limited by the return type of scan_scaled). Part of bz#2521, ok djm. Upstream-ID: 13bea82be566b9704821b1ea05bf7804335c7979
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/readconf.c b/readconf.c
index 8e9a25da7..2a5620479 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.248 2016/01/14 16:17:40 markus Exp $ */ 1/* $OpenBSD: readconf.c,v 1.249 2016/01/29 02:54:45 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -976,16 +976,12 @@ parse_time:
976 if (scan_scaled(arg, &val64) == -1) 976 if (scan_scaled(arg, &val64) == -1)
977 fatal("%.200s line %d: Bad number '%s': %s", 977 fatal("%.200s line %d: Bad number '%s': %s",
978 filename, linenum, arg, strerror(errno)); 978 filename, linenum, arg, strerror(errno));
979 /* check for too-large or too-small limits */
980 if (val64 > UINT_MAX)
981 fatal("%.200s line %d: RekeyLimit too large",
982 filename, linenum);
983 if (val64 != 0 && val64 < 16) 979 if (val64 != 0 && val64 < 16)
984 fatal("%.200s line %d: RekeyLimit too small", 980 fatal("%.200s line %d: RekeyLimit too small",
985 filename, linenum); 981 filename, linenum);
986 } 982 }
987 if (*activep && options->rekey_limit == -1) 983 if (*activep && options->rekey_limit == -1)
988 options->rekey_limit = (u_int32_t)val64; 984 options->rekey_limit = val64;
989 if (s != NULL) { /* optional rekey interval present */ 985 if (s != NULL) { /* optional rekey interval present */
990 if (strcmp(s, "none") == 0) { 986 if (strcmp(s, "none") == 0) {
991 (void)strdelim(&s); /* discard */ 987 (void)strdelim(&s); /* discard */
@@ -2436,8 +2432,8 @@ dump_client_config(Options *o, const char *host)
2436 printf("%s\n", iptos2str(o->ip_qos_bulk)); 2432 printf("%s\n", iptos2str(o->ip_qos_bulk));
2437 2433
2438 /* oRekeyLimit */ 2434 /* oRekeyLimit */
2439 printf("rekeylimit %lld %d\n", 2435 printf("rekeylimit %llu %d\n",
2440 (long long)o->rekey_limit, o->rekey_interval); 2436 (unsigned long long)o->rekey_limit, o->rekey_interval);
2441 2437
2442 /* oStreamLocalBindMask */ 2438 /* oStreamLocalBindMask */
2443 printf("streamlocalbindmask 0%o\n", 2439 printf("streamlocalbindmask 0%o\n",