]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssh: set the password correctly for PASSWORD auth
authorDaniel Stenberg <daniel@haxx.se>
Wed, 15 Jan 2020 13:23:03 +0000 (14:23 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 15 Jan 2020 21:10:39 +0000 (22:10 +0100)
lib/vssh/wolfssh.c

index 9e14df3a3cd3d879cc554dc27cb5991ecc4aadeb..f9c43de7030e8aff7204b2ce96ab5b84e0711f89 100644 (file)
@@ -337,12 +337,13 @@ static int userauth(byte authtype,
                     void *ctx)
 {
   struct connectdata *conn = ctx;
-  word32 plen = (word32) strlen(conn->passwd);
   DEBUGF(infof(conn->data, "wolfssh callback: type %s\n",
                authtype == WOLFSSH_USERAUTH_PASSWORD ? "PASSWORD" :
                "PUBLICCKEY"));
-  authdata->sf.password.password = (byte *)conn->user;
-  authdata->sf.password.passwordSz = plen;
+  if(authtype == WOLFSSH_USERAUTH_PASSWORD) {
+    authdata->sf.password.password = (byte *)conn->passwd;
+    authdata->sf.password.passwordSz = (word32) strlen(conn->passwd);
+  }
 
   return 0;
 }