summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--auth-rh-rsa.c20
-rw-r--r--auth.h4
-rw-r--r--auth1.c4
4 files changed, 14 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 635f4c23b..0c3b37f11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,9 @@
48 - markus@cvs.openbsd.org 2001/12/27 19:37:23 48 - markus@cvs.openbsd.org 2001/12/27 19:37:23
49 [dh.c kexdh.c kexgex.c] 49 [dh.c kexdh.c kexgex.c]
50 always use BN_clear_free instead of BN_free 50 always use BN_clear_free instead of BN_free
51 - markus@cvs.openbsd.org 2001/12/27 19:54:53
52 [auth1.c auth.h auth-rh-rsa.c]
53 auth_rhosts_rsa now accept generic keys.
51 54
5220020121 5520020121
53 - (djm) Rework ssh-rand-helper: 56 - (djm) Rework ssh-rand-helper:
@@ -7195,4 +7198,4 @@
7195 - Wrote replacements for strlcpy and mkdtemp 7198 - Wrote replacements for strlcpy and mkdtemp
7196 - Released 1.0pre1 7199 - Released 1.0pre1
7197 7200
7198$Id: ChangeLog,v 1.1736 2002/01/22 12:10:33 djm Exp $ 7201$Id: ChangeLog,v 1.1737 2002/01/22 12:11:00 djm Exp $
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c
index 8a486b330..e8d22a041 100644
--- a/auth-rh-rsa.c
+++ b/auth-rh-rsa.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.26 2001/11/07 22:41:51 markus Exp $"); 16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.27 2001/12/27 19:54:53 markus Exp $");
17 17
18#include "packet.h" 18#include "packet.h"
19#include "xmalloc.h" 19#include "xmalloc.h"
@@ -32,16 +32,15 @@ RCSID("$OpenBSD: auth-rh-rsa.c,v 1.26 2001/11/07 22:41:51 markus Exp $");
32 */ 32 */
33 33
34int 34int
35auth_rhosts_rsa(struct passwd *pw, const char *client_user, RSA *client_host_key) 35auth_rhosts_rsa(struct passwd *pw, const char *client_user, Key *client_host_key)
36{ 36{
37 extern ServerOptions options; 37 extern ServerOptions options;
38 const char *canonical_hostname; 38 const char *canonical_hostname;
39 HostStatus host_status; 39 HostStatus host_status;
40 Key *client_key;
41 40
42 debug("Trying rhosts with RSA host authentication for client user %.100s", client_user); 41 debug("Trying rhosts with RSA host authentication for client user %.100s", client_user);
43 42
44 if (pw == NULL || client_host_key == NULL) 43 if (pw == NULL || client_host_key == NULL || client_host_key->rsa == NULL)
45 return 0; 44 return 0;
46 45
47 /* Check if we would accept it using rhosts authentication. */ 46 /* Check if we would accept it using rhosts authentication. */
@@ -53,17 +52,10 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, RSA *client_host_key
53 52
54 debug("Rhosts RSA authentication: canonical host %.900s", canonical_hostname); 53 debug("Rhosts RSA authentication: canonical host %.900s", canonical_hostname);
55 54
56 /* wrap the RSA key into a 'generic' key */ 55 host_status = check_key_in_hostfiles(pw, client_host_key,
57 client_key = key_new(KEY_RSA1); 56 canonical_hostname, _PATH_SSH_SYSTEM_HOSTFILE,
58 BN_copy(client_key->rsa->e, client_host_key->e);
59 BN_copy(client_key->rsa->n, client_host_key->n);
60
61 host_status = check_key_in_hostfiles(pw, client_key, canonical_hostname,
62 _PATH_SSH_SYSTEM_HOSTFILE,
63 options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE); 57 options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE);
64 58
65 key_free(client_key);
66
67 if (host_status != HOST_OK) { 59 if (host_status != HOST_OK) {
68 debug("Rhosts with RSA host authentication denied: unknown or invalid host key"); 60 debug("Rhosts with RSA host authentication denied: unknown or invalid host key");
69 packet_send_debug("Your host key cannot be verified: unknown or invalid host key."); 61 packet_send_debug("Your host key cannot be verified: unknown or invalid host key.");
@@ -72,7 +64,7 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, RSA *client_host_key
72 /* A matching host key was found and is known. */ 64 /* A matching host key was found and is known. */
73 65
74 /* Perform the challenge-response dialog with the client for the host key. */ 66 /* Perform the challenge-response dialog with the client for the host key. */
75 if (!auth_rsa_challenge_dialog(client_host_key)) { 67 if (!auth_rsa_challenge_dialog(client_host_key->rsa)) {
76 log("Client on %.800s failed to respond correctly to host authentication.", 68 log("Client on %.800s failed to respond correctly to host authentication.",
77 canonical_hostname); 69 canonical_hostname);
78 return 0; 70 return 0;
diff --git a/auth.h b/auth.h
index 017871952..ef2772d89 100644
--- a/auth.h
+++ b/auth.h
@@ -21,7 +21,7 @@
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 * 23 *
24 * $OpenBSD: auth.h,v 1.25 2001/12/19 07:18:56 deraadt Exp $ 24 * $OpenBSD: auth.h,v 1.26 2001/12/27 19:54:53 markus Exp $
25 */ 25 */
26#ifndef AUTH_H 26#ifndef AUTH_H
27#define AUTH_H 27#define AUTH_H
@@ -91,7 +91,7 @@ int auth_rhosts(struct passwd *, const char *);
91int 91int
92auth_rhosts2(struct passwd *, const char *, const char *, const char *); 92auth_rhosts2(struct passwd *, const char *, const char *, const char *);
93 93
94int auth_rhosts_rsa(struct passwd *, const char *, RSA *); 94int auth_rhosts_rsa(struct passwd *, const char *, Key *);
95int auth_password(Authctxt *, const char *); 95int auth_password(Authctxt *, const char *);
96int auth_rsa(struct passwd *, BIGNUM *); 96int auth_rsa(struct passwd *, BIGNUM *);
97int auth_rsa_challenge_dialog(RSA *); 97int auth_rsa_challenge_dialog(RSA *);
diff --git a/auth1.c b/auth1.c
index 921a1757a..766053c97 100644
--- a/auth1.c
+++ b/auth1.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: auth1.c,v 1.29 2001/12/27 18:22:16 markus Exp $"); 13RCSID("$OpenBSD: auth1.c,v 1.30 2001/12/27 19:54:53 markus Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "rsa.h" 16#include "rsa.h"
@@ -214,7 +214,7 @@ do_authloop(Authctxt *authctxt)
214 packet_integrity_check(plen, (4 + ulen) + 4 + elen + nlen, type); 214 packet_integrity_check(plen, (4 + ulen) + 4 + elen + nlen, type);
215 215
216 authenticated = auth_rhosts_rsa(pw, client_user, 216 authenticated = auth_rhosts_rsa(pw, client_user,
217 client_host_key->rsa); 217 client_host_key);
218 key_free(client_host_key); 218 key_free(client_host_key);
219 219
220 snprintf(info, sizeof info, " ruser %.100s", client_user); 220 snprintf(info, sizeof info, " ruser %.100s", client_user);