diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2008-01-19 23:09:50 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2008-01-19 23:09:50 +0000 |
commit | 3e744a10e1472e5b4352b184e995652ab3ae24c5 (patch) | |
tree | ecc58aeb81068b5d7b1cdfa9e2dd08032549f7af /usr.bin | |
parent | ac521f13af4a20b40f857e80f24b940a280c74c1 (diff) |
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 'usr.bin')
-rw-r--r-- | usr.bin/ssh/readconf.c | 9 | ||||
-rw-r--r-- | usr.bin/ssh/readconf.h | 4 | ||||
-rw-r--r-- | usr.bin/ssh/sshconnect2.c | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index a642c6229c3..915d20876d8 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.164 2007/12/31 10:41:31 dtucker Exp $ */ +/* $OpenBSD: readconf.c,v 1.165 2008/01/19 23:09:49 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -494,7 +494,6 @@ parse_yesnoask: goto parse_int; case oRekeyLimit: - intptr = &options->rekey_limit; arg = strdelim(&s); if (!arg || *arg == '\0') fatal("%.200s line %d: Missing argument.", filename, linenum); @@ -522,14 +521,14 @@ parse_yesnoask: } val64 *= scale; /* detect integer wrap and too-large limits */ - if ((val64 / scale) != orig || val64 > INT_MAX) + if ((val64 / scale) != orig || val64 > UINT_MAX) fatal("%.200s line %d: RekeyLimit too large", filename, linenum); if (val64 < 16) fatal("%.200s line %d: RekeyLimit too small", filename, linenum); - if (*activep && *intptr == -1) - *intptr = (int)val64; + if (*activep && options->rekey_limit == -1) + options->rekey_limit = (u_int32_t)val64; break; case oIdentityFile: diff --git a/usr.bin/ssh/readconf.h b/usr.bin/ssh/readconf.h index d484f258ea5..6257f4b2f52 100644 --- a/usr.bin/ssh/readconf.h +++ b/usr.bin/ssh/readconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.h,v 1.71 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: readconf.h,v 1.72 2008/01/19 23:09:49 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -100,7 +100,7 @@ typedef struct { int clear_forwardings; int enable_ssh_keysign; - int rekey_limit; + int64_t rekey_limit; int no_host_authentication_for_localhost; int identities_only; int server_alive_interval; diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c index 05f2441f515..cbaecfff749 100644 --- a/usr.bin/ssh/sshconnect2.c +++ b/usr.bin/ssh/sshconnect2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.164 2007/05/17 23:53:41 jolan Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.165 2008/01/19 23:09:49 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -126,7 +126,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr) options.hostkeyalgorithms; if (options.rekey_limit) - packet_set_rekey_limit(options.rekey_limit); + packet_set_rekey_limit((u_int32_t)options.rekey_limit); /* start key exchange */ kex = kex_setup(myproposal); |