This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
[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 typedef struct interactive_password
39 {
40         OWF_INFO          lm_owf;              /* LM OWF Password */
41         OWF_INFO          nt_owf;              /* NT OWF Password */
42 } auth_interactive_password;
43
44 typedef struct usersupplied_info
45 {
46         
47         DATA_BLOB lm_resp;
48         DATA_BLOB nt_resp;
49         auth_interactive_password * interactive_password;
50         DATA_BLOB plaintext_password;
51         
52         BOOL encrypted;
53         
54         uint32 ntlmssp_flags;
55
56         DATA_BLOB sec_blob;
57
58         AUTH_STR           client_domain;          /* domain name string */
59         AUTH_STR           domain;               /* domain name after mapping */
60         AUTH_STR           internal_username;    /* username after mapping */
61         AUTH_STR           smb_name;        /* username before mapping */
62         AUTH_STR           wksta_name;           /* workstation name (netbios calling name) unicode string */
63         
64 } auth_usersupplied_info;
65
66 #define SAM_FILL_NAME  0x01
67 #define SAM_FILL_INFO3 0x02
68 #define SAM_FILL_SAM   0x04
69 #define SAM_FILL_UNIX  0x08
70 #define SAM_FILL_ALL (SAM_FILL_NAME | SAM_FILL_INFO3 | SAM_FILL_SAM | SAM_FILL_UNIX)
71
72 typedef struct serversupplied_info
73 {
74         BOOL guest;
75         
76         /* This groups info is needed for when we become_user() for this uid */
77         int n_groups;
78         gid_t *groups;
79
80         /* NT group information taken from the info3 structure */
81
82         int n_rids;
83         uint32 *group_rids;
84         
85         uchar session_key[16];
86         
87         uint8 first_8_lm_hash[8];
88
89         uint32 sam_fill_level;  /* How far is this structure filled? */
90
91         SAM_ACCOUNT *sam_account;
92 } auth_serversupplied_info;
93
94 #endif /* _SMBAUTH_H_ */