xref: /OK3568_Linux_fs/kernel/fs/cifs/cifs_spnego.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  *   fs/cifs/cifs_spnego.h -- SPNEGO upcall management for CIFS
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  *   Copyright (c) 2007 Red Hat, Inc.
5*4882a593Smuzhiyun  *   Author(s): Jeff Layton (jlayton@redhat.com)
6*4882a593Smuzhiyun  *              Steve French (sfrench@us.ibm.com)
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *   This library is free software; you can redistribute it and/or modify
9*4882a593Smuzhiyun  *   it under the terms of the GNU Lesser General Public License as published
10*4882a593Smuzhiyun  *   by the Free Software Foundation; either version 2.1 of the License, or
11*4882a593Smuzhiyun  *   (at your option) any later version.
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  *   This library is distributed in the hope that it will be useful,
14*4882a593Smuzhiyun  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15*4882a593Smuzhiyun  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
16*4882a593Smuzhiyun  *   the GNU Lesser General Public License for more details.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  *   You should have received a copy of the GNU Lesser General Public License
19*4882a593Smuzhiyun  *   along with this library; if not, write to the Free Software
20*4882a593Smuzhiyun  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #ifndef _CIFS_SPNEGO_H
24*4882a593Smuzhiyun #define _CIFS_SPNEGO_H
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #define CIFS_SPNEGO_UPCALL_VERSION 2
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun /*
29*4882a593Smuzhiyun  * The version field should always be set to CIFS_SPNEGO_UPCALL_VERSION.
30*4882a593Smuzhiyun  * The flags field is for future use. The request-key callout should set
31*4882a593Smuzhiyun  * sesskey_len and secblob_len, and then concatenate the SessKey+SecBlob
32*4882a593Smuzhiyun  * and stuff it in the data field.
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun struct cifs_spnego_msg {
35*4882a593Smuzhiyun 	uint32_t	version;
36*4882a593Smuzhiyun 	uint32_t	flags;
37*4882a593Smuzhiyun 	uint32_t	sesskey_len;
38*4882a593Smuzhiyun 	uint32_t	secblob_len;
39*4882a593Smuzhiyun 	uint8_t		data[1];
40*4882a593Smuzhiyun };
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #ifdef __KERNEL__
43*4882a593Smuzhiyun extern struct key_type cifs_spnego_key_type;
44*4882a593Smuzhiyun extern struct key *cifs_get_spnego_key(struct cifs_ses *sesInfo);
45*4882a593Smuzhiyun #endif /* KERNEL */
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #endif /* _CIFS_SPNEGO_H */
48