From 7545fb1c7eaf9a0f07cf592ab1b5aa8f59a59866 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 7 Jan 2004 11:16:27 +0000 Subject: Resolve conflicts and remove obsolete files. Sponsored by: registrar.no --- crypto/openssh/authfile.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crypto/openssh/authfile.c') diff --git a/crypto/openssh/authfile.c b/crypto/openssh/authfile.c index 90618ef..1f46093 100644 --- a/crypto/openssh/authfile.c +++ b/crypto/openssh/authfile.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfile.c,v 1.52 2003/03/13 11:42:18 markus Exp $"); +RCSID("$OpenBSD: authfile.c,v 1.54 2003/05/24 09:30:39 djm Exp $"); #include #include @@ -514,7 +514,7 @@ key_perm_ok(int fd, const char *filename) error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @"); error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); error("Permissions 0%3.3o for '%s' are too open.", - st.st_mode & 0777, filename); + (u_int)st.st_mode & 0777, filename); error("It is recommended that your private key files are NOT accessible by others."); error("This private key will be ignored."); return 0; @@ -629,9 +629,18 @@ key_load_public(const char *filename, char **commentp) Key *pub; char file[MAXPATHLEN]; + /* try rsa1 private key */ pub = key_load_public_type(KEY_RSA1, filename, commentp); if (pub != NULL) return pub; + + /* try rsa1 public key */ + pub = key_new(KEY_RSA1); + if (key_try_load_public(pub, filename, commentp) == 1) + return pub; + key_free(pub); + + /* try ssh2 public key */ pub = key_new(KEY_UNSPEC); if (key_try_load_public(pub, filename, commentp) == 1) return pub; -- cgit v1.1