summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 1df5ce2d9..a10427086 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.105 2003/04/02 09:48:07 markus Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -114,7 +114,7 @@ typedef enum {
114 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 114 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
115 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 115 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
116 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 116 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
117 oEnableSSHKeysign, 117 oEnableSSHKeysign, oRekeyLimit,
118 oDeprecated 118 oDeprecated
119} OpCodes; 119} OpCodes;
120 120
@@ -188,6 +188,7 @@ static struct {
188 { "clearallforwardings", oClearAllForwardings }, 188 { "clearallforwardings", oClearAllForwardings },
189 { "enablesshkeysign", oEnableSSHKeysign }, 189 { "enablesshkeysign", oEnableSSHKeysign },
190 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 190 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
191 { "rekeylimit", oRekeyLimit },
191 { NULL, oBadOption } 192 { NULL, oBadOption }
192}; 193};
193 194
@@ -423,6 +424,31 @@ parse_flag:
423 intptr = &options->compression_level; 424 intptr = &options->compression_level;
424 goto parse_int; 425 goto parse_int;
425 426
427 case oRekeyLimit:
428 intptr = &options->rekey_limit;
429 arg = strdelim(&s);
430 if (!arg || *arg == '\0')
431 fatal("%.200s line %d: Missing argument.", filename, linenum);
432 if (arg[0] < '0' || arg[0] > '9')
433 fatal("%.200s line %d: Bad number.", filename, linenum);
434 value = strtol(arg, &endofnumber, 10);
435 if (arg == endofnumber)
436 fatal("%.200s line %d: Bad number.", filename, linenum);
437 switch (toupper(*endofnumber)) {
438 case 'K':
439 value *= 1<<10;
440 break;
441 case 'M':
442 value *= 1<<20;
443 break;
444 case 'G':
445 value *= 1<<30;
446 break;
447 }
448 if (*activep && *intptr == -1)
449 *intptr = value;
450 break;
451
426 case oIdentityFile: 452 case oIdentityFile:
427 arg = strdelim(&s); 453 arg = strdelim(&s);
428 if (!arg || *arg == '\0') 454 if (!arg || *arg == '\0')
@@ -795,6 +821,7 @@ initialize_options(Options * options)
795 options->smartcard_device = NULL; 821 options->smartcard_device = NULL;
796 options->enable_ssh_keysign = - 1; 822 options->enable_ssh_keysign = - 1;
797 options->no_host_authentication_for_localhost = - 1; 823 options->no_host_authentication_for_localhost = - 1;
824 options->rekey_limit = - 1;
798} 825}
799 826
800/* 827/*
@@ -911,6 +938,8 @@ fill_default_options(Options * options)
911 options->no_host_authentication_for_localhost = 0; 938 options->no_host_authentication_for_localhost = 0;
912 if (options->enable_ssh_keysign == -1) 939 if (options->enable_ssh_keysign == -1)
913 options->enable_ssh_keysign = 0; 940 options->enable_ssh_keysign = 0;
941 if (options->rekey_limit == -1)
942 options->rekey_limit = 0;
914 /* options->proxy_command should not be set by default */ 943 /* options->proxy_command should not be set by default */
915 /* options->user will be set in the main program if appropriate */ 944 /* options->user will be set in the main program if appropriate */
916 /* options->hostname will be set in the main program if appropriate */ 945 /* options->hostname will be set in the main program if appropriate */