-/* $OpenBSD: auth2-chall.c,v 1.46 2017/05/30 14:18:15 markus Exp $ */
+/* $OpenBSD: auth2-chall.c,v 1.47 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Per Allansson. All rights reserved.
static int auth2_challenge_start(Authctxt *);
static int send_userauth_info_request(Authctxt *);
-static int input_userauth_info_response(int, u_int32_t, void *);
+static int input_userauth_info_response(int, u_int32_t, struct ssh *);
extern KbdintDevice bsdauth_device;
}
static int
-input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
+input_userauth_info_response(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
KbdintAuthctxt *kbdintctxt;
int authenticated = 0, res;
-/* $OpenBSD: auth2-gss.c,v 1.23 2017/05/30 14:18:15 markus Exp $ */
+/* $OpenBSD: auth2-gss.c,v 1.24 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
extern ServerOptions options;
-static int input_gssapi_token(int type, u_int32_t plen, void *ctxt);
-static int input_gssapi_mic(int type, u_int32_t plen, void *ctxt);
-static int input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt);
-static int input_gssapi_errtok(int, u_int32_t, void *);
+static int input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh);
+static int input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh);
+static int input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh);
+static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
/*
* We only support those mechanisms that we know about (ie ones that we know
}
static int
-input_gssapi_token(int type, u_int32_t plen, void *ctxt)
+input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
}
static int
-input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
+input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
*/
static int
-input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
+input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
int authenticated;
}
static int
-input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
+input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
int authenticated = 0;
-/* $OpenBSD: auth2.c,v 1.138 2017/05/30 14:18:15 markus Exp $ */
+/* $OpenBSD: auth2.c,v 1.139 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
/* protocol */
-static int input_service_request(int, u_int32_t, void *);
-static int input_userauth_request(int, u_int32_t, void *);
+static int input_service_request(int, u_int32_t, struct ssh *);
+static int input_userauth_request(int, u_int32_t, struct ssh *);
/* helper */
static Authmethod *authmethod_lookup(Authctxt *, const char *);
/*ARGSUSED*/
static int
-input_service_request(int type, u_int32_t seq, void *ctxt)
+input_service_request(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
u_int len;
int acceptit = 0;
/*ARGSUSED*/
static int
-input_userauth_request(int type, u_int32_t seq, void *ctxt)
+input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Authmethod *m = NULL;
char *user, *service, *method, *style = NULL;
-/* $OpenBSD: channels.c,v 1.362 2017/05/30 08:49:58 markus Exp $ */
+/* $OpenBSD: channels.c,v 1.363 2017/05/30 14:23:52 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* replaces local (proxy) channel ID with downstream channel ID.
*/
int
-channel_proxy_upstream(Channel *c, int type, u_int32_t seq, void *ctxt)
+channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = active_state;
struct sshbuf *b = NULL;
Channel *downstream;
const u_char *cp = NULL;
/* ARGSUSED */
int
-channel_input_data(int type, u_int32_t seq, void *ctxt)
+channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
const u_char *data;
c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received data for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
/* Ignore any data for non-open channels (might happen on close) */
/* ARGSUSED */
int
-channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
+channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
char *data;
if (c == NULL)
packet_disconnect("Received extended_data for bad channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPEN) {
logit("channel %d: ext data for non open", id);
/* ARGSUSED */
int
-channel_input_ieof(int type, u_int32_t seq, void *ctxt)
+channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
Channel *c;
c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received ieof for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
chan_rcvd_ieof(c);
/* ARGSUSED */
int
-channel_input_oclose(int type, u_int32_t seq, void *ctxt)
+channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
{
int id = packet_get_int();
Channel *c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received oclose for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
packet_check_eom();
chan_rcvd_oclose(c);
/* ARGSUSED */
int
-channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
+channel_input_open_confirmation(int type, u_int32_t seq, struct ssh *ssh)
{
int id, remote_id;
Channel *c;
if (c==NULL)
packet_disconnect("Received open confirmation for "
"unknown channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPENING)
packet_disconnect("Received open confirmation for "
/* ARGSUSED */
int
-channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
+channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
{
int id, reason;
char *msg = NULL, *lang = NULL;
if (c==NULL)
packet_disconnect("Received open failure for "
"unknown channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPENING)
packet_disconnect("Received open failure for "
/* ARGSUSED */
int
-channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
+channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c;
int id;
logit("Received window adjust for non-open channel %d.", id);
return 0;
}
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
adjust = packet_get_int();
packet_check_eom();
/* ARGSUSED */
int
-channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)
+channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c;
struct channel_confirm *cc;
logit("channel_input_status_confirm: %d: unknown", id);
return 0;
}
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
packet_check_eom();
if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL)
-/* $OpenBSD: channels.h,v 1.125 2017/05/26 19:35:50 markus Exp $ */
+/* $OpenBSD: channels.h,v 1.126 2017/05/30 14:23:52 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
#define CHANNEL_CANCEL_PORT_STATIC -1
+struct ssh;
struct Channel;
typedef struct Channel Channel;
/* mux proxy support */
int channel_proxy_downstream(Channel *mc);
-int channel_proxy_upstream(Channel *, int, u_int32_t, void *);
+int channel_proxy_upstream(Channel *, int, u_int32_t, struct ssh *);
/* protocol handler */
-int channel_input_data(int, u_int32_t, void *);
-int channel_input_extended_data(int, u_int32_t, void *);
-int channel_input_ieof(int, u_int32_t, void *);
-int channel_input_oclose(int, u_int32_t, void *);
-int channel_input_open_confirmation(int, u_int32_t, void *);
-int channel_input_open_failure(int, u_int32_t, void *);
-int channel_input_window_adjust(int, u_int32_t, void *);
-int channel_input_status_confirm(int, u_int32_t, void *);
+int channel_input_data(int, u_int32_t, struct ssh *);
+int channel_input_extended_data(int, u_int32_t, struct ssh *);
+int channel_input_ieof(int, u_int32_t, struct ssh *);
+int channel_input_oclose(int, u_int32_t, struct ssh *);
+int channel_input_open_confirmation(int, u_int32_t, struct ssh *);
+int channel_input_open_failure(int, u_int32_t, struct ssh *);
+int channel_input_port_open(int, u_int32_t, struct ssh *);
+int channel_input_window_adjust(int, u_int32_t, struct ssh *);
+int channel_input_status_confirm(int, u_int32_t, struct ssh *);
/* file descriptor handling (read/write) */
-/* $OpenBSD: clientloop.c,v 1.296 2017/05/03 21:08:09 naddy Exp $ */
+/* $OpenBSD: clientloop.c,v 1.297 2017/05/30 14:23:52 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
}
static int
-client_global_request_reply(int type, u_int32_t seq, void *ctxt)
+client_global_request_reply(int type, u_int32_t seq, struct ssh *ssh)
{
struct global_confirm *gc;
/* XXXX move to generic input handler */
static int
-client_input_channel_open(int type, u_int32_t seq, void *ctxt)
+client_input_channel_open(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
char *ctype;
}
static int
-client_input_channel_req(int type, u_int32_t seq, void *ctxt)
+client_input_channel_req(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
int exitval, id, reply, success = 0;
id = packet_get_int();
c = channel_lookup(id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
rtype = packet_get_string(NULL);
reply = packet_get_char();
}
static int
-client_input_global_request(int type, u_int32_t seq, void *ctxt)
+client_input_global_request(int type, u_int32_t seq, struct ssh *ssh)
{
char *rtype;
int want_reply;
-/* $OpenBSD: dispatch.c,v 1.29 2017/04/30 23:28:42 djm Exp $ */
+/* $OpenBSD: dispatch.c,v 1.30 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
#include "ssherr.h"
int
-dispatch_protocol_error(int type, u_int32_t seq, void *ctx)
+dispatch_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = active_state; /* XXX */
int r;
logit("dispatch_protocol_error: type %d seq %u", type, seq);
}
int
-dispatch_protocol_ignore(int type, u_int32_t seq, void *ssh)
+dispatch_protocol_ignore(int type, u_int32_t seq, struct ssh *ssh)
{
logit("dispatch_protocol_ignore: type %d seq %u", type, seq);
return 0;
-/* $OpenBSD: dispatch.h,v 1.12 2015/01/19 20:07:45 markus Exp $ */
+/* $OpenBSD: dispatch.h,v 1.13 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
struct ssh;
-typedef int dispatch_fn(int, u_int32_t, void *);
+typedef int dispatch_fn(int, u_int32_t, struct ssh *);
-int dispatch_protocol_error(int, u_int32_t, void *);
-int dispatch_protocol_ignore(int, u_int32_t, void *);
+int dispatch_protocol_error(int, u_int32_t, struct ssh *);
+int dispatch_protocol_ignore(int, u_int32_t, struct ssh *);
void ssh_dispatch_init(struct ssh *, dispatch_fn *);
void ssh_dispatch_set(struct ssh *, int, dispatch_fn *);
void ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *);
-/* $OpenBSD: kex.c,v 1.132 2017/04/30 23:10:43 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.133 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
/* prototype */
static int kex_choose_conf(struct ssh *);
-static int kex_input_newkeys(int, u_int32_t, void *);
+static int kex_input_newkeys(int, u_int32_t, struct ssh *);
static const char *proposal_names[PROPOSAL_MAX] = {
"KEX algorithms",
/* ARGSUSED */
static int
-kex_protocol_error(int type, u_int32_t seq, void *ctxt)
+kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = active_state; /* XXX */
int r;
error("kex protocol error: type %d seq %u", type, seq);
}
int
-kex_input_ext_info(int type, u_int32_t seq, void *ctxt)
+kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
u_int32_t i, ninfo;
char *name, *val, *found;
}
static int
-kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
+kex_input_newkeys(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
int r;
/* ARGSUSED */
int
-kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
+kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
const u_char *ptr;
u_int i;
-/* $OpenBSD: kex.h,v 1.82 2017/05/03 21:08:09 naddy Exp $ */
+/* $OpenBSD: kex.h,v 1.83 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
void kex_prop_free(char **);
int kex_send_kexinit(struct ssh *);
-int kex_input_kexinit(int, u_int32_t, void *);
-int kex_input_ext_info(int, u_int32_t, void *);
+int kex_input_kexinit(int, u_int32_t, struct ssh *);
+int kex_input_ext_info(int, u_int32_t, struct ssh *);
int kex_derive_keys(struct ssh *, u_char *, u_int, const struct sshbuf *);
int kex_derive_keys_bn(struct ssh *, u_char *, u_int, const BIGNUM *);
int kex_send_newkeys(struct ssh *);
-/* $OpenBSD: kexdhc.c,v 1.19 2016/05/02 10:26:04 djm Exp $ */
+/* $OpenBSD: kexdhc.c,v 1.20 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "ssherr.h"
#include "sshbuf.h"
-static int input_kex_dh(int, u_int32_t, void *);
+static int input_kex_dh(int, u_int32_t, struct ssh *);
int
kexdh_client(struct ssh *ssh)
}
static int
-input_kex_dh(int type, u_int32_t seq, void *ctxt)
+input_kex_dh(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
BIGNUM *dh_server_pub = NULL, *shared_secret = NULL;
struct sshkey *server_host_key = NULL;
-/* $OpenBSD: kexdhs.c,v 1.24 2016/05/02 10:26:04 djm Exp $ */
+/* $OpenBSD: kexdhs.c,v 1.25 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
#include "ssherr.h"
#include "sshbuf.h"
-static int input_kex_dh_init(int, u_int32_t, void *);
+static int input_kex_dh_init(int, u_int32_t, struct ssh *);
int
kexdh_server(struct ssh *ssh)
}
int
-input_kex_dh_init(int type, u_int32_t seq, void *ctxt)
+input_kex_dh_init(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
BIGNUM *shared_secret = NULL, *dh_client_pub = NULL;
struct sshkey *server_host_public, *server_host_private;
-/* $OpenBSD: kexecdhc.c,v 1.10 2015/01/26 06:10:03 djm Exp $ */
+/* $OpenBSD: kexecdhc.c,v 1.11 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2010 Damien Miller. All rights reserved.
#include "ssherr.h"
#include "sshbuf.h"
-static int input_kex_ecdh_reply(int, u_int32_t, void *);
+static int input_kex_ecdh_reply(int, u_int32_t, struct ssh *);
int
kexecdh_client(struct ssh *ssh)
}
static int
-input_kex_ecdh_reply(int type, u_int32_t seq, void *ctxt)
+input_kex_ecdh_reply(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
const EC_GROUP *group;
EC_POINT *server_public = NULL;
-/* $OpenBSD: kexecdhs.c,v 1.15 2015/12/04 16:41:28 markus Exp $ */
+/* $OpenBSD: kexecdhs.c,v 1.16 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2010 Damien Miller. All rights reserved.
#include "ssherr.h"
#include "sshbuf.h"
-static int input_kex_ecdh_init(int, u_int32_t, void *);
+static int input_kex_ecdh_init(int, u_int32_t, struct ssh *);
int
kexecdh_server(struct ssh *ssh)
}
static int
-input_kex_ecdh_init(int type, u_int32_t seq, void *ctxt)
+input_kex_ecdh_init(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
EC_POINT *client_public;
EC_KEY *server_key = NULL;
-/* $OpenBSD: kexgexc.c,v 1.24 2017/05/16 16:56:15 djm Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.25 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#include "sshbuf.h"
#include "misc.h"
-static int input_kex_dh_gex_group(int, u_int32_t, void *);
-static int input_kex_dh_gex_reply(int, u_int32_t, void *);
+static int input_kex_dh_gex_group(int, u_int32_t, struct ssh *);
+static int input_kex_dh_gex_reply(int, u_int32_t, struct ssh *);
int
kexgex_client(struct ssh *ssh)
}
static int
-input_kex_dh_gex_group(int type, u_int32_t seq, void *ctxt)
+input_kex_dh_gex_group(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
BIGNUM *p = NULL, *g = NULL;
int r, bits;
}
static int
-input_kex_dh_gex_reply(int type, u_int32_t seq, void *ctxt)
+input_kex_dh_gex_reply(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
BIGNUM *dh_server_pub = NULL, *shared_secret = NULL;
struct sshkey *server_host_key = NULL;
-/* $OpenBSD: kexgexs.c,v 1.30 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: kexgexs.c,v 1.31 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
#include "sshbuf.h"
#include "misc.h"
-static int input_kex_dh_gex_request(int, u_int32_t, void *);
-static int input_kex_dh_gex_init(int, u_int32_t, void *);
+static int input_kex_dh_gex_request(int, u_int32_t, struct ssh *);
+static int input_kex_dh_gex_init(int, u_int32_t, struct ssh *);
int
kexgex_server(struct ssh *ssh)
}
static int
-input_kex_dh_gex_request(int type, u_int32_t seq, void *ctxt)
+input_kex_dh_gex_request(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
int r;
u_int min = 0, max = 0, nbits = 0;
}
static int
-input_kex_dh_gex_init(int type, u_int32_t seq, void *ctxt)
+input_kex_dh_gex_init(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
struct kex *kex = ssh->kex;
BIGNUM *shared_secret = NULL, *dh_client_pub = NULL;
struct sshkey *server_host_public, *server_host_private;
-/* $OpenBSD: serverloop.c,v 1.191 2017/02/01 02:59:09 dtucker Exp $ */
+/* $OpenBSD: serverloop.c,v 1.192 2017/05/30 14:23:52 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
}
static int
-server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
+server_input_keep_alive(int type, u_int32_t seq, struct ssh *ssh)
{
debug("Got %d/%u for keepalive", type, seq);
/*
}
static int
-server_input_channel_open(int type, u_int32_t seq, void *ctxt)
+server_input_channel_open(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c = NULL;
char *ctype;
}
static int
-server_input_global_request(int type, u_int32_t seq, void *ctxt)
+server_input_global_request(int type, u_int32_t seq, struct ssh *ssh)
{
char *rtype;
int want_reply;
}
static int
-server_input_channel_req(int type, u_int32_t seq, void *ctxt)
+server_input_channel_req(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c;
int id, reply, success = 0;
-/* $OpenBSD: sshconnect2.c,v 1.260 2017/05/30 14:19:15 markus Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.261 2017/05/30 14:23:52 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
int *batch_flag; /* flag in option struct that disables method */
};
-int input_userauth_service_accept(int, u_int32_t, void *);
-int input_userauth_ext_info(int, u_int32_t, void *);
-int input_userauth_success(int, u_int32_t, void *);
-int input_userauth_success_unexpected(int, u_int32_t, void *);
-int input_userauth_failure(int, u_int32_t, void *);
-int input_userauth_banner(int, u_int32_t, void *);
-int input_userauth_error(int, u_int32_t, void *);
-int input_userauth_info_req(int, u_int32_t, void *);
-int input_userauth_pk_ok(int, u_int32_t, void *);
-int input_userauth_passwd_changereq(int, u_int32_t, void *);
+int input_userauth_service_accept(int, u_int32_t, struct ssh *);
+int input_userauth_ext_info(int, u_int32_t, struct ssh *);
+int input_userauth_success(int, u_int32_t, struct ssh *);
+int input_userauth_success_unexpected(int, u_int32_t, struct ssh *);
+int input_userauth_failure(int, u_int32_t, struct ssh *);
+int input_userauth_banner(int, u_int32_t, struct ssh *);
+int input_userauth_error(int, u_int32_t, struct ssh *);
+int input_userauth_info_req(int, u_int32_t, struct ssh *);
+int input_userauth_pk_ok(int, u_int32_t, struct ssh *);
+int input_userauth_passwd_changereq(int, u_int32_t, struct ssh *);
int userauth_none(Authctxt *);
int userauth_pubkey(Authctxt *);
#ifdef GSSAPI
int userauth_gssapi(Authctxt *authctxt);
-int input_gssapi_response(int type, u_int32_t, void *);
-int input_gssapi_token(int type, u_int32_t, void *);
-int input_gssapi_hash(int type, u_int32_t, void *);
-int input_gssapi_error(int, u_int32_t, void *);
-int input_gssapi_errtok(int, u_int32_t, void *);
+int input_gssapi_response(int type, u_int32_t, struct ssh *);
+int input_gssapi_token(int type, u_int32_t, struct ssh *);
+int input_gssapi_hash(int type, u_int32_t, struct ssh *);
+int input_gssapi_error(int, u_int32_t, struct ssh *);
+int input_gssapi_errtok(int, u_int32_t, struct ssh *);
#endif
void userauth(Authctxt *, char *);
/* ARGSUSED */
int
-input_userauth_service_accept(int type, u_int32_t seqnr, void *ctxt)
+input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
int r;
/* ARGSUSED */
int
-input_userauth_ext_info(int type, u_int32_t seqnr, void *ctxt)
+input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh)
{
- return kex_input_ext_info(type, seqnr, ctxt);
+ return kex_input_ext_info(type, seqnr, ssh);
}
void
/* ARGSUSED */
int
-input_userauth_error(int type, u_int32_t seq, void *ctxt)
+input_userauth_error(int type, u_int32_t seq, struct ssh *ssh)
{
fatal("input_userauth_error: bad message during authentication: "
"type %d", type);
/* ARGSUSED */
int
-input_userauth_banner(int type, u_int32_t seq, void *ctxt)
+input_userauth_banner(int type, u_int32_t seq, struct ssh *ssh)
{
char *msg, *lang;
u_int len;
/* ARGSUSED */
int
-input_userauth_success(int type, u_int32_t seq, void *ctxt)
+input_userauth_success(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
if (authctxt == NULL)
}
int
-input_userauth_success_unexpected(int type, u_int32_t seq, void *ctxt)
+input_userauth_success_unexpected(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
if (authctxt == NULL)
/* ARGSUSED */
int
-input_userauth_failure(int type, u_int32_t seq, void *ctxt)
+input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
char *authlist = NULL;
int partial;
/* ARGSUSED */
int
-input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
+input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
struct sshkey *key = NULL;
Identity *id = NULL;
/* ARGSUSED */
int
-input_gssapi_response(int type, u_int32_t plen, void *ctxt)
+input_gssapi_response(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
int oidlen;
/* ARGSUSED */
int
-input_gssapi_token(int type, u_int32_t plen, void *ctxt)
+input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
gss_buffer_desc recv_tok;
OM_uint32 status;
/* ARGSUSED */
int
-input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
+input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
/* ARGSUSED */
int
-input_gssapi_error(int type, u_int32_t plen, void *ctxt)
+input_gssapi_error(int type, u_int32_t plen, struct ssh *ssh)
{
char *msg;
char *lang;
*/
/* ARGSUSED */
int
-input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
+input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
char *info, *lang, *password = NULL, *retype = NULL;
char prompt[150];
* parse INFO_REQUEST, prompt user and send INFO_RESPONSE
*/
int
-input_userauth_info_req(int type, u_int32_t seq, void *ctxt)
+input_userauth_info_req(int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = ctxt;
Authctxt *authctxt = ssh->authctxt;
char *name, *inst, *lang, *prompt, *response;
u_int num_prompts, i;