summaryrefslogtreecommitdiffstats
path: root/src/lib/kadm5/ovsec_glue.c
blob: 6118282df3232aa78e8b34ec8343967a682e167c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#define USE_KADM5_API_VERSION 1
#include <kadm5/admin.h>

ovsec_kadm_ret_t ovsec_kadm_init_with_password(char *client_name, char *pass,
					       char *service_name,
					       char *realm,
					       krb5_ui_4 struct_version,
					       krb5_ui_4 api_version,
					       void **server_handle)
{
     return kadm5_init_with_password(client_name, pass, service_name,
				     realm, struct_version, api_version, 
				     server_handle);
}

ovsec_kadm_ret_t ovsec_kadm_init_with_skey(char *client_name, char *keytab,
					   char *service_name,
					   char *realm,
					   krb5_ui_4 struct_version,
					   krb5_ui_4 api_version,
					   void **server_handle)
{
     return kadm5_init_with_skey(client_name, keytab, service_name, realm,
				 struct_version, api_version,
				 server_handle);
}

ovsec_kadm_ret_t ovsec_kadm_init(char *client_name, char *from_stash,
				 char *service_name,
				 char *realm,
				 krb5_ui_4 struct_version,
				 krb5_ui_4 api_version,
				 void **server_handle)
{
     return kadm5_init(client_name, from_stash, service_name,
		       realm, struct_version, api_version,
		       server_handle);
}

ovsec_kadm_ret_t ovsec_kadm_destroy(void *server_handle)
{
     return kadm5_destroy(server_handle);
}

ovsec_kadm_ret_t ovsec_kadm_flush(void *server_handle)
{
     return kadm5_flush(server_handle);
}

ovsec_kadm_ret_t ovsec_kadm_create_principal(void *server_handle,
					     ovsec_kadm_principal_ent_t entry,
					     long mask,
					     char *password)
{
     return kadm5_create_principal(server_handle,
				   (kadm5_principal_ent_t)
				   entry, mask, password);
}


ovsec_kadm_ret_t ovsec_kadm_delete_principal(void *server_handle,
					     krb5_principal principal)
{
     return kadm5_delete_principal(server_handle, principal);
}


ovsec_kadm_ret_t ovsec_kadm_modify_principal(void *server_handle,
					     ovsec_kadm_principal_ent_t entry,
					     long mask)
{
     return kadm5_modify_principal(server_handle,
				   (kadm5_principal_ent_t) entry, mask);
}


ovsec_kadm_ret_t ovsec_kadm_rename_principal(void *server_handle,
					     krb5_principal source,
					     krb5_principal target)
{
     return kadm5_rename_principal(server_handle, source, target);
}

ovsec_kadm_ret_t ovsec_kadm_get_principal(void *server_handle,
					  krb5_principal principal,
					  ovsec_kadm_principal_ent_t *entry)
{
     return kadm5_get_principal(server_handle, principal,
				(kadm5_principal_ent_t *) entry);
}

ovsec_kadm_ret_t ovsec_kadm_chpass_principal(void *server_handle,
					     krb5_principal principal,
					     char *password)
{
     return kadm5_chpass_principal(server_handle, principal, password);
}

ovsec_kadm_ret_t ovsec_kadm_chpass_principal_util(void *server_handle,
						  krb5_principal princ,
						  char *new_pw, 
						  char **ret_pw,
						  char *msg_ret)
{
     return kadm5_chpass_principal_util(server_handle, princ, new_pw,
						  ret_pw, msg_ret);
}

ovsec_kadm_ret_t ovsec_kadm_randkey_principal(void *server_handle,
					      krb5_principal principal,
					      krb5_keyblock **key)
{
     return kadm5_randkey_principal(server_handle, principal, key);
}

ovsec_kadm_ret_t ovsec_kadm_create_policy(void *server_handle,
					  ovsec_kadm_policy_ent_t entry,
					  long mask)
{
     return kadm5_create_policy(server_handle,
				(kadm5_policy_ent_t) entry, mask); 
}

ovsec_kadm_ret_t ovsec_kadm_delete_policy(void *server_handle,
					  ovsec_kadm_policy_t name)
{
     return kadm5_delete_policy(server_handle, (kadm5_policy_t) name);
}

ovsec_kadm_ret_t ovsec_kadm_modify_policy(void *server_handle,
					  ovsec_kadm_policy_ent_t entry,
					  long mask)
{
     return kadm5_modify_policy(server_handle,
				(kadm5_policy_ent_t) entry, mask); 
}


ovsec_kadm_ret_t ovsec_kadm_get_policy(void *server_handle,
				       ovsec_kadm_policy_t name,
				       ovsec_kadm_policy_ent_t *entry)
{
     return kadm5_get_policy(server_handle, (kadm5_policy_t) name,
			     (kadm5_policy_ent_t *) entry);
}


ovsec_kadm_ret_t ovsec_kadm_free_policy_ent(void *server_handle,
					    ovsec_kadm_policy_ent_t val)
{
     return kadm5_free_policy_ent(server_handle, (kadm5_policy_ent_t) val);
}

ovsec_kadm_ret_t ovsec_kadm_free_name_list(void *server_handle,
					   char **names, int count) 
{
     return kadm5_free_name_list(server_handle, names, count);
}

ovsec_kadm_ret_t
ovsec_kadm_free_principal_ent(void *server_handle,
			      ovsec_kadm_principal_ent_t val)
{
     return kadm5_free_principal_ent(server_handle,
				     (kadm5_principal_ent_t) val);
}

ovsec_kadm_ret_t ovsec_kadm_get_privs(void *server_handle, long *privs)
{
     return kadm5_get_privs(server_handle, privs);
}

ovsec_kadm_ret_t ovsec_kadm_get_principals(void *server_handle,
					   char *exp,
					   char ***princs,
					   int *count)
{
     return kadm5_get_principals(server_handle, exp, princs, count);
}

ovsec_kadm_ret_t ovsec_kadm_get_policies(void *server_handle,
					   char *exp,
					   char ***pols,
					   int *count)
{
     return kadm5_get_policies(server_handle, exp, pols, count);
}