version 1.9, 2000/06/18 01:09:10 |
version 1.10, 2000/06/18 04:05:02 |
|
|
|
|
#include "dsa.h" |
#include "dsa.h" |
#include "uidswap.h" |
#include "uidswap.h" |
|
#include "auth-options.h" |
|
|
/* import */ |
/* import */ |
extern ServerOptions options; |
extern ServerOptions options; |
|
|
found = key_new(KEY_DSA); |
found = key_new(KEY_DSA); |
|
|
while (fgets(line, sizeof(line), f)) { |
while (fgets(line, sizeof(line), f)) { |
char *cp; |
char *cp, *options = NULL; |
linenum++; |
linenum++; |
/* Skip leading whitespace, empty and comment lines. */ |
/* Skip leading whitespace, empty and comment lines. */ |
for (cp = line; *cp == ' ' || *cp == '\t'; cp++) |
for (cp = line; *cp == ' ' || *cp == '\t'; cp++) |
; |
; |
if (!*cp || *cp == '\n' || *cp == '#') |
if (!*cp || *cp == '\n' || *cp == '#') |
continue; |
continue; |
|
|
bits = key_read(found, &cp); |
bits = key_read(found, &cp); |
if (bits == 0) |
if (bits == 0) { |
continue; |
/* no key? check if there are options for this key */ |
if (key_equal(found, key)) { |
int quoted = 0; |
|
options = cp; |
|
for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { |
|
if (*cp == '\\' && cp[1] == '"') |
|
cp++; /* Skip both */ |
|
else if (*cp == '"') |
|
quoted = !quoted; |
|
} |
|
/* Skip remaining whitespace. */ |
|
for (; *cp == ' ' || *cp == '\t'; cp++) |
|
; |
|
bits = key_read(found, &cp); |
|
if (bits == 0) { |
|
/* still no key? advance to next line*/ |
|
continue; |
|
} |
|
} |
|
if (key_equal(found, key) && |
|
auth_parse_options(pw, options, linenum) == 1) { |
found_key = 1; |
found_key = 1; |
debug("matching key found: file %s, line %ld", |
debug("matching key found: file %s, line %ld", |
file, linenum); |
file, linenum); |