preparing for release of 1.9.16alpha5
[samba.git] / source / smbpass.h
1 #ifndef _SMBPASS_H_
2 #define _SMBPASS_H_
3 /* 
4    Unix SMB/Netbios implementation.
5    Version 1.9.
6    SMB parameters and setup
7    Copyright (C) Jeremy Allison 1995
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 struct smb_passwd {
25         int smb_userid;
26         char *smb_name;
27         unsigned char *smb_passwd; /* Null if no password */
28         unsigned char *smb_nt_passwd; /* Null if no password */
29         /* Other fields / flags may be added later */
30 };
31
32 /* Return a smb_passwd struct given a user name, 0 if fails. */
33 struct smb_passwd *get_smbpwnam(char *user);
34
35 #ifndef uchar
36 #define uchar unsigned char
37 #endif
38
39 /* SMB Encryption functions. */
40 void str_to_key(unsigned char *str,unsigned char *key);
41 void E_P16(uchar *p14,uchar *p16);
42 void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
43 void E_md4hash(uchar *passwd,uchar *p16);
44 void SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
45 void SMB_nt_encrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
46
47 /* Password file lock/unlock routines */
48 int pw_file_lock(char *name, int type, int secs);
49 int pw_file_unlock(int fd);
50 #endif