]> andersk Git - openssh.git/blobdiff - sshconnect2.c
- djm@cvs.openbsd.org 2002/02/12 12:44:46
[openssh.git] / sshconnect2.c
index 3e5ca7ad11961cc1e5eb2e617bb482cfe5856445..ea8cfa6da2774561a8f362de0c4cd52e4d81f9e4 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.93 2002/01/13 17:57:37 markus Exp $");
-
-#include <openssl/bn.h>
-#include <openssl/md5.h>
-#include <openssl/dh.h>
-#include <openssl/hmac.h>
+RCSID("$OpenBSD: sshconnect2.c,v 1.95 2002/02/03 17:59:23 markus Exp $");
 
 #include "ssh.h"
 #include "ssh2.h"
 #include "xmalloc.h"
-#include "rsa.h"
 #include "buffer.h"
 #include "packet.h"
-#include "uidswap.h"
 #include "compat.h"
 #include "bufaux.h"
 #include "cipher.h"
 #include "kex.h"
 #include "myproposal.h"
-#include "key.h"
 #include "sshconnect.h"
 #include "authfile.h"
 #include "dh.h"
@@ -361,7 +353,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
        Authctxt *authctxt = ctxt;
        Key *key = NULL;
        Buffer b;
-       int alen, blen, sent = 0;
+       int pktype, alen, blen, sent = 0;
        char *pkalg, *pkblob, *fp;
 
        if (authctxt == NULL)
@@ -389,7 +381,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
                        debug("no last key or no sign cb");
                        break;
                }
-               if (key_type_from_name(pkalg) == KEY_UNSPEC) {
+               if ((pktype = key_type_from_name(pkalg)) == KEY_UNSPEC) {
                        debug("unknown pkalg %s", pkalg);
                        break;
                }
@@ -397,6 +389,12 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
                        debug("no key from blob. pkalg %s", pkalg);
                        break;
                }
+               if (key->type != pktype) { 
+                       error("input_userauth_pk_ok: type mismatch "
+                           "for decoded key (received %d, expected %d)",
+                            key->type, pktype);
+                       break;
+               }
                fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
                debug2("input_userauth_pk_ok: fp %s", fp);
                xfree(fp);
This page took 0.029005 seconds and 4 git commands to generate.