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>
37 #define KERBEROS_APPLE_DEPRECATED(x)
44 #define CONSTRUCTED 32
45 #define APPLICATION 64
46 #define CONTEXT_SPECIFIC 128
47 static int skip_get_number(char **pp
, size_t *lp
, int *np
)
56 fprintf(stderr
, "skip_bad_number: missing number\n");
61 r
= (unsigned char)*p
;
67 fprintf(stderr
, "skip_bad_number: truncated number\n");
72 for (i
= n
; --i
>= 0; ) {
74 r
+= (unsigned char)*p
;
85 afs_krb5_skip_ticket_wrapper(char *tix
, size_t tixlen
, char **enc
, size_t *enclen
)
93 if (*p
!= (char) (CONSTRUCTED
+APPLICATION
+1)) return -1;
95 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
96 if (l
!= num
) return -1;
98 if (*p
!= (char)(CONSTRUCTED
+SEQUENCE
)) return -1;
100 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
101 if (l
!= num
) return -1;
102 if (l
< 1) return -1;
103 if (*p
!= (char)(CONSTRUCTED
+CONTEXT_SPECIFIC
+0)) return -1;
105 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
106 if (l
< num
) return -1;
108 if (l
< 1) return -1;
109 if (*p
!= (char)(CONSTRUCTED
+CONTEXT_SPECIFIC
+1)) return -1;
111 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
112 if (l
< num
) return -1;
114 if (l
< 1) return -1;
115 if (*p
!= (char)(CONSTRUCTED
+CONTEXT_SPECIFIC
+2)) return -1;
117 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
118 if (l
< num
) return -1;
120 if (l
< 1) return -1;
121 if (*p
!= (char)(CONSTRUCTED
+CONTEXT_SPECIFIC
+3)) return -1;
123 if ((code
= skip_get_number(&p
, &l
, &num
))) return code
;
124 if (l
!= num
) return -1;