xref: /titanic_50/usr/src/lib/smbsrv/libsmbns/common/smbns_krb.h (revision 380789fc80376bd1573770361cb177a08c7e3524)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SMBSRV_SMB_KRB5_H
27 #define	_SMBSRV_SMB_KRB5_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <gssapi/gssapi.h>
32 #include <kerberosv5/krb5.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 extern gss_OID gss_nt_user_name;
39 extern gss_OID gss_nt_machine_uid_name;
40 extern gss_OID gss_nt_string_uid_name;
41 extern gss_OID gss_nt_service_name;
42 extern gss_OID gss_nt_exported_name;
43 extern gss_OID gss_nt_service_name_v2;
44 
45 int krb5_acquire_cred_kinit(char *, char *, gss_cred_id_t *,
46     gss_OID *, int *, char *);
47 int krb5_establish_sec_ctx_kinit(char *, char *, gss_cred_id_t,
48     gss_ctx_id_t *, gss_name_t, gss_OID, int, gss_buffer_desc *,
49     gss_buffer_desc *, OM_uint32 *, OM_uint32 *, int *,
50     int *, OM_uint32 *, char *);
51 int smb_krb5_ctx_init(krb5_context *ctx);
52 void smb_krb5_ctx_fini(krb5_context ctx);
53 int smb_krb5_get_principal(krb5_context ctx, char *princ_str,
54     krb5_principal *princ);
55 int smb_krb5_setpwd(krb5_context ctx, krb5_principal princ, char *passwd);
56 int smb_krb5_write_keytab(krb5_context ctx, krb5_principal princ,
57     char *fname, krb5_kvno kvno, char *passwd, krb5_enctype *enctypes,
58     int enctype_count);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* _SMBSRV_SMB_KRB5_H */
65