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 #if !defined(lint) && !defined(__CODECENTER__)
32 static char *rcsid
= "$Header$";
35 #include <sys/types.h>
36 #include "server_internal.h"
38 #include <rpc/rpc.h> /* SUNWresync121 XXX */
39 #include "admin_xdr.h"
45 xdr_krb5_key_data(XDR
*xdrs
, krb5_key_data
*objp
)
49 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_ver
))
51 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_kvno
))
53 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[0]))
55 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[1]))
58 if (!xdr_krb5_ui_2(xdrs
, (krb5_ui_2
*)&objp
->key_data_length
[0]))
60 if (!xdr_krb5_ui_2(xdrs
, (krb5_ui_2
*)&objp
->key_data_length
[1]))
63 tmp
= (unsigned int) objp
->key_data_length
[0];
64 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[0],
68 tmp
= (unsigned int) objp
->key_data_length
[1];
69 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[1],
73 /* don't need to copy tmp out, since key_data_length will be set
74 by the above encoding. */
80 xdr_osa_pw_hist_ent(XDR
*xdrs
, osa_pw_hist_ent
*objp
)
82 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->key_data
,
83 (u_int
*) &objp
->n_key_data
, ~0,
84 sizeof(krb5_key_data
),
91 xdr_osa_princ_ent_rec(XDR
*xdrs
, osa_princ_ent_t objp
)
95 objp
->version
= OSA_ADB_PRINC_VERSION_1
;
98 if (!xdr_int(xdrs
, &objp
->version
))
102 if (!xdr_int(xdrs
, &objp
->version
))
104 if (objp
->version
!= OSA_ADB_PRINC_VERSION_1
)
109 if (!xdr_nullstring(xdrs
, &objp
->policy
))
111 if (!xdr_long(xdrs
, &objp
->aux_attributes
))
113 if (!xdr_u_int(xdrs
, &objp
->old_key_next
))
115 if (!xdr_krb5_kvno(xdrs
, &objp
->admin_history_kvno
))
117 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->old_keys
,
118 (unsigned int *) &objp
->old_key_len
, ~0,
119 sizeof(osa_pw_hist_ent
),
120 xdr_osa_pw_hist_ent
))
126 osa_free_princ_ent(osa_princ_ent_t val
)
130 xdrmem_create(&xdrs
, NULL
, 0, XDR_FREE
);
132 xdr_osa_princ_ent_rec(&xdrs
, val
);