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>
15 #include <afs/kauth.h>
17 #define MAXBS 2048 /* try to avoid horrible allocs */
20 xdr_ka_CBS(XDR * x, struct ka_CBS *abbs)
23 if (x->x_op == XDR_FREE) {
28 if (x->x_op == XDR_ENCODE) {
29 xdr_afs_int32(x, &abbs->SeqLen);
30 xdr_opaque(x, abbs->SeqBody, abbs->SeqLen);
33 xdr_afs_int32(x, &len);
34 if (len < 0 || len > MAXBS)
37 abbs->SeqBody = (char *)malloc(len);
39 xdr_opaque(x, abbs->SeqBody, len);
45 xdr_ka_BBS(XDR * x, struct ka_BBS *abbs)
47 afs_int32 maxLen, len;
48 if (x->x_op == XDR_FREE) {
53 if (x->x_op == XDR_ENCODE) {
54 if (!xdr_afs_int32(x, &abbs->MaxSeqLen)
55 || !xdr_afs_int32(x, &abbs->SeqLen)
56 || !xdr_opaque(x, abbs->SeqBody, abbs->SeqLen))
60 if (!xdr_afs_int32(x, &maxLen) || !xdr_afs_int32(x, &len) || (len < 0)
61 || (len > MAXBS) || (len > maxLen))
64 abbs->SeqBody = (char *)malloc(maxLen);
65 abbs->MaxSeqLen = maxLen;
67 if (!xdr_opaque(x, abbs->SeqBody, len))