forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix error message: passphrase needs to be at least 5 characters, not 4. - Remove unused function argument. - Remove two unnecessary variables. OK djm@ Upstream-ID: 13010c05bfa8b523da1c0dc19e81dd180662bc30
- Loading branch information
1 parent
2681cdb
commit 3c019a9
Showing
5 changed files
with
20 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: ssh-add.c,v 1.124 2015/09/13 13:48:19 tim Exp $ */ | ||
/* $OpenBSD: ssh-add.c,v 1.125 2015/09/13 14:39:16 tim Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -218,17 +218,16 @@ add_file(int agent_fd, const char *filename, int key_only) | |
close(fd); | ||
|
||
/* At first, try empty passphrase */ | ||
if ((r = sshkey_parse_private_fileblob(keyblob, "", filename, | ||
&private, &comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) { | ||
if ((r = sshkey_parse_private_fileblob(keyblob, "", &private, | ||
&comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) { | ||
fprintf(stderr, "Error loading key \"%s\": %s\n", | ||
filename, ssh_err(r)); | ||
goto fail_load; | ||
} | ||
/* try last */ | ||
if (private == NULL && pass != NULL) { | ||
if ((r = sshkey_parse_private_fileblob(keyblob, pass, filename, | ||
&private, &comment)) != 0 && | ||
r != SSH_ERR_KEY_WRONG_PASSPHRASE) { | ||
if ((r = sshkey_parse_private_fileblob(keyblob, pass, &private, | ||
&comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) { | ||
fprintf(stderr, "Error loading key \"%s\": %s\n", | ||
filename, ssh_err(r)); | ||
goto fail_load; | ||
|
@@ -244,7 +243,7 @@ add_file(int agent_fd, const char *filename, int key_only) | |
if (strcmp(pass, "") == 0) | ||
goto fail_load; | ||
if ((r = sshkey_parse_private_fileblob(keyblob, pass, | ||
filename, &private, &comment)) == 0) | ||
&private, &comment)) == 0) | ||
break; | ||
else if (r != SSH_ERR_KEY_WRONG_PASSPHRASE) { | ||
fprintf(stderr, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters