mirror of git://anongit.mindrot.org/openssh.git
- dtucker@cvs.openbsd.org 2010/01/11 04:46:45
[authfile.c sshconnect2.c] Do not prompt for a passphrase if we fail to open a keyfile, and log the reason the open failed to debug. bz #1693, found by tj AT castaglia org, ok djm@
This commit is contained in:
parent
7ad8dd21da
commit
d4c86b1325
|
@ -6,6 +6,11 @@
|
||||||
single port forward on the server. This allows, for example, using ssh as
|
single port forward on the server. This allows, for example, using ssh as
|
||||||
a ProxyCommand to route connections via intermediate servers.
|
a ProxyCommand to route connections via intermediate servers.
|
||||||
bz #1618, man page help from jmc@, ok markus@
|
bz #1618, man page help from jmc@, ok markus@
|
||||||
|
- dtucker@cvs.openbsd.org 2010/01/11 04:46:45
|
||||||
|
[authfile.c sshconnect2.c]
|
||||||
|
Do not prompt for a passphrase if we fail to open a keyfile, and log the
|
||||||
|
reason the open failed to debug.
|
||||||
|
bz #1693, found by tj AT castaglia org, ok djm@
|
||||||
|
|
||||||
20100110
|
20100110
|
||||||
- (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
|
- (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
|
||||||
|
|
14
authfile.c
14
authfile.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: authfile.c,v 1.77 2009/10/22 22:26:13 djm Exp $ */
|
/* $OpenBSD: authfile.c,v 1.78 2010/01/11 04:46:45 dtucker Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
|
@ -559,7 +559,12 @@ key_load_private_type(int type, const char *filename, const char *passphrase,
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = open(filename, O_RDONLY);
|
fd = open(filename, O_RDONLY);
|
||||||
if (fd < 0)
|
if (fd < 0) {
|
||||||
|
debug("could not open key file '%s': %s", filename,
|
||||||
|
strerror(errno));
|
||||||
|
if (perm_ok != NULL)
|
||||||
|
*perm_ok = 0;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!key_perm_ok(fd, filename)) {
|
if (!key_perm_ok(fd, filename)) {
|
||||||
if (perm_ok != NULL)
|
if (perm_ok != NULL)
|
||||||
|
@ -595,8 +600,11 @@ key_load_private(const char *filename, const char *passphrase,
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = open(filename, O_RDONLY);
|
fd = open(filename, O_RDONLY);
|
||||||
if (fd < 0)
|
if (fd < 0) {
|
||||||
|
debug("could not open key file '%s': %s", filename,
|
||||||
|
strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
if (!key_perm_ok(fd, filename)) {
|
if (!key_perm_ok(fd, filename)) {
|
||||||
error("bad permissions: ignore key: %s", filename);
|
error("bad permissions: ignore key: %s", filename);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: sshconnect2.c,v 1.177 2010/01/04 01:45:30 dtucker Exp $ */
|
/* $OpenBSD: sshconnect2.c,v 1.178 2010/01/11 04:46:45 dtucker Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
||||||
* Copyright (c) 2008 Damien Miller. All rights reserved.
|
* Copyright (c) 2008 Damien Miller. All rights reserved.
|
||||||
|
@ -1250,7 +1250,7 @@ load_identity_file(char *filename)
|
||||||
{
|
{
|
||||||
Key *private;
|
Key *private;
|
||||||
char prompt[300], *passphrase;
|
char prompt[300], *passphrase;
|
||||||
int perm_ok, quit, i;
|
int perm_ok = 0, quit, i;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (stat(filename, &st) < 0) {
|
if (stat(filename, &st) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue