|
Lines 197-203
try_rsa_authentication(int idx)
Link Here
|
| 197 |
BIGNUM *challenge; |
197 |
BIGNUM *challenge; |
| 198 |
Key *public, *private; |
198 |
Key *public, *private; |
| 199 |
char buf[300], *passphrase, *comment, *authfile; |
199 |
char buf[300], *passphrase, *comment, *authfile; |
| 200 |
int i, type, quit; |
200 |
int i, perm_ok = 1, type, quit; |
| 201 |
|
201 |
|
| 202 |
public = options.identity_keys[idx]; |
202 |
public = options.identity_keys[idx]; |
| 203 |
authfile = options.identity_files[idx]; |
203 |
authfile = options.identity_files[idx]; |
|
Lines 243-257
try_rsa_authentication(int idx)
Link Here
|
| 243 |
if (public->flags & KEY_FLAG_EXT) |
243 |
if (public->flags & KEY_FLAG_EXT) |
| 244 |
private = public; |
244 |
private = public; |
| 245 |
else |
245 |
else |
| 246 |
private = key_load_private_type(KEY_RSA1, authfile, "", NULL); |
246 |
private = key_load_private_type(KEY_RSA1, authfile, "", NULL, |
| 247 |
if (private == NULL && !options.batch_mode) { |
247 |
&perm_ok); |
|
|
248 |
if (private == NULL && !options.batch_mode && perm_ok) { |
| 248 |
snprintf(buf, sizeof(buf), |
249 |
snprintf(buf, sizeof(buf), |
| 249 |
"Enter passphrase for RSA key '%.100s': ", comment); |
250 |
"Enter passphrase for RSA key '%.100s': ", comment); |
| 250 |
for (i = 0; i < options.number_of_password_prompts; i++) { |
251 |
for (i = 0; i < options.number_of_password_prompts; i++) { |
| 251 |
passphrase = read_passphrase(buf, 0); |
252 |
passphrase = read_passphrase(buf, 0); |
| 252 |
if (strcmp(passphrase, "") != 0) { |
253 |
if (strcmp(passphrase, "") != 0) { |
| 253 |
private = key_load_private_type(KEY_RSA1, |
254 |
private = key_load_private_type(KEY_RSA1, |
| 254 |
authfile, passphrase, NULL); |
255 |
authfile, passphrase, NULL, NULL); |
| 255 |
quit = 0; |
256 |
quit = 0; |
| 256 |
} else { |
257 |
} else { |
| 257 |
debug2("no passphrase given, try next key"); |
258 |
debug2("no passphrase given, try next key"); |
|
Lines 268-274
try_rsa_authentication(int idx)
Link Here
|
| 268 |
xfree(comment); |
269 |
xfree(comment); |
| 269 |
|
270 |
|
| 270 |
if (private == NULL) { |
271 |
if (private == NULL) { |
| 271 |
if (!options.batch_mode) |
272 |
if (!options.batch_mode && perm_ok) |
| 272 |
error("Bad passphrase."); |
273 |
error("Bad passphrase."); |
| 273 |
|
274 |
|
| 274 |
/* Send a dummy response packet to avoid protocol error. */ |
275 |
/* Send a dummy response packet to avoid protocol error. */ |