xref: /freebsd/crypto/heimdal/lib/krb5/codec.c (revision adb0ddaeac0a71a08d6af3a711387b59efcc94b6)
1b528cefcSMark Murray /*
2adb0ddaeSAssar Westerlund  * Copyright (c) 1998 - 2001 Kungliga Tekniska H�gskolan
3b528cefcSMark Murray  * (Royal Institute of Technology, Stockholm, Sweden).
4b528cefcSMark Murray  * All rights reserved.
5b528cefcSMark Murray  *
6b528cefcSMark Murray  * Redistribution and use in source and binary forms, with or without
7b528cefcSMark Murray  * modification, are permitted provided that the following conditions
8b528cefcSMark Murray  * are met:
9b528cefcSMark Murray  *
10b528cefcSMark Murray  * 1. Redistributions of source code must retain the above copyright
11b528cefcSMark Murray  *    notice, this list of conditions and the following disclaimer.
12b528cefcSMark Murray  *
13b528cefcSMark Murray  * 2. Redistributions in binary form must reproduce the above copyright
14b528cefcSMark Murray  *    notice, this list of conditions and the following disclaimer in the
15b528cefcSMark Murray  *    documentation and/or other materials provided with the distribution.
16b528cefcSMark Murray  *
17b528cefcSMark Murray  * 3. Neither the name of the Institute nor the names of its contributors
18b528cefcSMark Murray  *    may be used to endorse or promote products derived from this software
19b528cefcSMark Murray  *    without specific prior written permission.
20b528cefcSMark Murray  *
21b528cefcSMark Murray  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22b528cefcSMark Murray  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23b528cefcSMark Murray  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24b528cefcSMark Murray  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25b528cefcSMark Murray  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26b528cefcSMark Murray  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27b528cefcSMark Murray  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28b528cefcSMark Murray  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29b528cefcSMark Murray  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30b528cefcSMark Murray  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31b528cefcSMark Murray  * SUCH DAMAGE.
32b528cefcSMark Murray  */
33b528cefcSMark Murray 
34b528cefcSMark Murray #include "krb5_locl.h"
35b528cefcSMark Murray 
36adb0ddaeSAssar Westerlund RCSID("$Id: codec.c,v 1.7 2001/05/16 22:08:08 assar Exp $");
37b528cefcSMark Murray 
38b528cefcSMark Murray krb5_error_code
39b528cefcSMark Murray krb5_decode_EncTicketPart (krb5_context context,
40b528cefcSMark Murray 			   const void *data,
41b528cefcSMark Murray 			   size_t length,
42b528cefcSMark Murray 			   EncTicketPart *t,
43b528cefcSMark Murray 			   size_t *len)
44b528cefcSMark Murray {
45adb0ddaeSAssar Westerlund     return decode_EncTicketPart(data, length, t, len);
46b528cefcSMark Murray }
47b528cefcSMark Murray 
48b528cefcSMark Murray krb5_error_code
49b528cefcSMark Murray krb5_encode_EncTicketPart (krb5_context context,
50b528cefcSMark Murray 			   void *data,
51b528cefcSMark Murray 			   size_t length,
52b528cefcSMark Murray 			   EncTicketPart *t,
53b528cefcSMark Murray 			   size_t *len)
54b528cefcSMark Murray {
55adb0ddaeSAssar Westerlund     return encode_EncTicketPart(data, length, t, len);
56b528cefcSMark Murray }
57b528cefcSMark Murray 
58b528cefcSMark Murray krb5_error_code
59b528cefcSMark Murray krb5_decode_EncASRepPart (krb5_context context,
60b528cefcSMark Murray 			  const void *data,
61b528cefcSMark Murray 			  size_t length,
62b528cefcSMark Murray 			  EncASRepPart *t,
63b528cefcSMark Murray 			  size_t *len)
64b528cefcSMark Murray {
65adb0ddaeSAssar Westerlund     return decode_EncASRepPart(data, length, t, len);
66b528cefcSMark Murray }
67b528cefcSMark Murray 
68b528cefcSMark Murray krb5_error_code
69b528cefcSMark Murray krb5_encode_EncASRepPart (krb5_context context,
70b528cefcSMark Murray 			  void *data,
71b528cefcSMark Murray 			  size_t length,
72b528cefcSMark Murray 			  EncASRepPart *t,
73b528cefcSMark Murray 			  size_t *len)
74b528cefcSMark Murray {
75adb0ddaeSAssar Westerlund     return encode_EncASRepPart(data, length, t, len);
76b528cefcSMark Murray }
77b528cefcSMark Murray 
78b528cefcSMark Murray krb5_error_code
79b528cefcSMark Murray krb5_decode_EncTGSRepPart (krb5_context context,
80b528cefcSMark Murray 			   const void *data,
81b528cefcSMark Murray 			   size_t length,
82b528cefcSMark Murray 			   EncTGSRepPart *t,
83b528cefcSMark Murray 			   size_t *len)
84b528cefcSMark Murray {
85adb0ddaeSAssar Westerlund     return decode_EncTGSRepPart(data, length, t, len);
86b528cefcSMark Murray }
87b528cefcSMark Murray 
88b528cefcSMark Murray krb5_error_code
89b528cefcSMark Murray krb5_encode_EncTGSRepPart (krb5_context context,
90b528cefcSMark Murray 			   void *data,
91b528cefcSMark Murray 			   size_t length,
92b528cefcSMark Murray 			   EncTGSRepPart *t,
93b528cefcSMark Murray 			   size_t *len)
94b528cefcSMark Murray {
95adb0ddaeSAssar Westerlund     return encode_EncTGSRepPart(data, length, t, len);
96b528cefcSMark Murray }
97b528cefcSMark Murray 
98b528cefcSMark Murray krb5_error_code
99b528cefcSMark Murray krb5_decode_EncAPRepPart (krb5_context context,
100b528cefcSMark Murray 			  const void *data,
101b528cefcSMark Murray 			  size_t length,
102b528cefcSMark Murray 			  EncAPRepPart *t,
103b528cefcSMark Murray 			  size_t *len)
104b528cefcSMark Murray {
105adb0ddaeSAssar Westerlund     return decode_EncAPRepPart(data, length, t, len);
106b528cefcSMark Murray }
107b528cefcSMark Murray 
108b528cefcSMark Murray krb5_error_code
109b528cefcSMark Murray krb5_encode_EncAPRepPart (krb5_context context,
110b528cefcSMark Murray 			  void *data,
111b528cefcSMark Murray 			  size_t length,
112b528cefcSMark Murray 			  EncAPRepPart *t,
113b528cefcSMark Murray 			  size_t *len)
114b528cefcSMark Murray {
115adb0ddaeSAssar Westerlund     return encode_EncAPRepPart(data, length, t, len);
116b528cefcSMark Murray }
117b528cefcSMark Murray 
118b528cefcSMark Murray krb5_error_code
119b528cefcSMark Murray krb5_decode_Authenticator (krb5_context context,
120b528cefcSMark Murray 			   const void *data,
121b528cefcSMark Murray 			   size_t length,
122b528cefcSMark Murray 			   Authenticator *t,
123b528cefcSMark Murray 			   size_t *len)
124b528cefcSMark Murray {
125adb0ddaeSAssar Westerlund     return decode_Authenticator(data, length, t, len);
126b528cefcSMark Murray }
127b528cefcSMark Murray 
128b528cefcSMark Murray krb5_error_code
129b528cefcSMark Murray krb5_encode_Authenticator (krb5_context context,
130b528cefcSMark Murray 			   void *data,
131b528cefcSMark Murray 			   size_t length,
132b528cefcSMark Murray 			   Authenticator *t,
133b528cefcSMark Murray 			   size_t *len)
134b528cefcSMark Murray {
135adb0ddaeSAssar Westerlund     return encode_Authenticator(data, length, t, len);
136b528cefcSMark Murray }
137b528cefcSMark Murray 
138b528cefcSMark Murray krb5_error_code
139b528cefcSMark Murray krb5_decode_EncKrbCredPart (krb5_context context,
140b528cefcSMark Murray 			    const void *data,
141b528cefcSMark Murray 			    size_t length,
142b528cefcSMark Murray 			    EncKrbCredPart *t,
143b528cefcSMark Murray 			    size_t *len)
144b528cefcSMark Murray {
145b528cefcSMark Murray     return decode_EncKrbCredPart(data, length, t, len);
146b528cefcSMark Murray }
147b528cefcSMark Murray 
148b528cefcSMark Murray krb5_error_code
149b528cefcSMark Murray krb5_encode_EncKrbCredPart (krb5_context context,
150b528cefcSMark Murray 			    void *data,
151b528cefcSMark Murray 			    size_t length,
152b528cefcSMark Murray 			    EncKrbCredPart *t,
153b528cefcSMark Murray 			    size_t *len)
154b528cefcSMark Murray {
155b528cefcSMark Murray     return encode_EncKrbCredPart (data, length, t, len);
156b528cefcSMark Murray }
157b528cefcSMark Murray 
158b528cefcSMark Murray krb5_error_code
159b528cefcSMark Murray krb5_decode_ETYPE_INFO (krb5_context context,
160b528cefcSMark Murray 			const void *data,
161b528cefcSMark Murray 			size_t length,
162b528cefcSMark Murray 			ETYPE_INFO *t,
163b528cefcSMark Murray 			size_t *len)
164b528cefcSMark Murray {
165b528cefcSMark Murray     return decode_ETYPE_INFO(data, length, t, len);
166b528cefcSMark Murray }
167b528cefcSMark Murray 
168b528cefcSMark Murray krb5_error_code
169b528cefcSMark Murray krb5_encode_ETYPE_INFO (krb5_context context,
170b528cefcSMark Murray 			void *data,
171b528cefcSMark Murray 			size_t length,
172b528cefcSMark Murray 			ETYPE_INFO *t,
173b528cefcSMark Murray 			size_t *len)
174b528cefcSMark Murray {
175b528cefcSMark Murray     return encode_ETYPE_INFO (data, length, t, len);
176b528cefcSMark Murray }
177