Skip to content

Commit 1d46682

Browse files
authored
Merge pull request #450 from JacobBarthelmeh/auth
fix for connecting to servers that only offer public key
2 parents c1f473d + 0ce976a commit 1d46682

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/internal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10382,7 +10382,9 @@ int SendUserAuthRequest(WOLFSSH* ssh, byte authId, int addSig)
1038210382
}
1038310383
}
1038410384
/* fall into public key case if password case was not successful */
10385-
if ((ret == WS_FATAL_ERROR) && (authId & WOLFSSH_USERAUTH_PUBLICKEY)) {
10385+
if ((ret == WS_FATAL_ERROR ||
10386+
!(authId & WOLFSSH_USERAUTH_PASSWORD)) &&
10387+
(authId & WOLFSSH_USERAUTH_PUBLICKEY)) {
1038610388
ret = ssh->ctx->userAuthCb(WOLFSSH_USERAUTH_PUBLICKEY,
1038710389
&authData, ssh->userAuthCtx);
1038810390
if (ret != WOLFSSH_USERAUTH_SUCCESS) {

0 commit comments

Comments
 (0)