summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-02-10 22:25:52 +1100
committerDamien Miller <djm@mindrot.org>2008-02-10 22:25:52 +1100
commit3dff176ed9509b5bd92947b9504545495a2052cc (patch)
treefbd3f0d740ebd8e9c00ce2d4a621d416c49cb985 /readconf.c
parent3de49f8951d8ea4401b0a8ec053fd51d6f309cbe (diff)
- djm@cvs.openbsd.org 2008/01/19 23:09:49
[readconf.c readconf.h sshconnect2.c] promote rekeylimit to a int64 so it can hold the maximum useful limit of 2^32; report and patch from Jan.Pechanec AT Sun.COM, ok dtucker@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/readconf.c b/readconf.c
index 1d6409fdb..3ddb4d392 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.164 2007/12/31 10:41:31 dtucker Exp $ */ 1/* $OpenBSD: readconf.c,v 1.165 2008/01/19 23:09:49 djm 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
@@ -499,7 +499,6 @@ parse_yesnoask:
499 goto parse_int; 499 goto parse_int;
500 500
501 case oRekeyLimit: 501 case oRekeyLimit:
502 intptr = &options->rekey_limit;
503 arg = strdelim(&s); 502 arg = strdelim(&s);
504 if (!arg || *arg == '\0') 503 if (!arg || *arg == '\0')
505 fatal("%.200s line %d: Missing argument.", filename, linenum); 504 fatal("%.200s line %d: Missing argument.", filename, linenum);
@@ -527,14 +526,14 @@ parse_yesnoask:
527 } 526 }
528 val64 *= scale; 527 val64 *= scale;
529 /* detect integer wrap and too-large limits */ 528 /* detect integer wrap and too-large limits */
530 if ((val64 / scale) != orig || val64 > INT_MAX) 529 if ((val64 / scale) != orig || val64 > UINT_MAX)
531 fatal("%.200s line %d: RekeyLimit too large", 530 fatal("%.200s line %d: RekeyLimit too large",
532 filename, linenum); 531 filename, linenum);
533 if (val64 < 16) 532 if (val64 < 16)
534 fatal("%.200s line %d: RekeyLimit too small", 533 fatal("%.200s line %d: RekeyLimit too small",
535 filename, linenum); 534 filename, linenum);
536 if (*activep && *intptr == -1) 535 if (*activep && options->rekey_limit == -1)
537 *intptr = (int)val64; 536 options->rekey_limit = (u_int32_t)val64;
538 break; 537 break;
539 538
540 case oIdentityFile: 539 case oIdentityFile: