monitor_wrap.h revision 98937
198675Sdes/* $OpenBSD: monitor_wrap.h,v 1.5 2002/05/12 23:53:45 djm Exp $ */ 298675Sdes 398675Sdes/* 498675Sdes * Copyright 2002 Niels Provos <provos@citi.umich.edu> 598675Sdes * All rights reserved. 698675Sdes * 798675Sdes * Redistribution and use in source and binary forms, with or without 898675Sdes * modification, are permitted provided that the following conditions 998675Sdes * are met: 1098675Sdes * 1. Redistributions of source code must retain the above copyright 1198675Sdes * notice, this list of conditions and the following disclaimer. 1298675Sdes * 2. Redistributions in binary form must reproduce the above copyright 1398675Sdes * notice, this list of conditions and the following disclaimer in the 1498675Sdes * documentation and/or other materials provided with the distribution. 1598675Sdes * 1698675Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1798675Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1898675Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1998675Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2098675Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2198675Sdes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2298675Sdes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2398675Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2498675Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2598675Sdes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2698675Sdes */ 2798675Sdes 2898675Sdes#ifndef _MM_WRAP_H_ 2998675Sdes#define _MM_WRAP_H_ 3098675Sdes#include "key.h" 3198675Sdes#include "buffer.h" 3298675Sdes 3398675Sdesextern int use_privsep; 3498675Sdes#define PRIVSEP(x) (use_privsep ? mm_##x : x) 3598675Sdes 3698675Sdesenum mm_keytype {MM_NOKEY, MM_HOSTKEY, MM_USERKEY, MM_RSAHOSTKEY, MM_RSAUSERKEY}; 3798675Sdes 3898675Sdesstruct monitor; 3998675Sdesstruct mm_master; 4098675Sdesstruct passwd; 4198675Sdesstruct Authctxt; 4298675Sdes 4398675SdesDH *mm_choose_dh(int, int, int); 4498675Sdesint mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); 4598675Sdesvoid mm_inform_authserv(char *, char *); 4698675Sdesstruct passwd *mm_getpwnamallow(const char *); 4798675Sdeschar* mm_auth2_read_banner(void); 4898675Sdesint mm_auth_password(struct Authctxt *, char *); 4998675Sdesint mm_key_allowed(enum mm_keytype, char *, char *, Key *); 5098675Sdesint mm_user_key_allowed(struct passwd *, Key *); 5198675Sdesint mm_hostbased_key_allowed(struct passwd *, char *, char *, Key *); 5298675Sdesint mm_auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *); 5398675Sdesint mm_key_verify(Key *, u_char *, u_int, u_char *, u_int); 5498675Sdesint mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); 5598675Sdesint mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); 5698675SdesBIGNUM *mm_auth_rsa_generate_challenge(Key *); 5798675Sdes 5898937Sdes#ifdef USE_PAM 5998937Sdesvoid mm_start_pam(char *); 6098937Sdes#endif 6198937Sdes 6298675Sdesvoid mm_terminate(void); 6398675Sdesint mm_pty_allocate(int *, int *, char *, int); 6498675Sdesvoid mm_session_pty_cleanup2(void *); 6598675Sdes 6698675Sdes/* SSHv1 interfaces */ 6798675Sdesvoid mm_ssh1_session_id(u_char *); 6898675Sdesint mm_ssh1_session_key(BIGNUM *); 6998675Sdes 7098675Sdes/* Key export functions */ 7198675Sdesstruct Newkeys *mm_newkeys_from_blob(u_char *, int); 7298675Sdesint mm_newkeys_to_blob(int, u_char **, u_int *); 7398675Sdes 7498675Sdesvoid monitor_apply_keystate(struct monitor *); 7598675Sdesvoid mm_get_keystate(struct monitor *); 7698675Sdesvoid mm_send_keystate(struct monitor*); 7798675Sdes 7898675Sdes/* bsdauth */ 7998675Sdesint mm_bsdauth_query(void *, char **, char **, u_int *, char ***, u_int **); 8098675Sdesint mm_bsdauth_respond(void *, u_int, char **); 8198675Sdes 8298675Sdes/* skey */ 8398675Sdesint mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **); 8498675Sdesint mm_skey_respond(void *, u_int, char **); 8598675Sdes 8698675Sdes/* zlib allocation hooks */ 8798675Sdes 8898675Sdesvoid *mm_zalloc(struct mm_master *, u_int, u_int); 8998675Sdesvoid mm_zfree(struct mm_master *, void *); 9098675Sdesvoid mm_init_compression(struct mm_master *); 9198675Sdes 9298675Sdes#endif /* _MM_H_ */ 93