I have no brain at all. The SSH1 auth loop was trying all Pageant

keys before _every_ other authentication; so if you tried a local
pubkey _and_ a password, for example, you'd also try Pageant twice.
Now fixed.

[originally from svn r1524]
This commit is contained in:
Simon Tatham 2001-12-30 16:27:07 +00:00
Родитель 2ce502eae2
Коммит ccf9a051ca
1 изменённых файлов: 4 добавлений и 3 удалений

7
ssh.c
Просмотреть файл

@ -1854,7 +1854,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
struct RSAKey servkey, hostkey; struct RSAKey servkey, hostkey;
struct MD5Context md5c; struct MD5Context md5c;
static unsigned long supported_ciphers_mask, supported_auths_mask; static unsigned long supported_ciphers_mask, supported_auths_mask;
static int tried_publickey; static int tried_publickey, tried_agent;
static int tis_auth_refused, ccard_auth_refused; static int tis_auth_refused, ccard_auth_refused;
static unsigned char session_id[16]; static unsigned char session_id[16];
static int cipher_type; static int cipher_type;
@ -2105,7 +2105,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
crWaitUntil(ispkt); crWaitUntil(ispkt);
tried_publickey = 0; tried_publickey = tried_agent = 0;
tis_auth_refused = ccard_auth_refused = 0; tis_auth_refused = ccard_auth_refused = 0;
/* Load the public half of cfg.keyfile so we notice if it's in Pageant */ /* Load the public half of cfg.keyfile so we notice if it's in Pageant */
if (*cfg.keyfile) { if (*cfg.keyfile) {
@ -2122,7 +2122,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
static int pwpkt_type; static int pwpkt_type;
pwpkt_type = SSH1_CMSG_AUTH_PASSWORD; pwpkt_type = SSH1_CMSG_AUTH_PASSWORD;
if (agent_exists()) { if (agent_exists() && !tried_agent) {
/* /*
* Attempt RSA authentication using Pageant. * Attempt RSA authentication using Pageant.
*/ */
@ -2132,6 +2132,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
static int authed = FALSE; static int authed = FALSE;
void *r; void *r;
tried_agent = 1;
logevent("Pageant is running. Requesting keys."); logevent("Pageant is running. Requesting keys.");
/* Request the keys held by the agent. */ /* Request the keys held by the agent. */