summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/sshconnect1.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-14 07:56:21 -0300
committerRenato Botelho <renato@netgate.com>2016-03-14 07:56:21 -0300
commita26e4b3de35515ec3eaf2eb76b001a6a502bf56c (patch)
tree66dd86f3e16db9b45f07c989e95501b6456cf6a5 /crypto/openssh/sshconnect1.c
parent7d66bf7f17e48798ec04b7a6d99daff1820e28f8 (diff)
parenta64e8d254dc9ecd38594b71dcd7d53c6084c5abc (diff)
downloadFreeBSD-src-a26e4b3de35515ec3eaf2eb76b001a6a502bf56c.zip
FreeBSD-src-a26e4b3de35515ec3eaf2eb76b001a6a502bf56c.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'crypto/openssh/sshconnect1.c')
-rw-r--r--crypto/openssh/sshconnect1.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/crypto/openssh/sshconnect1.c b/crypto/openssh/sshconnect1.c
index 016abbc..bfc523b 100644
--- a/crypto/openssh/sshconnect1.c
+++ b/crypto/openssh/sshconnect1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect1.c,v 1.77 2015/01/14 20:05:27 djm Exp $ */
+/* $OpenBSD: sshconnect1.c,v 1.78 2015/11/15 22:26:49 jcs Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -221,7 +221,7 @@ try_rsa_authentication(int idx)
{
BIGNUM *challenge;
Key *public, *private;
- char buf[300], *passphrase, *comment, *authfile;
+ char buf[300], *passphrase = NULL, *comment, *authfile;
int i, perm_ok = 1, type, quit;
public = options.identity_keys[idx];
@@ -283,13 +283,20 @@ try_rsa_authentication(int idx)
debug2("no passphrase given, try next key");
quit = 1;
}
- explicit_bzero(passphrase, strlen(passphrase));
- free(passphrase);
if (private != NULL || quit)
break;
debug2("bad passphrase given, try again...");
}
}
+
+ if (private != NULL)
+ maybe_add_key_to_agent(authfile, private, comment, passphrase);
+
+ if (passphrase != NULL) {
+ explicit_bzero(passphrase, strlen(passphrase));
+ free(passphrase);
+ }
+
/* We no longer need the comment. */
free(comment);
OpenPOWER on IntegriCloud