while (pktin->type == SSH1_SMSG_FAILURE) {
s->pwpkt_type = SSH1_CMSG_AUTH_PASSWORD;
- if (agent_exists() && !s->tried_agent) {
+ if (ssh->cfg.tryagent && agent_exists() && !s->tried_agent) {
/*
* Attempt RSA authentication using Pageant.
*/
s->nkeys = 0;
s->agent_response = NULL;
s->pkblob_in_agent = NULL;
- if (agent_exists()) {
+ if (ssh->cfg.tryagent && agent_exists() && ssh->cfg.tryagent) {
void *r;