]> andersk Git - openssh.git/blobdiff - auth2-passwd.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / auth2-passwd.c
index a8f15161ac89e2bf3f4162b1c00d37884b9baf81..5f1f3635f7a076a98084843e8b097380b79df765 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenBSD: auth2-passwd.c,v 1.9 2006/08/03 03:34:41 deraadt Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-passwd.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
+
+#include <sys/types.h>
+
+#include <string.h>
+#include <stdarg.h>
 
 #include "xmalloc.h"
 #include "packet.h"
 #include "log.h"
+#include "key.h"
+#include "hostfile.h"
 #include "auth.h"
+#include "buffer.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
 #include "monitor_wrap.h"
 #include "servconf.h"
 
@@ -38,20 +49,24 @@ extern ServerOptions options;
 static int
 userauth_passwd(Authctxt *authctxt)
 {
-       char *password;
+       char *password, *newpass;
        int authenticated = 0;
        int change;
-       u_int len;
+       u_int len, newlen;
+
        change = packet_get_char();
-       if (change)
-               logit("password change not supported");
        password = packet_get_string(&len);
+       if (change) {
+               /* discard new password from packet */
+               newpass = packet_get_string(&newlen);
+               memset(newpass, 0, newlen);
+               xfree(newpass);
+       }
        packet_check_eom();
-       if (authctxt->valid &&
-#ifdef HAVE_CYGWIN
-           check_nt_auth(1, authctxt->pw) &&
-#endif
-           PRIVSEP(auth_password(authctxt, password)) == 1)
+
+       if (change)
+               logit("password change not supported");
+       else if (PRIVSEP(auth_password(authctxt, password)) == 1)
                authenticated = 1;
        memset(password, 0, len);
        xfree(password);
This page took 0.033334 seconds and 4 git commands to generate.