summaryrefslogtreecommitdiff
path: root/servconf.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 /servconf.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 'servconf.c')
-rw-r--r--servconf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/servconf.c b/servconf.c
index 19c68e2d7..7bee5a17a 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.283 2015/11/13 04:38:06 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.284 2016/01/29 02:54:45 dtucker Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -1330,16 +1330,12 @@ process_server_config_line(ServerOptions *options, char *line,
1330 if (scan_scaled(arg, &val64) == -1) 1330 if (scan_scaled(arg, &val64) == -1)
1331 fatal("%.200s line %d: Bad number '%s': %s", 1331 fatal("%.200s line %d: Bad number '%s': %s",
1332 filename, linenum, arg, strerror(errno)); 1332 filename, linenum, arg, strerror(errno));
1333 /* check for too-large or too-small limits */
1334 if (val64 > UINT_MAX)
1335 fatal("%.200s line %d: RekeyLimit too large",
1336 filename, linenum);
1337 if (val64 != 0 && val64 < 16) 1333 if (val64 != 0 && val64 < 16)
1338 fatal("%.200s line %d: RekeyLimit too small", 1334 fatal("%.200s line %d: RekeyLimit too small",
1339 filename, linenum); 1335 filename, linenum);
1340 } 1336 }
1341 if (*activep && options->rekey_limit == -1) 1337 if (*activep && options->rekey_limit == -1)
1342 options->rekey_limit = (u_int32_t)val64; 1338 options->rekey_limit = val64;
1343 if (cp != NULL) { /* optional rekey interval present */ 1339 if (cp != NULL) { /* optional rekey interval present */
1344 if (strcmp(cp, "none") == 0) { 1340 if (strcmp(cp, "none") == 0) {
1345 (void)strdelim(&cp); /* discard */ 1341 (void)strdelim(&cp); /* discard */
@@ -2361,7 +2357,7 @@ dump_config(ServerOptions *o)
2361 printf("ipqos %s ", iptos2str(o->ip_qos_interactive)); 2357 printf("ipqos %s ", iptos2str(o->ip_qos_interactive));
2362 printf("%s\n", iptos2str(o->ip_qos_bulk)); 2358 printf("%s\n", iptos2str(o->ip_qos_bulk));
2363 2359
2364 printf("rekeylimit %lld %d\n", (long long)o->rekey_limit, 2360 printf("rekeylimit %llu %d\n", (unsigned long long)o->rekey_limit,
2365 o->rekey_interval); 2361 o->rekey_interval);
2366 2362
2367 channel_print_adm_permitted_opens(); 2363 channel_print_adm_permitted_opens();