krb5_asn.h

Go to the documentation of this file.
00001 /* krb5_asn.h */
00002 /* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project,
00003 ** using ocsp/{*.h,*asn*.c} as a starting point
00004 */
00005 
00006 /* ====================================================================
00007  * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  *
00016  * 2. Redistributions in binary form must reproduce the above copyright
00017  *    notice, this list of conditions and the following disclaimer in
00018  *    the documentation and/or other materials provided with the
00019  *    distribution.
00020  *
00021  * 3. All advertising materials mentioning features or use of this
00022  *    software must display the following acknowledgment:
00023  *    "This product includes software developed by the OpenSSL Project
00024  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
00025  *
00026  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
00027  *    endorse or promote products derived from this software without
00028  *    prior written permission. For written permission, please contact
00029  *    openssl-core@openssl.org.
00030  *
00031  * 5. Products derived from this software may not be called "OpenSSL"
00032  *    nor may "OpenSSL" appear in their names without prior written
00033  *    permission of the OpenSSL Project.
00034  *
00035  * 6. Redistributions of any form whatsoever must retain the following
00036  *    acknowledgment:
00037  *    "This product includes software developed by the OpenSSL Project
00038  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
00039  *
00040  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
00041  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00042  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00043  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
00044  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00045  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00046  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00047  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00048  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00049  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00050  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00051  * OF THE POSSIBILITY OF SUCH DAMAGE.
00052  * ====================================================================
00053  *
00054  * This product includes cryptographic software written by Eric Young
00055  * (eay@cryptsoft.com).  This product includes software written by Tim
00056  * Hudson (tjh@cryptsoft.com).
00057  *
00058  */
00059 
00060 #ifndef HEADER_KRB5_ASN_H
00061 #define HEADER_KRB5_ASN_H
00062 
00063 /*
00064 #include <krb5.h>
00065 */
00066 #include <openssl/safestack.h>
00067 
00068 #ifdef  __cplusplus
00069 extern "C" {
00070 #endif
00071 
00072 
00073 /* ASN.1 from Kerberos RFC 1510
00074 */
00075 
00076 /* EncryptedData ::=   SEQUENCE {
00077 **    etype[0]                      INTEGER, -- EncryptionType
00078 **    kvno[1]                       INTEGER OPTIONAL,
00079 **    cipher[2]                     OCTET STRING -- ciphertext
00080 ** }
00081 */
00082 typedef  struct   krb5_encdata_st
00083    {
00084    ASN1_INTEGER         *etype;
00085    ASN1_INTEGER         *kvno;
00086    ASN1_OCTET_STRING    *cipher;
00087    }  KRB5_ENCDATA;
00088 
00089 DECLARE_STACK_OF(KRB5_ENCDATA)
00090 
00091 /* PrincipalName ::=   SEQUENCE {
00092 **    name-type[0]                  INTEGER,
00093 **    name-string[1]                SEQUENCE OF GeneralString
00094 ** }
00095 */
00096 typedef  struct   krb5_princname_st
00097    {
00098    ASN1_INTEGER         *nametype;
00099    STACK_OF(ASN1_GENERALSTRING)  *namestring;
00100    }  KRB5_PRINCNAME;
00101 
00102 DECLARE_STACK_OF(KRB5_PRINCNAME)
00103 
00104 
00105 /* Ticket ::=  [APPLICATION 1] SEQUENCE {
00106 **    tkt-vno[0]                    INTEGER,
00107 **    realm[1]                      Realm,
00108 **    sname[2]                      PrincipalName,
00109 **    enc-part[3]                   EncryptedData
00110 ** }
00111 */
00112 typedef  struct   krb5_tktbody_st
00113    {
00114    ASN1_INTEGER         *tktvno;
00115    ASN1_GENERALSTRING      *realm;
00116    KRB5_PRINCNAME       *sname;
00117    KRB5_ENCDATA         *encdata;
00118    }  KRB5_TKTBODY;
00119 
00120 typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
00121 DECLARE_STACK_OF(KRB5_TKTBODY)
00122 
00123 
00124 /* AP-REQ ::=      [APPLICATION 14] SEQUENCE {
00125 **    pvno[0]                       INTEGER,
00126 **    msg-type[1]                   INTEGER,
00127 **    ap-options[2]                 APOptions,
00128 **    ticket[3]                     Ticket,
00129 **    authenticator[4]              EncryptedData
00130 ** }
00131 **
00132 ** APOptions ::=   BIT STRING {
00133 **    reserved(0), use-session-key(1), mutual-required(2) }
00134 */
00135 typedef  struct   krb5_ap_req_st
00136    {
00137    ASN1_INTEGER         *pvno;
00138    ASN1_INTEGER         *msgtype;
00139    ASN1_BIT_STRING         *apoptions;
00140    KRB5_TICKET       *ticket;
00141    KRB5_ENCDATA         *authenticator;
00142    }  KRB5_APREQBODY;
00143 
00144 typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
00145 DECLARE_STACK_OF(KRB5_APREQBODY)
00146 
00147 
00148 /* Authenticator Stuff  */
00149 
00150 
00151 /* Checksum ::=   SEQUENCE {
00152 **    cksumtype[0]                  INTEGER,
00153 **    checksum[1]                   OCTET STRING
00154 ** }
00155 */
00156 typedef  struct   krb5_checksum_st
00157    {
00158    ASN1_INTEGER         *ctype;
00159    ASN1_OCTET_STRING    *checksum;
00160    }  KRB5_CHECKSUM;
00161 
00162 DECLARE_STACK_OF(KRB5_CHECKSUM)
00163 
00164 
00165 /* EncryptionKey ::=   SEQUENCE {
00166 **    keytype[0]                    INTEGER,
00167 **    keyvalue[1]                   OCTET STRING
00168 ** }
00169 */
00170 typedef struct  krb5_encryptionkey_st
00171    {
00172    ASN1_INTEGER         *ktype;
00173    ASN1_OCTET_STRING    *keyvalue;
00174    }  KRB5_ENCKEY;
00175 
00176 DECLARE_STACK_OF(KRB5_ENCKEY)
00177 
00178 
00179 /* AuthorizationData ::=   SEQUENCE OF SEQUENCE {
00180 **    ad-type[0]                    INTEGER,
00181 **              ad-data[1]                    OCTET STRING
00182 ** }
00183 */
00184 typedef struct krb5_authorization_st
00185    {
00186    ASN1_INTEGER         *adtype;
00187    ASN1_OCTET_STRING    *addata;
00188    }  KRB5_AUTHDATA;
00189 
00190 DECLARE_STACK_OF(KRB5_AUTHDATA)
00191 
00192 
00193 /* -- Unencrypted authenticator
00194 ** Authenticator ::=    [APPLICATION 2] SEQUENCE    {
00195 **    authenticator-vno[0]          INTEGER,
00196 **    crealm[1]                     Realm,
00197 **    cname[2]                      PrincipalName,
00198 **    cksum[3]                      Checksum OPTIONAL,
00199 **    cusec[4]                      INTEGER,
00200 **    ctime[5]                      KerberosTime,
00201 **    subkey[6]                     EncryptionKey OPTIONAL,
00202 **    seq-number[7]                 INTEGER OPTIONAL,
00203 **    authorization-data[8]         AuthorizationData OPTIONAL
00204 ** }
00205 */
00206 typedef struct krb5_authenticator_st
00207    {
00208    ASN1_INTEGER         *avno;
00209    ASN1_GENERALSTRING      *crealm;
00210    KRB5_PRINCNAME       *cname;
00211    KRB5_CHECKSUM        *cksum;
00212    ASN1_INTEGER         *cusec;
00213    ASN1_GENERALIZEDTIME    *ctime;
00214    KRB5_ENCKEY       *subkey;
00215    ASN1_INTEGER         *seqnum;
00216    KRB5_AUTHDATA        *authorization;
00217    }  KRB5_AUTHENTBODY;
00218 
00219 typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
00220 DECLARE_STACK_OF(KRB5_AUTHENTBODY)
00221 
00222 
00223 /*  DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
00224 ** type *name##_new(void);
00225 ** void name##_free(type *a);
00226 ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
00227 **  DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
00228 **   type *d2i_##name(type **a, const unsigned char **in, long len);
00229 **   int i2d_##name(type *a, unsigned char **out);
00230 **   DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
00231 */
00232 
00233 DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
00234 DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
00235 DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
00236 DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
00237 DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
00238 DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
00239 
00240 DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
00241 DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
00242 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
00243 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
00244 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
00245 
00246 
00247 /* BEGIN ERROR CODES */
00248 /* The following lines are auto generated by the script mkerr.pl. Any changes
00249  * made after this point may be overwritten when the script is next run.
00250  */
00251 
00252 #ifdef  __cplusplus
00253 }
00254 #endif
00255 #endif
00256 

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6