diff options
author | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
commit | 102062f825fb26a74295a1c089c00c4c4c76b68a (patch) | |
tree | 3db66bc8c8483cce66516dff36f6ef56065143d9 /monitor_wrap.c | |
parent | 3d246f10429fc9a37b98eabef94fe8dc7c61002b (diff) | |
parent | fd0fa130ecf06d7d092932adcd5d77f1549bfc8d (diff) |
Import openssh_8.0p1.orig.tar.gz
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index 732fb3476..186e8f022 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: monitor_wrap.c,v 1.107 2018/07/20 03:46:34 djm Exp $ */ | 1 | /* $OpenBSD: monitor_wrap.c,v 1.112 2019/01/21 09:54:11 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> | 3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> |
4 | * Copyright 2002 Markus Friedl <markus@openbsd.org> | 4 | * Copyright 2002 Markus Friedl <markus@openbsd.org> |
@@ -202,12 +202,8 @@ mm_choose_dh(int min, int nbits, int max) | |||
202 | if (success == 0) | 202 | if (success == 0) |
203 | fatal("%s: MONITOR_ANS_MODULI failed", __func__); | 203 | fatal("%s: MONITOR_ANS_MODULI failed", __func__); |
204 | 204 | ||
205 | if ((p = BN_new()) == NULL) | 205 | if ((r = sshbuf_get_bignum2(m, &p)) != 0 || |
206 | fatal("%s: BN_new failed", __func__); | 206 | (r = sshbuf_get_bignum2(m, &g)) != 0) |
207 | if ((g = BN_new()) == NULL) | ||
208 | fatal("%s: BN_new failed", __func__); | ||
209 | if ((r = sshbuf_get_bignum2(m, p)) != 0 || | ||
210 | (r = sshbuf_get_bignum2(m, g)) != 0) | ||
211 | fatal("%s: buffer error: %s", __func__, ssh_err(r)); | 207 | fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
212 | 208 | ||
213 | debug3("%s: remaining %zu", __func__, sshbuf_len(m)); | 209 | debug3("%s: remaining %zu", __func__, sshbuf_len(m)); |
@@ -218,12 +214,12 @@ mm_choose_dh(int min, int nbits, int max) | |||
218 | #endif | 214 | #endif |
219 | 215 | ||
220 | int | 216 | int |
221 | mm_sshkey_sign(struct sshkey *key, u_char **sigp, size_t *lenp, | 217 | mm_sshkey_sign(struct ssh *ssh, struct sshkey *key, u_char **sigp, size_t *lenp, |
222 | const u_char *data, size_t datalen, const char *hostkey_alg, u_int compat) | 218 | const u_char *data, size_t datalen, const char *hostkey_alg, u_int compat) |
223 | { | 219 | { |
224 | struct kex *kex = *pmonitor->m_pkex; | 220 | struct kex *kex = *pmonitor->m_pkex; |
225 | struct sshbuf *m; | 221 | struct sshbuf *m; |
226 | u_int ndx = kex->host_key_index(key, 0, active_state); | 222 | u_int ndx = kex->host_key_index(key, 0, ssh); |
227 | int r; | 223 | int r; |
228 | 224 | ||
229 | debug3("%s entering", __func__); | 225 | debug3("%s entering", __func__); |
@@ -248,9 +244,8 @@ mm_sshkey_sign(struct sshkey *key, u_char **sigp, size_t *lenp, | |||
248 | } | 244 | } |
249 | 245 | ||
250 | struct passwd * | 246 | struct passwd * |
251 | mm_getpwnamallow(const char *username) | 247 | mm_getpwnamallow(struct ssh *ssh, const char *username) |
252 | { | 248 | { |
253 | struct ssh *ssh = active_state; /* XXX */ | ||
254 | struct sshbuf *m; | 249 | struct sshbuf *m; |
255 | struct passwd *pw; | 250 | struct passwd *pw; |
256 | size_t len; | 251 | size_t len; |
@@ -438,8 +433,8 @@ mm_user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key, | |||
438 | } | 433 | } |
439 | 434 | ||
440 | int | 435 | int |
441 | mm_hostbased_key_allowed(struct passwd *pw, const char *user, const char *host, | 436 | mm_hostbased_key_allowed(struct ssh *ssh, struct passwd *pw, |
442 | struct sshkey *key) | 437 | const char *user, const char *host, struct sshkey *key) |
443 | { | 438 | { |
444 | return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, NULL)); | 439 | return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, NULL)); |
445 | } | 440 | } |
@@ -532,9 +527,8 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen, | |||
532 | } | 527 | } |
533 | 528 | ||
534 | void | 529 | void |
535 | mm_send_keystate(struct monitor *monitor) | 530 | mm_send_keystate(struct ssh *ssh, struct monitor *monitor) |
536 | { | 531 | { |
537 | struct ssh *ssh = active_state; /* XXX */ | ||
538 | struct sshbuf *m; | 532 | struct sshbuf *m; |
539 | int r; | 533 | int r; |
540 | 534 | ||
@@ -628,7 +622,7 @@ mm_session_pty_cleanup2(Session *s) | |||
628 | 622 | ||
629 | #ifdef USE_PAM | 623 | #ifdef USE_PAM |
630 | void | 624 | void |
631 | mm_start_pam(Authctxt *authctxt) | 625 | mm_start_pam(struct ssh *ssh) |
632 | { | 626 | { |
633 | struct sshbuf *m; | 627 | struct sshbuf *m; |
634 | 628 | ||
@@ -869,7 +863,7 @@ mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses) | |||
869 | 863 | ||
870 | #ifdef SSH_AUDIT_EVENTS | 864 | #ifdef SSH_AUDIT_EVENTS |
871 | void | 865 | void |
872 | mm_audit_event(ssh_audit_event_t event) | 866 | mm_audit_event(struct ssh *ssh, ssh_audit_event_t event) |
873 | { | 867 | { |
874 | struct sshbuf *m; | 868 | struct sshbuf *m; |
875 | int r; | 869 | int r; |