2
0

krb5_asn.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. /* krb5_asn.h */
  2. /* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project,
  3. ** using ocsp/{*.h,*asn*.c} as a starting point
  4. */
  5. /* ====================================================================
  6. * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * 3. All advertising materials mentioning features or use of this
  21. * software must display the following acknowledgment:
  22. * "This product includes software developed by the OpenSSL Project
  23. * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
  24. *
  25. * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
  26. * endorse or promote products derived from this software without
  27. * prior written permission. For written permission, please contact
  28. * openssl-core@openssl.org.
  29. *
  30. * 5. Products derived from this software may not be called "OpenSSL"
  31. * nor may "OpenSSL" appear in their names without prior written
  32. * permission of the OpenSSL Project.
  33. *
  34. * 6. Redistributions of any form whatsoever must retain the following
  35. * acknowledgment:
  36. * "This product includes software developed by the OpenSSL Project
  37. * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
  38. *
  39. * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
  40. * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  41. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  42. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
  43. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  44. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  45. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  46. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  47. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  48. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  49. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  50. * OF THE POSSIBILITY OF SUCH DAMAGE.
  51. * ====================================================================
  52. *
  53. * This product includes cryptographic software written by Eric Young
  54. * (eay@cryptsoft.com). This product includes software written by Tim
  55. * Hudson (tjh@cryptsoft.com).
  56. *
  57. */
  58. #ifndef HEADER_KRB5_ASN_H
  59. #define HEADER_KRB5_ASN_H
  60. /*
  61. #include <krb5.h>
  62. */
  63. #include <openssl/safestack.h>
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67. /* ASN.1 from Kerberos RFC 1510
  68. */
  69. /* EncryptedData ::= SEQUENCE {
  70. ** etype[0] INTEGER, -- EncryptionType
  71. ** kvno[1] INTEGER OPTIONAL,
  72. ** cipher[2] OCTET STRING -- ciphertext
  73. ** }
  74. */
  75. typedef struct krb5_encdata_st
  76. {
  77. ASN1_INTEGER *etype;
  78. ASN1_INTEGER *kvno;
  79. ASN1_OCTET_STRING *cipher;
  80. } KRB5_ENCDATA;
  81. DECLARE_STACK_OF(KRB5_ENCDATA)
  82. /* PrincipalName ::= SEQUENCE {
  83. ** name-type[0] INTEGER,
  84. ** name-string[1] SEQUENCE OF GeneralString
  85. ** }
  86. */
  87. typedef struct krb5_princname_st
  88. {
  89. ASN1_INTEGER *nametype;
  90. STACK_OF(ASN1_GENERALSTRING) *namestring;
  91. } KRB5_PRINCNAME;
  92. DECLARE_STACK_OF(KRB5_PRINCNAME)
  93. /* Ticket ::= [APPLICATION 1] SEQUENCE {
  94. ** tkt-vno[0] INTEGER,
  95. ** realm[1] Realm,
  96. ** sname[2] PrincipalName,
  97. ** enc-part[3] EncryptedData
  98. ** }
  99. */
  100. typedef struct krb5_tktbody_st
  101. {
  102. ASN1_INTEGER *tktvno;
  103. ASN1_GENERALSTRING *realm;
  104. KRB5_PRINCNAME *sname;
  105. KRB5_ENCDATA *encdata;
  106. } KRB5_TKTBODY;
  107. typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
  108. DECLARE_STACK_OF(KRB5_TKTBODY)
  109. /* AP-REQ ::= [APPLICATION 14] SEQUENCE {
  110. ** pvno[0] INTEGER,
  111. ** msg-type[1] INTEGER,
  112. ** ap-options[2] APOptions,
  113. ** ticket[3] Ticket,
  114. ** authenticator[4] EncryptedData
  115. ** }
  116. **
  117. ** APOptions ::= BIT STRING {
  118. ** reserved(0), use-session-key(1), mutual-required(2) }
  119. */
  120. typedef struct krb5_ap_req_st
  121. {
  122. ASN1_INTEGER *pvno;
  123. ASN1_INTEGER *msgtype;
  124. ASN1_BIT_STRING *apoptions;
  125. KRB5_TICKET *ticket;
  126. KRB5_ENCDATA *authenticator;
  127. } KRB5_APREQBODY;
  128. typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
  129. DECLARE_STACK_OF(KRB5_APREQBODY)
  130. /* Authenticator Stuff */
  131. /* Checksum ::= SEQUENCE {
  132. ** cksumtype[0] INTEGER,
  133. ** checksum[1] OCTET STRING
  134. ** }
  135. */
  136. typedef struct krb5_checksum_st
  137. {
  138. ASN1_INTEGER *ctype;
  139. ASN1_OCTET_STRING *checksum;
  140. } KRB5_CHECKSUM;
  141. DECLARE_STACK_OF(KRB5_CHECKSUM)
  142. /* EncryptionKey ::= SEQUENCE {
  143. ** keytype[0] INTEGER,
  144. ** keyvalue[1] OCTET STRING
  145. ** }
  146. */
  147. typedef struct krb5_encryptionkey_st
  148. {
  149. ASN1_INTEGER *ktype;
  150. ASN1_OCTET_STRING *keyvalue;
  151. } KRB5_ENCKEY;
  152. DECLARE_STACK_OF(KRB5_ENCKEY)
  153. /* AuthorizationData ::= SEQUENCE OF SEQUENCE {
  154. ** ad-type[0] INTEGER,
  155. ** ad-data[1] OCTET STRING
  156. ** }
  157. */
  158. typedef struct krb5_authorization_st
  159. {
  160. ASN1_INTEGER *adtype;
  161. ASN1_OCTET_STRING *addata;
  162. } KRB5_AUTHDATA;
  163. DECLARE_STACK_OF(KRB5_AUTHDATA)
  164. /* -- Unencrypted authenticator
  165. ** Authenticator ::= [APPLICATION 2] SEQUENCE {
  166. ** authenticator-vno[0] INTEGER,
  167. ** crealm[1] Realm,
  168. ** cname[2] PrincipalName,
  169. ** cksum[3] Checksum OPTIONAL,
  170. ** cusec[4] INTEGER,
  171. ** ctime[5] KerberosTime,
  172. ** subkey[6] EncryptionKey OPTIONAL,
  173. ** seq-number[7] INTEGER OPTIONAL,
  174. ** authorization-data[8] AuthorizationData OPTIONAL
  175. ** }
  176. */
  177. typedef struct krb5_authenticator_st
  178. {
  179. ASN1_INTEGER *avno;
  180. ASN1_GENERALSTRING *crealm;
  181. KRB5_PRINCNAME *cname;
  182. KRB5_CHECKSUM *cksum;
  183. ASN1_INTEGER *cusec;
  184. ASN1_GENERALIZEDTIME *ctime;
  185. KRB5_ENCKEY *subkey;
  186. ASN1_INTEGER *seqnum;
  187. KRB5_AUTHDATA *authorization;
  188. } KRB5_AUTHENTBODY;
  189. typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
  190. DECLARE_STACK_OF(KRB5_AUTHENTBODY)
  191. /* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
  192. ** type *name##_new(void);
  193. ** void name##_free(type *a);
  194. ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
  195. ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
  196. ** type *d2i_##name(type **a, const unsigned char **in, long len);
  197. ** int i2d_##name(type *a, unsigned char **out);
  198. ** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
  199. */
  200. DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
  201. DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
  202. DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
  203. DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
  204. DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
  205. DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
  206. DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
  207. DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
  208. DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
  209. DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
  210. DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
  211. /* BEGIN ERROR CODES */
  212. /* The following lines are auto generated by the script mkerr.pl. Any changes
  213. * made after this point may be overwritten when the script is next run.
  214. */
  215. #ifdef __cplusplus
  216. }
  217. #endif
  218. #endif