xref: /titanic_41/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/princ_xdr.h (revision 2dd2efa5a06a9befe46075cf41e16f57533c9f98)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef _PRINC_XDR_H
7 #define _PRINC_XDR_H 1
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #include <sys/types.h>
12 #include <krb5.h>
13 #include <kdb.h>
14 /* Solaris Kerberos: gssrpc not supported */
15 #if 0 /************** Begin IFDEF'ed OUT *******************************/
16 #include <gssrpc/rpc.h>
17 #else
18 #include <rpc/rpc.h>
19 #endif /**************** END IFDEF'ed OUT *******************************/
20 
21 #ifdef HAVE_MEMORY_H
22 #include <memory.h>
23 #endif
24 
25 #define OSA_ADB_PRINC_VERSION_1  0x12345C01
26 /* Solaris Kerberos: */
27 #ifndef xdralloc_getdata
28 extern caddr_t xdralloc_getdata(XDR *xdrs);
29 #endif
30 #ifndef xdralloc_create
31 extern void xdralloc_create(XDR *xdrs, enum xdr_op op);
32 #endif
33 
34 typedef struct _osa_pw_hist_t {
35   int n_key_data;
36   krb5_key_data *key_data;
37 } osa_pw_hist_ent, *osa_pw_hist_t;
38 
39 typedef struct _osa_princ_ent_t {
40   int                         version;
41   char                        *policy;
42   long                        aux_attributes;
43   unsigned int                old_key_len;
44   unsigned int                old_key_next;
45   krb5_kvno                   admin_history_kvno;
46   osa_pw_hist_ent             *old_keys;
47 } osa_princ_ent_rec, *osa_princ_ent_t;
48 
49 bool_t
50 ldap_xdr_krb5_ui_2(XDR *xdrs, krb5_ui_2 *objp);
51 
52 bool_t
53 ldap_xdr_krb5_int16(XDR *xdrs, krb5_int16 *objp);
54 
55 bool_t
56 ldap_xdr_nullstring(XDR *xdrs, char **objp);
57 
58 bool_t
59 ldap_xdr_krb5_kvno(XDR *xdrs, krb5_kvno *objp);
60 
61 bool_t
62 ldap_xdr_krb5_key_data(XDR *xdrs, krb5_key_data *objp);
63 
64 bool_t
65 ldap_xdr_osa_pw_hist_ent(XDR *xdrs, osa_pw_hist_ent *objp);
66 
67 bool_t
68 ldap_xdr_osa_princ_ent_rec(XDR *xdrs, osa_princ_ent_t objp);
69 
70 void
71 ldap_osa_free_princ_ent(osa_princ_ent_t val);
72 
73 krb5_error_code
74 krb5_lookup_tl_kadm_data(krb5_tl_data *tl_data, osa_princ_ent_rec *princ_entry);
75 
76 /* Solaris Kerberos: adding support for key history in LDAP KDB */
77 krb5_error_code
78 krb5_update_tl_kadm_data(char *, krb5_tl_data *, krb5_tl_data *);
79 
80 #endif
81