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