This patch does a number of things, mostly smaller than they look :-)
[samba.git] / source3 / include / auth.h
1 #ifndef _SMBAUTH_H_
2 #define _SMBAUTH_H_
3 /* 
4    Unix SMB/Netbios implementation.
5    Version 2.2
6    Standardised Authentication types
7    Copyright (C) Andrew Bartlett 2001
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 /* AUTH_STR - string */
25 typedef struct normal_string
26 {
27         int len;
28         char *str;
29 } AUTH_STR;
30
31 /* AUTH_UNISTR - unicode string or buffer */
32 typedef struct unicode_string
33 {
34         int len;
35         uchar *unistr;
36 } AUTH_UNISTR;
37
38 /* AUTH_BUFFER - 8-bit byte buffer */
39 typedef struct auth_buffer
40 {
41         int len;
42         uint8 *buffer;
43 } AUTH_BUFFER;
44
45 typedef struct net_password
46 {
47         AUTH_BUFFER lm_resp;
48         AUTH_BUFFER nt_resp;
49 } auth_net_password;
50
51 typedef struct interactive_password
52 {
53         OWF_INFO          lm_owf;              /* LM OWF Password */
54         OWF_INFO          nt_owf;              /* NT OWF Password */
55 } auth_interactive_password;
56
57 typedef struct plaintext_password
58 {
59         AUTH_STR password;
60 } auth_plaintext_password;
61
62 typedef struct usersupplied_info
63 {
64         
65         AUTH_BUFFER lm_resp;
66         AUTH_BUFFER nt_resp;
67         auth_interactive_password * interactive_password;
68         AUTH_STR plaintext_password;
69         
70         uint8 chal[8];
71
72         AUTH_STR           requested_domain;     /* domain name string */
73         AUTH_STR           domain;               /* domain name after mapping */
74         AUTH_STR           requested_username;
75         AUTH_STR           smb_username;         /* user name string (after mapping) */
76         AUTH_STR           wksta_name;           /* workstation name (netbios calling name) unicode string */
77         
78 } auth_usersupplied_info;
79
80 typedef struct serversupplied_info
81 {
82         AUTH_STR full_name;
83         AUTH_STR unix_user;
84         
85         BOOL guest;
86         
87         uid_t unix_uid;
88         gid_t unix_gid;
89         
90         /* This groups info is needed for when we become_user() for this uid */
91         int n_groups;
92         gid_t *groups;
93         
94         uchar session_key[16];
95         
96 } auth_serversupplied_info;
97
98 #endif /* _SMBAUTH_H_ */