source: trunk/server/source3/libsmb/clikrb5.c

Last change on this file was 862, checked in by Silvan Scherrer, 12 years ago

Samba Server: update trunk to 3.6.23

File size: 55.6 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 simple kerberos5 routines for active directory
4 Copyright (C) Andrew Tridgell 2001
5 Copyright (C) Luke Howard 2002-2003
6 Copyright (C) Andrew Bartlett <[email protected]> 2005
7 Copyright (C) Guenther Deschner 2005-2009
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 3 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, see <http://www.gnu.org/licenses/>.
21*/
22
23#include "includes.h"
24#include "smb_krb5.h"
25#include "../librpc/gen_ndr/krb5pac.h"
26#include "../lib/util/asn1.h"
27#include "libsmb/nmblib.h"
28
29#ifndef KRB5_AUTHDATA_WIN2K_PAC
30#define KRB5_AUTHDATA_WIN2K_PAC 128
31#endif
32
33#ifndef KRB5_AUTHDATA_IF_RELEVANT
34#define KRB5_AUTHDATA_IF_RELEVANT 1
35#endif
36
37#ifdef HAVE_KRB5
38
39#define GSSAPI_CHECKSUM 0x8003 /* Checksum type value for Kerberos */
40#define GSSAPI_BNDLENGTH 16 /* Bind Length (rfc-1964 pg.3) */
41#define GSSAPI_CHECKSUM_SIZE (4+GSSAPI_BNDLENGTH+4) /* Length of bind length,
42 bind field, flags field. */
43
44/* MIT krb5 1.7beta3 (in Ubuntu Karmic) is missing the prototype,
45 but still has the symbol */
46#if !HAVE_DECL_KRB5_AUTH_CON_SET_REQ_CKSUMTYPE
47krb5_error_code krb5_auth_con_set_req_cksumtype(
48 krb5_context context,
49 krb5_auth_context auth_context,
50 krb5_cksumtype cksumtype);
51#endif
52
53/**************************************************************
54 Wrappers around kerberos string functions that convert from
55 utf8 -> unix charset and vica versa.
56**************************************************************/
57