]> andersk Git - openssh.git/blobdiff - auth2-pubkey.c
- (tim) [contrib/cygwin/README] add minires-devel requirement. Patch from
[openssh.git] / auth2-pubkey.c
index 8c5436e359fce50916cbf51c6ad0e3095bab7e8f..9898d4a63b8c4fd907f7bad58c99e014bf40a6e5 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-pubkey.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
+RCSID("$OpenBSD: auth2-pubkey.c,v 1.7 2004/06/21 17:36:31 avsm Exp $");
 
 #include "ssh2.h"
 #include "xmalloc.h"
@@ -44,7 +44,7 @@ RCSID("$OpenBSD: auth2-pubkey.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
 /* import */
 extern ServerOptions options;
 extern u_char *session_id2;
-extern int session_id2_len;
+extern u_int session_id2_len;
 
 static int
 userauth_pubkey(Authctxt *authctxt)
@@ -123,9 +123,9 @@ userauth_pubkey(Authctxt *authctxt)
                authenticated = 0;
                if (PRIVSEP(user_key_allowed(authctxt->pw, key)) &&
                    PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b),
-                               buffer_len(&b))) == 1)
+                   buffer_len(&b))) == 1)
                        authenticated = 1;
-               buffer_clear(&b);
+               buffer_free(&b);
                xfree(sig);
        } else {
                debug("test whether pkalg/pkblob are acceptable");
@@ -175,9 +175,6 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
        Key *found;
        char *fp;
 
-       if (pw == NULL)
-               return 0;
-
        /* Temporarily use the user's uid. */
        temporarily_use_uid(pw);
 
@@ -208,7 +205,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
        found = key_new(key->type);
 
        while (fgets(line, sizeof(line), f)) {
-               char *cp, *options = NULL;
+               char *cp, *key_options = NULL;
                linenum++;
                /* Skip leading whitespace, empty and comment lines. */
                for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
@@ -220,7 +217,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
                        /* no key?  check if there are options for this key */
                        int quoted = 0;
                        debug2("user_key_allowed: check options: '%s'", cp);
-                       options = cp;
+                       key_options = cp;
                        for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) {
                                if (*cp == '\\' && cp[1] == '"')
                                        cp++;   /* Skip both */
@@ -237,7 +234,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
                        }
                }
                if (key_equal(found, key) &&
-                   auth_parse_options(pw, options, file, linenum) == 1) {
+                   auth_parse_options(pw, key_options, file, linenum) == 1) {
                        found_key = 1;
                        debug("matching key found: file %s, line %lu",
                            file, linenum);
This page took 0.040425 seconds and 4 git commands to generate.