Diff

Differences From Artifact [ea0ac36c2f]:

To Artifact [cfedb67ecc]:


2426
2427
2428
2429
2430
2431
2432


2433
2434












2435
2436
2437
2438
2439
2440
2441
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455







+
+


+
+
+
+
+
+
+
+
+
+
+
+







	}
	if (pwpkt_type == SSH1_CMSG_AUTH_PASSWORD) {
	    sprintf(prompt, "%.90s@%.90s's password: ",
		    username, savedhost);
	}
	if (pwpkt_type == SSH1_CMSG_AUTH_RSA) {
	    char *comment = NULL;
	    int type;
	    char msgbuf[256];
	    if (flags & FLAG_VERBOSE)
		c_write_str("Trying public key authentication.\r\n");
	    sprintf(msgbuf, "Trying public key \"%.200s\"", cfg.keyfile);
	    logevent(msgbuf);
	    type = key_type(cfg.keyfile);
	    if (type != SSH_KEYTYPE_SSH1) {
		sprintf(msgbuf, "Key is of wrong type (%s)",
			key_type_to_str(type));
		logevent(msgbuf);
		c_write_str(msgbuf);
		c_write_str("\r\n");
		tried_publickey = 1;
		continue;
	    }
	    if (!rsakey_encrypted(cfg.keyfile, &comment)) {
		if (flags & FLAG_VERBOSE)
		    c_write_str("No passphrase required.\r\n");
		goto tryauth;
	    }
	    sprintf(prompt, "Passphrase for key \"%.100s\": ", comment);
	    sfree(comment);
4081
4082
4083
4084
4085
4086
4087




4088
4089











4090
4091
4092
4093
4094
4095
4096
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105


4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123







+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+








	tried_pubkey_config = FALSE;
	tried_agent = FALSE;
	tried_keyb_inter = FALSE;
	kbd_inter_running = FALSE;
	/* Load the pub half of cfg.keyfile so we notice if it's in Pageant */
	if (*cfg.keyfile) {
	    int keytype;
	    logeventf("Reading private key file \"%.150s\"", cfg.keyfile);
	    keytype = key_type(cfg.keyfile);
	    if (keytype == SSH_KEYTYPE_SSH2)
	    publickey_blob = ssh2_userkey_loadpub(cfg.keyfile, NULL,
						  &publickey_bloblen);
		publickey_blob = ssh2_userkey_loadpub(cfg.keyfile, NULL,
						      &publickey_bloblen);
	    else {
		char msgbuf[256];
		logeventf("Unable to use this key file (%s)",
			key_type_to_str(keytype));
		sprintf(msgbuf, "Unable to use key file \"%.150s\" (%s)\r\n",
			cfg.keyfile, key_type_to_str(keytype));
		c_write_str(msgbuf);
		publickey_blob = NULL;
	    }
	} else
	    publickey_blob = NULL;

	while (1) {
	    /*
	     * Wait for the result of the last authentication request.
	     */
4341
4342
4343
4344
4345
4346
4347
4348

4349
4350
4351
4352
4353
4354
4355
4368
4369
4370
4371
4372
4373
4374

4375
4376
4377
4378
4379
4380
4381
4382







-
+







			}
		    }
		    if (authed)
			continue;
		}
	    }

	    if (!method && can_pubkey && *cfg.keyfile
	    if (!method && can_pubkey && publickey_blob
		&& !tried_pubkey_config) {
		unsigned char *pub_blob;
		char *algorithm, *comment;
		int pub_blob_len;

		tried_pubkey_config = TRUE;