version 1.4.2.2, 2004/08/19 22:37:30 |
version 1.5, 2003/11/04 08:54:09 |
|
|
authenticated = 0; |
authenticated = 0; |
if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && |
if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && |
PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), |
PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), |
buffer_len(&b))) == 1) |
buffer_len(&b))) == 1) |
authenticated = 1; |
authenticated = 1; |
buffer_free(&b); |
buffer_clear(&b); |
xfree(sig); |
xfree(sig); |
} else { |
} else { |
debug("test whether pkalg/pkblob are acceptable"); |
debug("test whether pkalg/pkblob are acceptable"); |
|
|
found = key_new(key->type); |
found = key_new(key->type); |
|
|
while (fgets(line, sizeof(line), f)) { |
while (fgets(line, sizeof(line), f)) { |
char *cp, *key_options = NULL; |
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++) |
|
|
/* no key? check if there are options for this key */ |
/* no key? check if there are options for this key */ |
int quoted = 0; |
int quoted = 0; |
debug2("user_key_allowed: check options: '%s'", cp); |
debug2("user_key_allowed: check options: '%s'", cp); |
key_options = cp; |
options = cp; |
for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { |
for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { |
if (*cp == '\\' && cp[1] == '"') |
if (*cp == '\\' && cp[1] == '"') |
cp++; /* Skip both */ |
cp++; /* Skip both */ |
|
|
} |
} |
} |
} |
if (key_equal(found, key) && |
if (key_equal(found, key) && |
auth_parse_options(pw, key_options, file, linenum) == 1) { |
auth_parse_options(pw, options, file, linenum) == 1) { |
found_key = 1; |
found_key = 1; |
debug("matching key found: file %s, line %lu", |
debug("matching key found: file %s, line %lu", |
file, linenum); |
file, linenum); |