summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-11 09:19:04 +1000
committerDamien Miller <djm@mindrot.org>2014-07-11 09:19:04 +1000
commit1d0df3249c87019556b83306c28d4769375c2edc (patch)
treef0952e35afabde980e67b69ecbf952ce5f78db4b
parent7a57eb3d105aa4ced15fb47001092c58811e6d9d (diff)
downloadopenssh-git-1d0df3249c87019556b83306c28d4769375c2edc.tar.gz
- OpenBSD CVS Sync
- benno@cvs.openbsd.org 2014/07/09 14:15:56 [ssh-add.c] fix ssh-add crash while loading more than one key ok markus@
-rw-r--r--ChangeLog7
-rw-r--r--ssh-add.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 43f0e7d7..13727036 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+20140711
+ - OpenBSD CVS Sync
+ - benno@cvs.openbsd.org 2014/07/09 14:15:56
+ [ssh-add.c]
+ fix ssh-add crash while loading more than one key
+ ok markus@
+
20140709
- OpenBSD CVS Sync
- djm@cvs.openbsd.org 2014/07/07 08:19:12
diff --git a/ssh-add.c b/ssh-add.c
index 05889408..78a3359a 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.112 2014/07/03 03:15:01 djm Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.113 2014/07/09 14:15:56 benno Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -205,8 +205,6 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
if ((r = sshkey_parse_private_fileblob(&keyblob, "", filename,
&private, &comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE)
fatal("Cannot parse %s: %s", filename, ssh_err(r));
- if (comment == NULL)
- comment = xstrdup(filename);
/* try last */
if (private == NULL && pass != NULL) {
if ((r = sshkey_parse_private_fileblob(&keyblob, pass, filename,
@@ -214,6 +212,8 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
r != SSH_ERR_KEY_WRONG_PASSPHRASE)
fatal("Cannot parse %s: %s", filename, ssh_err(r));
}
+ if (comment == NULL)
+ comment = xstrdup(filename);
if (private == NULL) {
/* clear passphrase since it did not work */
clear_pass();