From ec3d0e24a1e46873d80507f5cd8ee6d0d03ac5dc Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 2 Jul 2014 15:30:00 +1000 Subject: [PATCH] - markus@cvs.openbsd.org 2014/06/27 18:50:39 [ssh-add.c] fix loading of private keys --- ChangeLog | 3 +++ ssh-add.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bc9e0c1b..f17a80387 100644 --- a/ChangeLog +++ b/ChangeLog @@ -62,6 +62,9 @@ [channels.c channels.h clientloop.c ssh.c] fix remote fwding with same listen port but different listen address with gerhard@, ok djm@ + - markus@cvs.openbsd.org 2014/06/27 18:50:39 + [ssh-add.c] + fix loading of private keys 20140618 - (tim) [openssh/session.c] Work around to get chroot sftp working on UnixWare diff --git a/ssh-add.c b/ssh-add.c index 46b91cbde..07558ae52 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-add.c,v 1.110 2014/06/24 01:13:21 djm Exp $ */ +/* $OpenBSD: ssh-add.c,v 1.111 2014/06/27 18:50:39 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -202,14 +202,14 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) close(fd); /* At first, try empty passphrase */ - if ((r = sshkey_parse_private_fileblob(&keyblob, filename, "", + 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)); + 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, filename, pass, + if ((r = sshkey_parse_private_fileblob(&keyblob, pass, filename, &private, &comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) fatal("Cannot parse %s: %s", filename, ssh_err(r)); @@ -228,7 +228,7 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) return -1; } if ((r = sshkey_parse_private_fileblob(&keyblob, - filename, pass, &private, &comment)) != 0 && + pass, filename, &private, NULL)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE) fatal("Cannot parse %s: %s", filename, ssh_err(r));