2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
8 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
10 * Openvision retains the copyright to derivative works of
11 * this source code. Do *NOT* create a derivative of this
12 * source code before consulting with your legal department.
13 * Do *NOT* integrate *ANY* of this source code into another
14 * product before consulting with your legal department.
16 * For further information, read the top-level Openvision
17 * copyright which is contained in the top-level MIT Kerberos
20 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
26 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
31 static char *rcsid
= "$Header$";
33 #include <sys/types.h>
34 #include "server_internal.h"
36 #include <rpc/rpc.h> /* SUNWresync121 XXX */
37 #include "admin_xdr.h"
43 xdr_krb5_key_data(XDR
*xdrs
, krb5_key_data
*objp
)
47 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_ver
))
49 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_kvno
))
51 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[0]))
53 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[1]))
56 if (!xdr_krb5_ui_2(xdrs
, (krb5_ui_2
*)&objp
->key_data_length
[0]))
58 if (!xdr_krb5_ui_2(xdrs
, (krb5_ui_2
*)&objp
->key_data_length
[1]))
61 tmp
= (unsigned int) objp
->key_data_length
[0];
62 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[0],
66 tmp
= (unsigned int) objp
->key_data_length
[1];
67 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[1],
71 /* don't need to copy tmp out, since key_data_length will be set
72 by the above encoding. */
78 xdr_osa_pw_hist_ent(XDR
*xdrs
, osa_pw_hist_ent
*objp
)
80 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->key_data
,
81 (u_int
*) &objp
->n_key_data
, ~0,
82 sizeof(krb5_key_data
),
89 xdr_osa_princ_ent_rec(XDR
*xdrs
, osa_princ_ent_t objp
)
93 objp
->version
= OSA_ADB_PRINC_VERSION_1
;
96 if (!xdr_int(xdrs
, &objp
->version
))
100 if (!xdr_int(xdrs
, &objp
->version
))
102 if (objp
->version
!= OSA_ADB_PRINC_VERSION_1
)
107 if (!xdr_nullstring(xdrs
, &objp
->policy
))
109 if (!xdr_long(xdrs
, &objp
->aux_attributes
))
111 if (!xdr_u_int(xdrs
, &objp
->old_key_next
))
113 if (!xdr_krb5_kvno(xdrs
, &objp
->admin_history_kvno
))
115 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->old_keys
,
116 (unsigned int *) &objp
->old_key_len
, ~0,
117 sizeof(osa_pw_hist_ent
),
118 xdr_osa_pw_hist_ent
))
124 osa_free_princ_ent(osa_princ_ent_t val
)
128 xdrmem_create(&xdrs
, NULL
, 0, XDR_FREE
);
130 xdr_osa_princ_ent_rec(&xdrs
, val
);