2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
16 #include "afs/kauth.h"
17 #else /* defined(UKERNEL) */
19 #include <afs/kauth.h>
20 #endif /* defined(UKERNEL) */
22 #define MAXBS 2048 /* try to avoid horrible allocs */
25 xdr_ka_CBS(XDR * x, struct ka_CBS *abbs)
28 if (x->x_op == XDR_FREE) {
33 if (x->x_op == XDR_ENCODE) {
34 xdr_afs_int32(x, &abbs->SeqLen);
35 xdr_opaque(x, abbs->SeqBody, abbs->SeqLen);
38 xdr_afs_int32(x, &len);
39 if (len < 0 || len > MAXBS)
42 abbs->SeqBody = (char *)malloc(len);
44 xdr_opaque(x, abbs->SeqBody, len);
50 xdr_ka_BBS(XDR * x, struct ka_BBS *abbs)
52 afs_int32 maxLen, len;
53 if (x->x_op == XDR_FREE) {
58 if (x->x_op == XDR_ENCODE) {
59 if (!xdr_afs_int32(x, &abbs->MaxSeqLen)
60 || !xdr_afs_int32(x, &abbs->SeqLen)
61 || !xdr_opaque(x, abbs->SeqBody, abbs->SeqLen))
65 if (!xdr_afs_int32(x, &maxLen) || !xdr_afs_int32(x, &len) || (len < 0)
66 || (len > MAXBS) || (len > maxLen))
69 abbs->SeqBody = (char *)malloc(maxLen);
70 abbs->MaxSeqLen = maxLen;
72 if (!xdr_opaque(x, abbs->SeqBody, len))