*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.61 2001/04/03 19:53:29 markus Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.67 2001/04/05 10:42:56 markus Exp $");
#include <openssl/bn.h>
#include <openssl/md5.h>
char *xxx_host;
struct sockaddr *xxx_hostaddr;
+Kex *xxx_kex = NULL;
+
int
check_host_key_callback(Key *hostkey)
{
myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs;
}
- kex = kex_start(myproposal);
+ /* start key exchange */
+ kex = kex_setup(myproposal);
kex->client_version_string=client_version_string;
kex->server_version_string=server_version_string;
kex->check_host_key=&check_host_key_callback;
- /* start key exchange */
- dispatch_run(DISPATCH_BLOCK, &kex->newkeys, kex);
+ xxx_kex = kex;
+
+ dispatch_run(DISPATCH_BLOCK, &kex->done, kex);
+
+ session_id2 = kex->session_id;
+ session_id2_len = kex->session_id_len;
#ifdef DEBUG_KEXDH
/* send 1st encrypted/maced/compressed message */
Authctxt authctxt;
int type;
int plen;
- int i;
if (options.challenge_reponse_authentication)
options.kbd_interactive_authentication = 1;
/* initial userauth request */
userauth_none(&authctxt);
- //dispatch_init(&input_userauth_error);
- for (i = 50; i <= 254; i++) {
- dispatch_set(i, &input_userauth_error);
- }
+ dispatch_init(&input_userauth_error);
dispatch_set(SSH2_MSG_USERAUTH_SUCCESS, &input_userauth_success);
dispatch_set(SSH2_MSG_USERAUTH_FAILURE, &input_userauth_failure);
dispatch_set(SSH2_MSG_USERAUTH_BANNER, &input_userauth_banner);
int key_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, int *lenp,
u_char *data, int datalen)
{
- return key_sign(key, sigp, lenp, data, datalen);
+ return key_sign(key, sigp, lenp, data, datalen);
}
int
/*
* Given the authentication method list sent by the server, return the
* next method we should try. If the server initially sends a nil list,
- * use a built-in default list.
+ * use a built-in default list.
*/
Authmethod *
authmethod_get(char *authlist)