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 #include <kadm5/admin.h>
32 #include <kadm5/kadm_rpc.h>
38 _xdr_kadm5_principal_ent_rec(XDR
*xdrs
, kadm5_principal_ent_rec
*objp
,
42 xdr_krb5_salttype(XDR
*xdrs
, krb5_int32
*objp
); /* SUNWresync121 XXX */
46 * Purpose: XDR function which serves as a wrapper for xdr_u_int,
47 * to prevent compiler warnings about type clashes between u_int32
50 bool_t
xdr_ui_4(XDR
*xdrs
, krb5_ui_4
*objp
)
52 /* Assumes that krb5_ui_4 and u_int32 are both four bytes long.
53 This should not be a harmful assumption. */
54 return xdr_u_int(xdrs
, (uint32_t *) objp
);
59 * Function: xdr_nullstring
61 * Purpose: XDR function for "strings" that are either NULL-terminated
64 bool_t
xdr_nullstring(XDR
*xdrs
, char **objp
)
68 if (xdrs
->x_op
== XDR_ENCODE
) {
72 size
= strlen(*objp
) + 1;
74 if (! xdr_u_int(xdrs
, &size
)) {
82 } else if (*objp
== NULL
) {
83 *objp
= (char *) mem_alloc(size
);
89 return (xdr_opaque(xdrs
, *objp
, size
));
93 return (xdr_opaque(xdrs
, *objp
, size
));
98 mem_free(*objp
, size
);
107 * Function: xdr_nulltype
109 * Purpose: XDR function for arbitrary pointer types that are either
110 * NULL or contain data.
112 bool_t
xdr_nulltype(XDR
*xdrs
, void **objp
, xdrproc_t proc
)
116 switch (xdrs
->x_op
) {
118 if (!xdr_bool(xdrs
, &null
))
124 return (*proc
)(xdrs
, objp
);
131 if (!xdr_bool(xdrs
, &null
))
134 return (*proc
)(xdrs
, objp
);
139 return (*proc
)(xdrs
, objp
);
147 xdr_krb5_timestamp(XDR
*xdrs
, krb5_timestamp
*objp
)
149 /* This assumes that int32 and krb5_timestamp are the same size.
150 This shouldn't be a problem, since we've got a unit test which
152 if (!xdr_int(xdrs
, (int32_t *) objp
)) {
159 xdr_krb5_kvno(XDR
*xdrs
, krb5_kvno
*objp
)
163 tmp
= '\0'; /* for purify, else xdr_u_char performs a umr */
165 if (xdrs
->x_op
== XDR_ENCODE
)
166 tmp
= (unsigned char) *objp
;
168 if (!xdr_u_char(xdrs
, &tmp
))
171 if (xdrs
->x_op
== XDR_DECODE
)
172 *objp
= (krb5_kvno
) tmp
;
178 xdr_krb5_deltat(XDR
*xdrs
, krb5_deltat
*objp
)
180 /* This assumes that int32 and krb5_deltat are the same size.
181 This shouldn't be a problem, since we've got a unit test which
183 if (!xdr_int(xdrs
, (int32_t *) objp
)) {
190 xdr_krb5_flags(XDR
*xdrs
, krb5_flags
*objp
)
192 /* This assumes that int32 and krb5_flags are the same size.
193 This shouldn't be a problem, since we've got a unit test which
195 if (!xdr_int(xdrs
, (int32_t *) objp
)) {
202 xdr_krb5_ui_4(XDR
*xdrs
, krb5_ui_4
*objp
)
204 if (!xdr_u_int(xdrs
, (uint32_t *) objp
)) {
211 xdr_krb5_int16(XDR
*xdrs
, krb5_int16
*objp
)
217 if (!xdr_int(xdrs
, &tmp
))
220 *objp
= (krb5_int16
) tmp
;
226 * Function: xdr_krb5_ui_2
228 * Purpose: XDR function which serves as a wrapper for xdr_u_int,
229 * to prevent compiler warnings about type clashes between u_int
233 xdr_krb5_ui_2(XDR
*xdrs
, krb5_ui_2
*objp
)
237 tmp
= (unsigned int) *objp
;
239 if (!xdr_u_int(xdrs
, &tmp
))
242 *objp
= (krb5_ui_2
) tmp
;
249 bool_t
xdr_krb5_key_data_nocontents(XDR
*xdrs
, krb5_key_data
*objp
)
252 * Note that this function intentionally DOES NOT tranfer key
253 * length or contents! xdr_krb5_key_data in adb_xdr.c does, but
254 * that is only for use within the server-side library.
258 if (xdrs
->x_op
== XDR_DECODE
)
259 memset((char *) objp
, 0, sizeof(krb5_key_data
));
261 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_ver
)) {
264 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_kvno
)) {
267 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[0])) {
270 if (objp
->key_data_ver
> 1) {
271 if (!xdr_krb5_int16(xdrs
, &objp
->key_data_type
[1])) {
276 * kadm5_get_principal on the server side allocates and returns
277 * key contents when asked. Even though this function refuses to
278 * transmit that data, it still has to *free* the data at the
279 * appropriate time to avoid a memory leak.
281 if (xdrs
->x_op
== XDR_FREE
) {
282 tmp
= (unsigned int) objp
->key_data_length
[0];
283 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[0],
287 tmp
= (unsigned int) objp
->key_data_length
[1];
288 if (!xdr_bytes(xdrs
, (char **) &objp
->key_data_contents
[1],
298 xdr_krb5_key_salt_tuple(XDR
*xdrs
, krb5_key_salt_tuple
*objp
)
300 if (!xdr_krb5_enctype(xdrs
, &objp
->ks_enctype
))
302 if (!xdr_krb5_salttype(xdrs
, &objp
->ks_salttype
))
307 bool_t
xdr_krb5_tl_data(XDR
*xdrs
, krb5_tl_data
**tl_data_head
)
309 krb5_tl_data
*tl
, *tl2
;
313 switch (xdrs
->x_op
) {
315 tl
= tl2
= *tl_data_head
;
317 tl2
= tl
->tl_data_next
;
318 free(tl
->tl_data_contents
);
328 if (!xdr_bool(xdrs
, &more
))
332 if (!xdr_krb5_int16(xdrs
, &tl
->tl_data_type
))
334 len
= tl
->tl_data_length
;
335 if (!xdr_bytes(xdrs
, (char **) &tl
->tl_data_contents
, &len
, ~0))
337 tl
= tl
->tl_data_next
;
344 if (!xdr_bool(xdrs
, &more
))
348 tl2
= (krb5_tl_data
*) malloc(sizeof(krb5_tl_data
));
351 memset((char *) tl2
, 0, sizeof(krb5_tl_data
));
352 if (!xdr_krb5_int16(xdrs
, &tl2
->tl_data_type
))
354 if (!xdr_bytes(xdrs
, (char **)&tl2
->tl_data_contents
, &len
, ~0))
356 tl2
->tl_data_length
= len
;
358 tl2
->tl_data_next
= tl
;
370 xdr_kadm5_ret_t(XDR
*xdrs
, kadm5_ret_t
*objp
)
374 if (xdrs
->x_op
== XDR_ENCODE
)
375 tmp
= (uint32_t) *objp
;
377 if (!xdr_u_int(xdrs
, &tmp
))
380 if (xdrs
->x_op
== XDR_DECODE
)
381 *objp
= (kadm5_ret_t
) tmp
;
386 bool_t
xdr_kadm5_principal_ent_rec_v1(XDR
*xdrs
,
387 kadm5_principal_ent_rec
*objp
)
389 return _xdr_kadm5_principal_ent_rec(xdrs
, objp
, KADM5_API_VERSION_1
);
392 bool_t
xdr_kadm5_principal_ent_rec(XDR
*xdrs
,
393 kadm5_principal_ent_rec
*objp
)
395 return _xdr_kadm5_principal_ent_rec(xdrs
, objp
, KADM5_API_VERSION_2
);
399 _xdr_kadm5_principal_ent_rec(XDR
*xdrs
, kadm5_principal_ent_rec
*objp
,
404 if (!xdr_krb5_principal(xdrs
, &objp
->principal
)) {
407 if (!xdr_krb5_timestamp(xdrs
, &objp
->princ_expire_time
)) {
410 if (!xdr_krb5_timestamp(xdrs
, &objp
->last_pwd_change
)) {
413 if (!xdr_krb5_timestamp(xdrs
, &objp
->pw_expiration
)) {
416 if (!xdr_krb5_deltat(xdrs
, &objp
->max_life
)) {
419 if (v
== KADM5_API_VERSION_1
) {
420 if (!xdr_krb5_principal(xdrs
, &objp
->mod_name
)) {
424 if (!xdr_nulltype(xdrs
, (void **) &objp
->mod_name
,
425 xdr_krb5_principal
)) {
429 if (!xdr_krb5_timestamp(xdrs
, &objp
->mod_date
)) {
432 if (!xdr_krb5_flags(xdrs
, &objp
->attributes
)) {
435 if (!xdr_krb5_kvno(xdrs
, &objp
->kvno
)) {
438 if (!xdr_krb5_kvno(xdrs
, &objp
->mkvno
)) {
441 if (!xdr_nullstring(xdrs
, &objp
->policy
)) {
444 if (!xdr_long(xdrs
, &objp
->aux_attributes
)) {
447 if (v
!= KADM5_API_VERSION_1
) {
448 if (!xdr_krb5_deltat(xdrs
, &objp
->max_renewable_life
)) {
451 if (!xdr_krb5_timestamp(xdrs
, &objp
->last_success
)) {
454 if (!xdr_krb5_timestamp(xdrs
, &objp
->last_failed
)) {
457 if (!xdr_krb5_kvno(xdrs
, &objp
->fail_auth_count
)) {
460 if (!xdr_krb5_int16(xdrs
, &objp
->n_key_data
)) {
463 if (!xdr_krb5_int16(xdrs
, &objp
->n_tl_data
)) {
466 if (!xdr_nulltype(xdrs
, (void **) &objp
->tl_data
,
470 n
= objp
->n_key_data
;
471 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->key_data
,
472 &n
, ~0, sizeof(krb5_key_data
),
473 xdr_krb5_key_data_nocontents
)) {
481 xdr_kadm5_policy_ent_rec(XDR
*xdrs
, kadm5_policy_ent_rec
*objp
)
483 if (!xdr_nullstring(xdrs
, &objp
->policy
)) {
486 /* these all used to be u_int32, but it's stupid for sized types
487 to be exposed at the api, and they're the same as longs on the
489 if (!xdr_long(xdrs
, &objp
->pw_min_life
)) {
492 if (!xdr_long(xdrs
, &objp
->pw_max_life
)) {
495 if (!xdr_long(xdrs
, &objp
->pw_min_length
)) {
498 if (!xdr_long(xdrs
, &objp
->pw_min_classes
)) {
501 if (!xdr_long(xdrs
, &objp
->pw_history_num
)) {
504 if (!xdr_long(xdrs
, &objp
->policy_refcnt
)) {
511 xdr_cprinc_arg(XDR
*xdrs
, cprinc_arg
*objp
)
513 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
516 if (objp
->api_version
== KADM5_API_VERSION_1
) {
517 if (!xdr_kadm5_principal_ent_rec_v1(xdrs
, &objp
->rec
)) {
521 if (!xdr_kadm5_principal_ent_rec(xdrs
, &objp
->rec
)) {
525 if (!xdr_long(xdrs
, &objp
->mask
)) {
528 if (!xdr_nullstring(xdrs
, &objp
->passwd
)) {
535 xdr_cprinc3_arg(XDR
*xdrs
, cprinc3_arg
*objp
)
537 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
540 if (objp
->api_version
== KADM5_API_VERSION_1
) {
541 if (!xdr_kadm5_principal_ent_rec_v1(xdrs
, &objp
->rec
)) {
545 if (!xdr_kadm5_principal_ent_rec(xdrs
, &objp
->rec
)) {
549 if (!xdr_long(xdrs
, &objp
->mask
)) {
552 if (!xdr_array(xdrs
, (caddr_t
*)&objp
->ks_tuple
,
553 (unsigned int *)&objp
->n_ks_tuple
, ~0,
554 sizeof(krb5_key_salt_tuple
),
555 xdr_krb5_key_salt_tuple
)) {
558 if (!xdr_nullstring(xdrs
, &objp
->passwd
)) {
565 xdr_generic_ret(XDR
*xdrs
, generic_ret
*objp
)
567 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
570 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
578 xdr_dprinc_arg(XDR
*xdrs
, dprinc_arg
*objp
)
580 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
583 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
590 xdr_mprinc_arg(XDR
*xdrs
, mprinc_arg
*objp
)
592 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
595 if (objp
->api_version
== KADM5_API_VERSION_1
) {
596 if (!xdr_kadm5_principal_ent_rec_v1(xdrs
, &objp
->rec
)) {
600 if (!xdr_kadm5_principal_ent_rec(xdrs
, &objp
->rec
)) {
604 if (!xdr_long(xdrs
, &objp
->mask
)) {
611 xdr_rprinc_arg(XDR
*xdrs
, rprinc_arg
*objp
)
613 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
616 if (!xdr_krb5_principal(xdrs
, &objp
->src
)) {
619 if (!xdr_krb5_principal(xdrs
, &objp
->dest
)) {
626 xdr_gprincs_arg(XDR
*xdrs
, gprincs_arg
*objp
)
628 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
631 if (!xdr_nullstring(xdrs
, &objp
->exp
)) {
638 xdr_gprincs_ret(XDR
*xdrs
, gprincs_ret
*objp
)
640 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
643 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
646 if (objp
->code
== KADM5_OK
) {
647 if (!xdr_int(xdrs
, &objp
->count
)) {
650 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->princs
,
651 (unsigned int *) &objp
->count
, ~0,
652 sizeof(char *), xdr_nullstring
)) {
661 xdr_chpass_arg(XDR
*xdrs
, chpass_arg
*objp
)
663 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
666 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
669 if (!xdr_nullstring(xdrs
, &objp
->pass
)) {
676 xdr_chpass3_arg(XDR
*xdrs
, chpass3_arg
*objp
)
678 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
681 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
684 if (!xdr_bool(xdrs
, (bool_t
*) &objp
->keepold
)) { /* SUNWresync121 XXX */
687 if (!xdr_array(xdrs
, (caddr_t
*)&objp
->ks_tuple
,
688 (unsigned int*)&objp
->n_ks_tuple
, ~0,
689 sizeof(krb5_key_salt_tuple
),
690 xdr_krb5_key_salt_tuple
)) {
693 if (!xdr_nullstring(xdrs
, &objp
->pass
)) {
700 xdr_setv4key_arg(XDR
*xdrs
, setv4key_arg
*objp
)
702 unsigned int n_keys
= 1;
704 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
707 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
710 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->keyblock
,
712 sizeof(krb5_keyblock
), xdr_krb5_keyblock
)) {
719 xdr_setkey_arg(XDR
*xdrs
, setkey_arg
*objp
)
721 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
724 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
727 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->keyblocks
,
728 (unsigned int *) &objp
->n_keys
, ~0,
729 sizeof(krb5_keyblock
), xdr_krb5_keyblock
)) {
736 xdr_setkey3_arg(XDR
*xdrs
, setkey3_arg
*objp
)
738 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
741 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
744 if (!xdr_bool(xdrs
, (bool_t
*) &objp
->keepold
)) { /* SUNWresync121 XXX */
747 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->ks_tuple
,
748 (unsigned int *) &objp
->n_ks_tuple
, ~0,
749 sizeof(krb5_key_salt_tuple
), xdr_krb5_key_salt_tuple
)) {
752 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->keyblocks
,
753 (unsigned int *) &objp
->n_keys
, ~0,
754 sizeof(krb5_keyblock
), xdr_krb5_keyblock
)) {
761 xdr_chrand_arg(XDR
*xdrs
, chrand_arg
*objp
)
763 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
766 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
773 xdr_chrand3_arg(XDR
*xdrs
, chrand3_arg
*objp
)
775 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
778 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
781 if (!xdr_bool(xdrs
, (bool_t
*) &objp
->keepold
)) { /* SUNWresync121 XXX */
784 if (!xdr_array(xdrs
, (caddr_t
*)&objp
->ks_tuple
,
785 (unsigned int*)&objp
->n_ks_tuple
, ~0,
786 sizeof(krb5_key_salt_tuple
),
787 xdr_krb5_key_salt_tuple
)) {
794 xdr_chrand_ret(XDR
*xdrs
, chrand_ret
*objp
)
796 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
799 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
802 if (objp
->api_version
== KADM5_API_VERSION_1
) {
803 if(objp
->code
== KADM5_OK
) {
804 if (!xdr_krb5_keyblock(xdrs
, &objp
->key
)) {
809 if (objp
->code
== KADM5_OK
) {
810 if (!xdr_array(xdrs
, (char **)&objp
->keys
, (unsigned int *)&objp
->n_keys
, ~0,
811 sizeof(krb5_keyblock
),
821 xdr_gprinc_arg(XDR
*xdrs
, gprinc_arg
*objp
)
823 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
826 if (!xdr_krb5_principal(xdrs
, &objp
->princ
)) {
829 if ((objp
->api_version
> KADM5_API_VERSION_1
) &&
830 !xdr_long(xdrs
, &objp
->mask
)) {
838 xdr_gprinc_ret(XDR
*xdrs
, gprinc_ret
*objp
)
840 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
843 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
846 if(objp
->code
== KADM5_OK
) {
847 if (objp
->api_version
== KADM5_API_VERSION_1
) {
848 if (!xdr_kadm5_principal_ent_rec_v1(xdrs
, &objp
->rec
)) {
852 if (!xdr_kadm5_principal_ent_rec(xdrs
, &objp
->rec
)) {
862 xdr_cpol_arg(XDR
*xdrs
, cpol_arg
*objp
)
864 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
867 if (!xdr_kadm5_policy_ent_rec(xdrs
, &objp
->rec
)) {
870 if (!xdr_long(xdrs
, &objp
->mask
)) {
877 xdr_dpol_arg(XDR
*xdrs
, dpol_arg
*objp
)
879 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
882 if (!xdr_nullstring(xdrs
, &objp
->name
)) {
889 xdr_mpol_arg(XDR
*xdrs
, mpol_arg
*objp
)
891 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
894 if (!xdr_kadm5_policy_ent_rec(xdrs
, &objp
->rec
)) {
897 if (!xdr_long(xdrs
, &objp
->mask
)) {
904 xdr_gpol_arg(XDR
*xdrs
, gpol_arg
*objp
)
906 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
909 if (!xdr_nullstring(xdrs
, &objp
->name
)) {
916 xdr_gpol_ret(XDR
*xdrs
, gpol_ret
*objp
)
918 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
921 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
924 if(objp
->code
== KADM5_OK
) {
925 if (!xdr_kadm5_policy_ent_rec(xdrs
, &objp
->rec
))
933 xdr_gpols_arg(XDR
*xdrs
, gpols_arg
*objp
)
935 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
938 if (!xdr_nullstring(xdrs
, &objp
->exp
)) {
945 xdr_gpols_ret(XDR
*xdrs
, gpols_ret
*objp
)
947 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
950 if (!xdr_kadm5_ret_t(xdrs
, &objp
->code
)) {
953 if (objp
->code
== KADM5_OK
) {
954 if (!xdr_int(xdrs
, &objp
->count
)) {
957 if (!xdr_array(xdrs
, (caddr_t
*) &objp
->pols
,
958 (unsigned int *) &objp
->count
, ~0,
959 sizeof(char *), xdr_nullstring
)) {
967 bool_t
xdr_getprivs_ret(XDR
*xdrs
, getprivs_ret
*objp
)
969 if (!xdr_ui_4(xdrs
, &objp
->api_version
)) {
972 if (! xdr_kadm5_ret_t(xdrs
, &objp
->code
) ||
973 ! xdr_long(xdrs
, &objp
->privs
))
980 xdr_krb5_principal(XDR
*xdrs
, krb5_principal
*objp
)
984 krb5_principal pr
= NULL
;
985 static krb5_context context
= NULL
;
987 /* using a static context here is ugly, but should work
988 ok, and the other solutions are even uglier */
991 kadm5_init_krb5_context(&context
))
997 if((ret
= krb5_unparse_name(context
, *objp
, &p
)) != 0)
1000 if(!xdr_nullstring(xdrs
, &p
))
1005 if(!xdr_nullstring(xdrs
, &p
))
1008 ret
= krb5_parse_name(context
, p
, &pr
);
1018 krb5_free_principal(context
, *objp
);
1025 xdr_krb5_octet(XDR
*xdrs
, krb5_octet
*objp
)
1027 if (!xdr_u_char(xdrs
, objp
))
1033 xdr_krb5_enctype(XDR
*xdrs
, krb5_enctype
*objp
)
1036 * This used to be xdr_krb5_keytype, but keytypes and enctypes have
1037 * been merged into only enctypes. However, randkey_principal
1038 * already ensures that only a key of ENCTYPE_DES_CBC_CRC will be
1039 * returned to v1 clients, and ENCTYPE_DES_CBC_CRC has the same
1040 * value as KEYTYPE_DES used too, which is what all v1 clients
1041 * expect. Therefore, IMHO, just encoding whatever enctype we get
1045 if (!xdr_u_int(xdrs
, (unsigned int *) objp
))
1051 xdr_krb5_salttype(XDR
*xdrs
, krb5_int32
*objp
)
1053 if (!xdr_int(xdrs
, (int32_t *) objp
))
1059 xdr_krb5_keyblock(XDR
*xdrs
, krb5_keyblock
*objp
)
1061 /* XXX This only works because free_keyblock assumes ->contents
1062 is allocated by malloc() */
1064 if(!xdr_krb5_enctype(xdrs
, &objp
->enctype
))
1066 if(!xdr_bytes(xdrs
, (char **) &objp
->contents
, (unsigned int *)