Remove local main() definition.
[dragonfly.git] / crypto / openssh / monitor_wrap.h
1 /*      $OpenBSD: monitor_wrap.h,v 1.8 2002/09/26 11:38:43 markus Exp $ */
2 /*      $FreeBSD: src/crypto/openssh/monitor_wrap.h,v 1.2.2.2 2003/02/03 17:31:07 des Exp $     */
3 /*      $DragonFly: src/crypto/openssh/Attic/monitor_wrap.h,v 1.2 2003/06/17 04:24:36 dillon Exp $      */
4
5 /*
6  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 #ifndef _MM_WRAP_H_
31 #define _MM_WRAP_H_
32 #include "key.h"
33 #include "buffer.h"
34
35 extern int use_privsep;
36 #define PRIVSEP(x)      (use_privsep ? mm_##x : x)
37
38 enum mm_keytype {MM_NOKEY, MM_HOSTKEY, MM_USERKEY, MM_RSAHOSTKEY, MM_RSAUSERKEY};
39
40 struct monitor;
41 struct mm_master;
42 struct passwd;
43 struct Authctxt;
44
45 DH *mm_choose_dh(int, int, int);
46 int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int);
47 void mm_inform_authserv(char *, char *);
48 struct passwd *mm_getpwnamallow(const char *);
49 char *mm_auth2_read_banner(void);
50 int mm_auth_password(struct Authctxt *, char *);
51 int mm_key_allowed(enum mm_keytype, char *, char *, Key *);
52 int mm_user_key_allowed(struct passwd *, Key *);
53 int mm_hostbased_key_allowed(struct passwd *, char *, char *, Key *);
54 int mm_auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *);
55 int mm_key_verify(Key *, u_char *, u_int, u_char *, u_int);
56 int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **);
57 int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *);
58 BIGNUM *mm_auth_rsa_generate_challenge(Key *);
59
60 #ifdef USE_PAM
61 void mm_start_pam(char *);
62 void *mm_pam_init_ctx(struct Authctxt *);
63 int mm_pam_query(void *, char **, char **, u_int *, char ***, u_int **);
64 int mm_pam_respond(void *, u_int, char **);
65 void mm_pam_free_ctx(void *);
66 #endif
67
68 void mm_terminate(void);
69 int mm_pty_allocate(int *, int *, char *, int);
70 void mm_session_pty_cleanup2(void *);
71
72 /* SSHv1 interfaces */
73 void mm_ssh1_session_id(u_char *);
74 int mm_ssh1_session_key(BIGNUM *);
75
76 /* Key export functions */
77 struct Newkeys *mm_newkeys_from_blob(u_char *, int);
78 int mm_newkeys_to_blob(int, u_char **, u_int *);
79
80 void monitor_apply_keystate(struct monitor *);
81 void mm_get_keystate(struct monitor *);
82 void mm_send_keystate(struct monitor*);
83
84 /* bsdauth */
85 int mm_bsdauth_query(void *, char **, char **, u_int *, char ***, u_int **);
86 int mm_bsdauth_respond(void *, u_int, char **);
87
88 /* skey */
89 int mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **);
90 int mm_skey_respond(void *, u_int, char **);
91
92 /* auth_krb */
93 #ifdef KRB4
94 int mm_auth_krb4(struct Authctxt *, void *, char **, void *);
95 #endif
96 #ifdef KRB5
97 /* auth and reply are really krb5_data objects, but we don't want to
98  * include all of the krb5 headers here */
99 int mm_auth_krb5(void *authctxt, void *auth, char **client, void *reply);
100 #endif
101
102 /* zlib allocation hooks */
103
104 void *mm_zalloc(struct mm_master *, u_int, u_int);
105 void mm_zfree(struct mm_master *, void *);
106 void mm_init_compression(struct mm_master *);
107
108 #endif /* _MM_H_ */