4 * The Regents of the University of Michigan
7 * Permission is granted to use, copy, create derivative works
8 * and redistribute this software and such derivative works
9 * for any purpose, so long as the name of the University of
10 * Michigan is not used in any advertising or publicity
11 * pertaining to the use or distribution of this software
12 * without specific, written prior authorization. If the
13 * above copyright notice or any other identification of the
14 * University of Michigan is included in any copy of any
15 * portion of this software, then the disclaimer below must
18 * This software is provided as is, without representation
19 * from the University of Michigan as to its fitness for any
20 * purpose, and without warranty by the University of
21 * Michigan of any kind, either express or implied, including
22 * without limitation the implied warranties of
23 * merchantability and fitness for a particular purpose. The
24 * regents of the University of Michigan shall not be liable
25 * for any damages, including special, indirect, incidental, or
26 * consequential damages, with respect to any claim arising
27 * out of or in connection with the use of the software, even
28 * if it has been or is hereafter advised of the possibility of
32 #include <afsconfig.h>
33 #include <afs/param.h>
40 #define CONSTRUCTED 32
41 #define APPLICATION 64
42 #define CONTEXT_SPECIFIC 128
43 static int skip_get_number(char **pp, size_t *lp, int *np)
52 fprintf(stderr, "skip_bad_number: missing number\n");
57 r = (unsigned char)*p;
63 fprintf(stderr, "skip_bad_number: truncated number\n");
68 for (i = n; --i >= 0; ) {
70 r += (unsigned char)*p;
81 afs_krb5_skip_ticket_wrapper(char *tix, size_t tixlen, char **enc, size_t *enclen)
89 if (*p != (char) (CONSTRUCTED+APPLICATION+1)) return -1;
91 if ((code = skip_get_number(&p, &l, &num))) return code;
92 if (l != num) return -1;
94 if (*p != (char)(CONSTRUCTED+SEQUENCE)) return -1;
96 if ((code = skip_get_number(&p, &l, &num))) return code;
97 if (l != num) return -1;
99 if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+0)) return -1;
101 if ((code = skip_get_number(&p, &l, &num))) return code;
102 if (l < num) return -1;
104 if (l < 1) return -1;
105 if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+1)) return -1;
107 if ((code = skip_get_number(&p, &l, &num))) return code;
108 if (l < num) return -1;
110 if (l < 1) return -1;
111 if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+2)) return -1;
113 if ((code = skip_get_number(&p, &l, &num))) return code;
114 if (l < num) return -1;
116 if (l < 1) return -1;
117 if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+3)) return -1;
119 if ((code = skip_get_number(&p, &l, &num))) return code;
120 if (l != num) return -1;