1*54925bf6Swillf /*
2*54925bf6Swillf  * kadmin/ldap_util/kdb5_ldap_services.h
3*54925bf6Swillf  */
4*54925bf6Swillf 
5*54925bf6Swillf /* Copyright (c) 2004-2005, Novell, Inc.
6*54925bf6Swillf  * All rights reserved.
7*54925bf6Swillf  *
8*54925bf6Swillf  * Redistribution and use in source and binary forms, with or without
9*54925bf6Swillf  * modification, are permitted provided that the following conditions are met:
10*54925bf6Swillf  *
11*54925bf6Swillf  *   * Redistributions of source code must retain the above copyright notice,
12*54925bf6Swillf  *       this list of conditions and the following disclaimer.
13*54925bf6Swillf  *   * Redistributions in binary form must reproduce the above copyright
14*54925bf6Swillf  *       notice, this list of conditions and the following disclaimer in the
15*54925bf6Swillf  *       documentation and/or other materials provided with the distribution.
16*54925bf6Swillf  *   * The copyright holder's name is not used to endorse or promote products
17*54925bf6Swillf  *       derived from this software without specific prior written permission.
18*54925bf6Swillf  *
19*54925bf6Swillf  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20*54925bf6Swillf  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*54925bf6Swillf  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*54925bf6Swillf  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23*54925bf6Swillf  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*54925bf6Swillf  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*54925bf6Swillf  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*54925bf6Swillf  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*54925bf6Swillf  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*54925bf6Swillf  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*54925bf6Swillf  * POSSIBILITY OF SUCH DAMAGE.
30*54925bf6Swillf  */
31*54925bf6Swillf 
32*54925bf6Swillf #ifndef _KDB5_LDAP_SERVICES_H_
33*54925bf6Swillf #define _KDB5_LDAP_SERVICES_H_
34*54925bf6Swillf 
35*54925bf6Swillf #include "ldap_misc.h"
36*54925bf6Swillf 
37*54925bf6Swillf #define MAX_DN_CHARS 		256
38*54925bf6Swillf #define HOST_INFO_DELIMITER 	'#'
39*54925bf6Swillf #define PROTOCOL_STR_LEN 	3
40*54925bf6Swillf #define PROTOCOL_NUM_UDP 	0
41*54925bf6Swillf #define PROTOCOL_NUM_TCP 	1
42*54925bf6Swillf #define PROTOCOL_DEFAULT_KDC 	PROTOCOL_NUM_UDP
43*54925bf6Swillf #define PROTOCOL_DEFAULT_ADM 	PROTOCOL_NUM_TCP
44*54925bf6Swillf #define PROTOCOL_DEFAULT_PWD 	PROTOCOL_NUM_UDP
45*54925bf6Swillf #define PORT_STR_LEN 		5
46*54925bf6Swillf #define PORT_DEFAULT_KDC 	88
47*54925bf6Swillf #define PORT_DEFAULT_ADM 	749
48*54925bf6Swillf #define PORT_DEFAULT_PWD 	464
49*54925bf6Swillf 
50*54925bf6Swillf #define MAX_LEN 		1024
51*54925bf6Swillf #define MAX_SERVICE_PASSWD_LEN 	256
52*54925bf6Swillf #define RANDOM_PASSWD_LEN 	128
53*54925bf6Swillf 
54*54925bf6Swillf /* Solaris Kerberos: default for the service_passwd file is in osconf.h */
55*54925bf6Swillf #if 0
56*54925bf6Swillf #define DEF_SERVICE_PASSWD_FILE "/usr/local/var/service_passwd"
57*54925bf6Swillf #endif
58*54925bf6Swillf 
59*54925bf6Swillf struct data{
60*54925bf6Swillf     int len;
61*54925bf6Swillf     unsigned char *value;
62*54925bf6Swillf };
63*54925bf6Swillf 
64*54925bf6Swillf extern int enc_password(struct data pwd, struct data *enc_key, struct data *enc_pass);
65*54925bf6Swillf extern int tohex(krb5_data, krb5_data *);
66*54925bf6Swillf 
67*54925bf6Swillf extern void kdb5_ldap_create_service (int argc, char **argv);
68*54925bf6Swillf extern void kdb5_ldap_modify_service (int argc, char **argv);
69*54925bf6Swillf extern void kdb5_ldap_destroy_service(int argc, char **argv);
70*54925bf6Swillf extern void kdb5_ldap_list_services(int argc, char **argv);
71*54925bf6Swillf extern void kdb5_ldap_view_service(int argc, char **argv);
72*54925bf6Swillf extern int  kdb5_ldap_set_service_password(int argc, char **argv);
73*54925bf6Swillf extern void kdb5_ldap_set_service_certificate(int argc, char **argv);
74*54925bf6Swillf extern void print_service_params(krb5_ldap_service_params *lserparams, int mask);
75*54925bf6Swillf extern krb5_error_code convert_realm_name2dn_list(char **list, const char *krbcontainer_loc);
76*54925bf6Swillf extern void kdb5_ldap_stash_service_password(int argc, char **argv);
77*54925bf6Swillf 
78*54925bf6Swillf #endif /* _KDB5_LDAP_SERVICES_H_ */
79