/ gen / asn1-generate-template / pku2u_asn1.hx
pku2u_asn1.hx
  1  /* Generated from /Users/user/Downloads/darling-Heimdal/lib/asn1/pku2u.asn1 */
  2  /* Do not edit */
  3  
  4  #ifndef __pku2u_asn1_h__
  5  #define __pku2u_asn1_h__
  6  
  7  #include <stddef.h>
  8  #include <time.h>
  9  
 10  #ifndef __asn1_common_definitions__
 11  #define __asn1_common_definitions__
 12  
 13  #ifndef __HEIM_BASE_DATA__
 14  #define __HEIM_BASE_DATA__ 1
 15  struct heim_base_data {
 16      size_t length;
 17      void *data;
 18  };
 19  #endif
 20  
 21  typedef struct heim_integer {
 22    size_t length;
 23    void *data;
 24    int negative;
 25  } heim_integer;
 26  
 27  typedef struct heim_base_data heim_octet_string;
 28  
 29  typedef char *heim_general_string;
 30  
 31  typedef char *heim_utf8_string;
 32  
 33  typedef struct heim_base_data heim_printable_string;
 34  
 35  typedef struct heim_base_data heim_ia5_string;
 36  
 37  typedef struct heim_bmp_string {
 38    size_t length;
 39    uint16_t *data;
 40  } heim_bmp_string;
 41  
 42  typedef struct heim_universal_string {
 43    size_t length;
 44    uint32_t *data;
 45  } heim_universal_string;
 46  
 47  typedef char *heim_visible_string;
 48  
 49  typedef struct heim_oid {
 50    size_t length;
 51    unsigned *components;
 52  } heim_oid;
 53  
 54  typedef struct heim_bit_string {
 55    size_t length;
 56    void *data;
 57  } heim_bit_string;
 58  
 59  typedef struct heim_base_data heim_any;
 60  typedef struct heim_base_data heim_any_set;
 61  
 62  #define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R)                  \
 63    do {                                                         \
 64      (BL) = length_##T((S));                                    \
 65      (B) = malloc((BL));                                        \
 66      if((B) == NULL) {                                          \
 67        (R) = ENOMEM;                                            \
 68      } else {                                                   \
 69        (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \
 70                         (S), (L));                              \
 71        if((R) != 0) {                                           \
 72          free((B));                                             \
 73          (B) = NULL;                                            \
 74        }                                                        \
 75      }                                                          \
 76    } while (0)
 77  
 78  #define ASN1_ENCODE_CFMutableData(_TYPE, _CFDATA, S, R)        \
 79    do {                                                         \
 80      size_t __length##_TYPE;			                  \
 81      size_t __size##_TYPE = length_##_TYPE((S));                \
 82      (_CFDATA) = CFDataCreateMutable(NULL, (__size##_TYPE));    \
 83      if((_CFDATA) == NULL) {                                    \
 84        (R) = ENOMEM;                                            \
 85      } else {                                                   \
 86        CFDataSetLength((_CFDATA), (__size##_TYPE));             \
 87        (R) = encode_##_TYPE(((unsigned char*)(CFDataGetMutableBytePtr((_CFDATA)))) + (__size##_TYPE) - 1, (__size##_TYPE), \
 88                         (S), &(__length##_TYPE));               \
 89        if((R) != 0) {                                           \
 90          CFRelease((_CFDATA));                                  \
 91          (_CFDATA) = NULL;                                      \
 92        } else if((__size##_TYPE) != (__length##_TYPE)) {        \
 93          asn1_abort("internal asn1 error");                   \
 94        }                                                        \
 95      }                                                          \
 96    } while (0)
 97  
 98  #ifdef _WIN32
 99  #ifndef ASN1_LIB
100  #define ASN1EXP  __declspec(dllimport)
101  #else
102  #define ASN1EXP
103  #endif
104  #define ASN1CALL __stdcall
105  #else
106  #define ASN1EXP
107  #define ASN1CALL
108  #endif
109  struct units;
110  
111  #endif
112  
113  #include <krb5_asn1.h>
114  #include <rfc2459_asn1.h>
115  /*
116  GSS_KRB5_FINISHED ::= SEQUENCE {
117    gss-mic         [1] Checksum,
118    ...,
119  }
120  */
121  
122  typedef struct GSS_KRB5_FINISHED {
123    Checksum gss_mic;
124  } GSS_KRB5_FINISHED;
125  
126  ASN1EXP int    ASN1CALL decode_GSS_KRB5_FINISHED(const unsigned char *, size_t, GSS_KRB5_FINISHED *, size_t *);
127  ASN1EXP int    ASN1CALL encode_GSS_KRB5_FINISHED(unsigned char *, size_t, const GSS_KRB5_FINISHED *, size_t *);
128  ASN1EXP size_t ASN1CALL length_GSS_KRB5_FINISHED(const GSS_KRB5_FINISHED *);
129  ASN1EXP int    ASN1CALL copy_GSS_KRB5_FINISHED  (const GSS_KRB5_FINISHED *, GSS_KRB5_FINISHED *);
130  ASN1EXP void   ASN1CALL free_GSS_KRB5_FINISHED  (GSS_KRB5_FINISHED *);
131  
132  
133  /*
134  InitiatorName ::= CHOICE {
135    sanIndex        INTEGER (-2147483648..2147483647),
136    nameNotInCert   [0] GeneralName,
137    ...,
138  }
139  */
140  
141  typedef struct InitiatorName {
142    enum InitiatorName_enum {
143      choice_InitiatorName_asn1_ellipsis = -1,
144  invalid_choice_InitiatorName = 0,
145      choice_InitiatorName_sanIndex,
146      choice_InitiatorName_nameNotInCert
147      /* ... */
148    } element;
149    union {
150      int sanIndex;
151      GeneralName nameNotInCert;
152      heim_octet_string asn1_ellipsis;
153    } u;
154  } InitiatorName;
155  
156  ASN1EXP int    ASN1CALL decode_InitiatorName(const unsigned char *, size_t, InitiatorName *, size_t *);
157  ASN1EXP int    ASN1CALL encode_InitiatorName(unsigned char *, size_t, const InitiatorName *, size_t *);
158  ASN1EXP size_t ASN1CALL length_InitiatorName(const InitiatorName *);
159  ASN1EXP int    ASN1CALL copy_InitiatorName  (const InitiatorName *, InitiatorName *);
160  ASN1EXP void   ASN1CALL free_InitiatorName  (InitiatorName *);
161  
162  
163  /*
164  TargetName ::= CHOICE {
165    exportedTargName   OCTET STRING,
166    generalName        [0] GeneralName,
167    ...,
168  }
169  */
170  
171  typedef struct TargetName {
172    enum TargetName_enum {
173      choice_TargetName_asn1_ellipsis = -1,
174  invalid_choice_TargetName = 0,
175      choice_TargetName_exportedTargName,
176      choice_TargetName_generalName
177      /* ... */
178    } element;
179    union {
180      heim_octet_string exportedTargName;
181      GeneralName generalName;
182      heim_octet_string asn1_ellipsis;
183    } u;
184  } TargetName;
185  
186  ASN1EXP int    ASN1CALL decode_TargetName(const unsigned char *, size_t, TargetName *, size_t *);
187  ASN1EXP int    ASN1CALL encode_TargetName(unsigned char *, size_t, const TargetName *, size_t *);
188  ASN1EXP size_t ASN1CALL length_TargetName(const TargetName *);
189  ASN1EXP int    ASN1CALL copy_TargetName  (const TargetName *, TargetName *);
190  ASN1EXP void   ASN1CALL free_TargetName  (TargetName *);
191  
192  
193  /*
194  InitiatorNameAssertion ::= SEQUENCE {
195    initiatorName   [0] InitiatorName OPTIONAL,
196    targetName      [1] TargetName OPTIONAL,
197  }
198  */
199  
200  typedef struct InitiatorNameAssertion {
201    InitiatorName *initiatorName;
202    TargetName *targetName;
203  } InitiatorNameAssertion;
204  
205  ASN1EXP int    ASN1CALL decode_InitiatorNameAssertion(const unsigned char *, size_t, InitiatorNameAssertion *, size_t *);
206  ASN1EXP int    ASN1CALL encode_InitiatorNameAssertion(unsigned char *, size_t, const InitiatorNameAssertion *, size_t *);
207  ASN1EXP size_t ASN1CALL length_InitiatorNameAssertion(const InitiatorNameAssertion *);
208  ASN1EXP int    ASN1CALL copy_InitiatorNameAssertion  (const InitiatorNameAssertion *, InitiatorNameAssertion *);
209  ASN1EXP void   ASN1CALL free_InitiatorNameAssertion  (InitiatorNameAssertion *);
210  
211  
212  #endif /* __pku2u_asn1_h__ */