krb5_asn.h 8.0 KB

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