Skip to content

Commit f2f1472

Browse files
committed
transports: ssh: ask for credentials again when passphrase is wrong
When trying to decode the private key it looks like LibSSH2 returns a LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED when the passphrase is incorrect.
1 parent 8f05d2d commit f2f1472

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transports/ssh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,10 @@ static int _git_ssh_authenticate_session(
419419
}
420420
} while (LIBSSH2_ERROR_EAGAIN == rc || LIBSSH2_ERROR_TIMEOUT == rc);
421421

422-
if (rc == LIBSSH2_ERROR_PASSWORD_EXPIRED || rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED)
423-
return GIT_EAUTH;
422+
if (rc == LIBSSH2_ERROR_PASSWORD_EXPIRED ||
423+
rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED ||
424+
rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED)
425+
return GIT_EAUTH;
424426

425427
if (rc != LIBSSH2_ERROR_NONE) {
426428
if (!giterr_last())

0 commit comments

Comments
 (0)