summaryrefslogtreecommitdiff
path: root/monitor_wrap.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-03-13 12:47:54 +1100
committerDamien Miller <djm@mindrot.org>2002-03-13 12:47:54 +1100
commit646e7cf3d7e7d4231c2d97d27c09fe5fe1d749e2 (patch)
treea693368c47d2d044514878fbb1516f87b487f78b /monitor_wrap.h
parent29bdd2c9bca2737e7a246ed50fd827a6ccba0c61 (diff)
Import of Niels Provos' 20020312 ssh-complete.diff
PAM, Cygwin and OSF SIA will not work for sure
Diffstat (limited to 'monitor_wrap.h')
-rw-r--r--monitor_wrap.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/monitor_wrap.h b/monitor_wrap.h
new file mode 100644
index 000000000..3c8378024
--- /dev/null
+++ b/monitor_wrap.h
@@ -0,0 +1,99 @@
1/*
2 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef _MM_WRAP_H_
27#define _MM_WRAP_H_
28#include "key.h"
29#include "buffer.h"
30
31struct mm_moduli {
32 int min;
33 int want;
34 int max;
35};
36
37enum mm_keytype {MM_HOSTKEY, MM_USERKEY};
38
39struct mm_keyallowed {
40 enum mm_keytype type;
41 char chost[MAXHOSTNAMELEN];
42 char cuser[MAXLOGNAME];
43};
44
45struct mm_master;
46
47struct passwd;
48DH *mm_choose_dh(int, int, int, int);
49DH *mm_read_moduli(int);
50int mm_key_sign(int, int, u_char **, u_int *, u_char *, u_int);
51void mm_inform_authserv(int, char *, char *);
52struct passwd *mm_getpwnamallow(int, const char *, int *);
53int mm_auth_password(int, char *);
54int mm_key_allowed(int, enum mm_keytype, char *, char *, Key *);
55#define mm_hostbased_key_allowed(x,u,h,z) \
56 mm_key_allowed(x, MM_HOSTKEY, u, h, z)
57#define mm_user_key_allowed(x,z) \
58 mm_key_allowed(x, MM_USERKEY, NULL, NULL, z)
59
60int mm_key_verify(int, enum mm_keytype, char *, char *,
61 Key *, u_char *, u_int, u_char *, u_int);
62
63void mm_terminate(int);
64
65/* Key export functions */
66struct Newkeys *mm_newkeys_from_blob(u_char *, int);
67int mm_newkeys_to_blob(int, u_char **, u_int *);
68
69void mm_apply_keystate(struct mm_master *);
70void mm_get_keystate(int);
71void mm_send_keystate(int);
72
73int mm_pty_allocown(int, int *, int *, char *, int);
74
75/* Functions on the montior that answer unprivileged requests */
76
77int mm_answer_moduli(int, Buffer *);
78int mm_answer_sign(int, Buffer *);
79int mm_answer_pwnamallow(int, Buffer *);
80int mm_answer_authserv(int, Buffer *);
81int mm_answer_authpassword(int, Buffer *);
82int mm_answer_keyallowed(int, Buffer *);
83int mm_answer_keyverify(int, Buffer *);
84int mm_answer_pty(int, Buffer *);
85int mm_answer_term(int, Buffer *);
86
87void mm_request_send(int , enum monitor_reqtype, Buffer *);
88void mm_request_receive(int, Buffer *);
89void mm_request_receive_expect(int, enum monitor_reqtype,
90 Buffer *);
91
92void *mm_zalloc(struct mm_master *, u_int, u_int);
93void mm_zfree(struct mm_master *, void *);
94void mm_init_compression(struct mm_master *);
95
96/* Utility functions */
97
98void pwfree(struct passwd *);
99#endif /* _MM_H_ */