summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/hostfile.c b/hostfile.c
index 831ac592f..ea92fa048 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -14,13 +14,13 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: hostfile.c,v 1.11 2000/01/04 00:07:59 markus Exp $"); 17RCSID("$OpenBSD: hostfile.c,v 1.13 2000/02/18 10:20:20 markus Exp $");
18 18
19#include "packet.h" 19#include "packet.h"
20#include "ssh.h" 20#include "ssh.h"
21 21
22/* 22/*
23 * Reads a multiple-precision integer in hex from the buffer, and advances 23 * Reads a multiple-precision integer in decimal from the buffer, and advances
24 * the pointer. The integer must already be initialized. This function is 24 * the pointer. The integer must already be initialized. This function is
25 * permitted to modify the buffer. This leaves *cpp to point just beyond the 25 * permitted to modify the buffer. This leaves *cpp to point just beyond the
26 * last processed (and maybe modified) character. Note that this may modify 26 * last processed (and maybe modified) character. Note that this may modify
@@ -31,26 +31,23 @@ int
31auth_rsa_read_bignum(char **cpp, BIGNUM * value) 31auth_rsa_read_bignum(char **cpp, BIGNUM * value)
32{ 32{
33 char *cp = *cpp; 33 char *cp = *cpp;
34 int len, old; 34 int old;
35 35
36 /* Skip any leading whitespace. */ 36 /* Skip any leading whitespace. */
37 for (; *cp == ' ' || *cp == '\t'; cp++) 37 for (; *cp == ' ' || *cp == '\t'; cp++)
38 ; 38 ;
39 39
40 /* Check that it begins with a hex digit. */ 40 /* Check that it begins with a decimal digit. */
41 if (*cp < '0' || *cp > '9') 41 if (*cp < '0' || *cp > '9')
42 return 0; 42 return 0;
43 43
44 /* Save starting position. */ 44 /* Save starting position. */
45 *cpp = cp; 45 *cpp = cp;
46 46
47 /* Move forward until all hex digits skipped. */ 47 /* Move forward until all decimal digits skipped. */
48 for (; *cp >= '0' && *cp <= '9'; cp++) 48 for (; *cp >= '0' && *cp <= '9'; cp++)
49 ; 49 ;
50 50
51 /* Compute the length of the hex number. */
52 len = cp - *cpp;
53
54 /* Save the old terminating character, and replace it by \0. */ 51 /* Save the old terminating character, and replace it by \0. */
55 old = *cp; 52 old = *cp;
56 *cp = 0; 53 *cp = 0;
@@ -179,7 +176,7 @@ check_host_in_hostfile(const char *filename, const char *host,
179 FILE *f; 176 FILE *f;
180 char line[8192]; 177 char line[8192];
181 int linenum = 0; 178 int linenum = 0;
182 unsigned int bits, kbits, hostlen; 179 unsigned int kbits, hostlen;
183 char *cp, *cp2; 180 char *cp, *cp2;
184 HostStatus end_return; 181 HostStatus end_return;
185 182
@@ -198,9 +195,6 @@ check_host_in_hostfile(const char *filename, const char *host,
198 */ 195 */
199 end_return = HOST_NEW; 196 end_return = HOST_NEW;
200 197
201 /* size of modulus 'n' */
202 bits = BN_num_bits(n);
203
204 /* Go trough the file. */ 198 /* Go trough the file. */
205 while (fgets(line, sizeof(line), f)) { 199 while (fgets(line, sizeof(line), f)) {
206 cp = line; 200 cp = line;