]> andersk Git - openssh.git/blobdiff - auth-rsa.c
- (djm) Big OpenBSD sync:
[openssh.git] / auth-rsa.c
index 8aefc8fadadd7507201194d6d6ac97ac4f3f7724..522f01f84cb982d9267be7263ac088d68e573341 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-rsa.c,v 1.29 2000/09/07 21:13:36 markus Exp $");
+RCSID("$OpenBSD: auth-rsa.c,v 1.31 2000/10/11 19:59:52 markus Exp $");
 
 #include "rsa.h"
 #include "packet.h"
@@ -29,6 +29,10 @@ RCSID("$OpenBSD: auth-rsa.c,v 1.29 2000/09/07 21:13:36 markus Exp $");
 #include <openssl/rsa.h>
 #include <openssl/md5.h>
 
+
+/* import */
+extern ServerOptions options;
+
 /*
  * Session identifier that is used to bind key exchange and authentication
  * responses to a particular session.
@@ -116,7 +120,6 @@ auth_rsa_challenge_dialog(RSA *pk)
 int
 auth_rsa(struct passwd *pw, BIGNUM *client_n)
 {
-       extern ServerOptions options;
        char line[8192], file[1024];
        int authenticated;
        unsigned int bits;
@@ -125,6 +128,10 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n)
        struct stat st;
        RSA *pk;
 
+       /* no user given */
+       if (pw == NULL)
+               return 0;
+
        /* Temporarily use the user's uid. */
        temporarily_use_uid(pw->pw_uid);
 
@@ -277,6 +284,8 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n)
 
        if (authenticated)
                packet_send_debug("RSA authentication accepted.");
+       else
+               auth_clear_options();
 
        /* Return authentication result. */
        return authenticated;
This page took 0.042414 seconds and 4 git commands to generate.