| 1 |
/* Generated from ./kx509.asn1 */ |
| 2 |
/* Do not edit */ |
| 3 |
|
| 4 |
#ifndef __kx509_asn1_h__ |
| 5 |
#define __kx509_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 |
typedef struct heim_base_data heim_octet_string; |
| 20 |
#endif |
| 21 |
|
| 22 |
typedef struct heim_integer { |
| 23 |
size_t length; |
| 24 |
void *data; |
| 25 |
int negative; |
| 26 |
} heim_integer; |
| 27 |
|
| 28 |
typedef char *heim_general_string; |
| 29 |
|
| 30 |
typedef char *heim_utf8_string; |
| 31 |
|
| 32 |
typedef struct heim_base_data heim_printable_string; |
| 33 |
|
| 34 |
typedef struct heim_base_data heim_ia5_string; |
| 35 |
|
| 36 |
typedef struct heim_bmp_string { |
| 37 |
size_t length; |
| 38 |
uint16_t *data; |
| 39 |
} heim_bmp_string; |
| 40 |
|
| 41 |
typedef struct heim_universal_string { |
| 42 |
size_t length; |
| 43 |
uint32_t *data; |
| 44 |
} heim_universal_string; |
| 45 |
|
| 46 |
typedef char *heim_visible_string; |
| 47 |
|
| 48 |
typedef struct heim_oid { |
| 49 |
size_t length; |
| 50 |
unsigned *components; |
| 51 |
} heim_oid; |
| 52 |
|
| 53 |
typedef struct heim_bit_string { |
| 54 |
size_t length; |
| 55 |
void *data; |
| 56 |
} heim_bit_string; |
| 57 |
|
| 58 |
typedef struct heim_base_data heim_any; |
| 59 |
typedef struct heim_base_data heim_any_set; |
| 60 |
|
| 61 |
#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \ |
| 62 |
do { \ |
| 63 |
(BL) = length_##T((S)); \ |
| 64 |
(B) = malloc((BL)); \ |
| 65 |
if((B) == NULL) { \ |
| 66 |
(R) = ENOMEM; \ |
| 67 |
} else { \ |
| 68 |
(R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \ |
| 69 |
(S), (L)); \ |
| 70 |
if((R) != 0) { \ |
| 71 |
free((B)); \ |
| 72 |
(B) = NULL; \ |
| 73 |
} \ |
| 74 |
} \ |
| 75 |
} while (0) |
| 76 |
|
| 77 |
#ifdef _WIN32 |
| 78 |
#ifndef ASN1_LIB |
| 79 |
#define ASN1EXP __declspec(dllimport) |
| 80 |
#else |
| 81 |
#define ASN1EXP |
| 82 |
#endif |
| 83 |
#define ASN1CALL __stdcall |
| 84 |
#else |
| 85 |
#define ASN1EXP |
| 86 |
#define ASN1CALL |
| 87 |
#endif |
| 88 |
struct units; |
| 89 |
|
| 90 |
#endif |
| 91 |
|
| 92 |
/* |
| 93 |
KX509-ERROR-CODE ::= INTEGER { |
| 94 |
KX509_STATUS_GOOD(0), |
| 95 |
KX509_STATUS_CLIENT_BAD(1), |
| 96 |
KX509_STATUS_CLIENT_FIX(2), |
| 97 |
KX509_STATUS_CLIENT_TEMP(3), |
| 98 |
KX509_STATUS_SERVER_BAD(4), |
| 99 |
KX509_STATUS_SERVER_TEMP(5), |
| 100 |
KX509_STATUS_SERVER_KEY(7) |
| 101 |
} |
| 102 |
*/ |
| 103 |
|
| 104 |
typedef enum KX509_ERROR_CODE { |
| 105 |
KX509_STATUS_GOOD = 0, |
| 106 |
KX509_STATUS_CLIENT_BAD = 1, |
| 107 |
KX509_STATUS_CLIENT_FIX = 2, |
| 108 |
KX509_STATUS_CLIENT_TEMP = 3, |
| 109 |
KX509_STATUS_SERVER_BAD = 4, |
| 110 |
KX509_STATUS_SERVER_TEMP = 5, |
| 111 |
KX509_STATUS_SERVER_KEY = 7 |
| 112 |
} KX509_ERROR_CODE; |
| 113 |
|
| 114 |
ASN1EXP int ASN1CALL decode_KX509_ERROR_CODE(const unsigned char *, size_t, KX509_ERROR_CODE *, size_t *); |
| 115 |
ASN1EXP int ASN1CALL encode_KX509_ERROR_CODE(unsigned char *, size_t, const KX509_ERROR_CODE *, size_t *); |
| 116 |
ASN1EXP size_t ASN1CALL length_KX509_ERROR_CODE(const KX509_ERROR_CODE *); |
| 117 |
ASN1EXP int ASN1CALL copy_KX509_ERROR_CODE (const KX509_ERROR_CODE *, KX509_ERROR_CODE *); |
| 118 |
ASN1EXP void ASN1CALL free_KX509_ERROR_CODE (KX509_ERROR_CODE *); |
| 119 |
|
| 120 |
|
| 121 |
/* |
| 122 |
Kx509Request ::= SEQUENCE { |
| 123 |
authenticator OCTET STRING, |
| 124 |
pk-hash OCTET STRING, |
| 125 |
pk-key OCTET STRING, |
| 126 |
} |
| 127 |
*/ |
| 128 |
|
| 129 |
typedef struct Kx509Request { |
| 130 |
heim_octet_string authenticator; |
| 131 |
heim_octet_string pk_hash; |
| 132 |
heim_octet_string pk_key; |
| 133 |
} Kx509Request; |
| 134 |
|
| 135 |
ASN1EXP int ASN1CALL decode_Kx509Request(const unsigned char *, size_t, Kx509Request *, size_t *); |
| 136 |
ASN1EXP int ASN1CALL encode_Kx509Request(unsigned char *, size_t, const Kx509Request *, size_t *); |
| 137 |
ASN1EXP size_t ASN1CALL length_Kx509Request(const Kx509Request *); |
| 138 |
ASN1EXP int ASN1CALL copy_Kx509Request (const Kx509Request *, Kx509Request *); |
| 139 |
ASN1EXP void ASN1CALL free_Kx509Request (Kx509Request *); |
| 140 |
|
| 141 |
|
| 142 |
/* |
| 143 |
Kx509Response ::= SEQUENCE { |
| 144 |
error-code [0] INTEGER (-2147483648..2147483647) OPTIONAL, |
| 145 |
hash [1] OCTET STRING OPTIONAL, |
| 146 |
certificate [2] OCTET STRING OPTIONAL, |
| 147 |
e-text [3] VisibleString OPTIONAL, |
| 148 |
} |
| 149 |
*/ |
| 150 |
|
| 151 |
typedef struct Kx509Response { |
| 152 |
int *error_code; |
| 153 |
heim_octet_string *hash; |
| 154 |
heim_octet_string *certificate; |
| 155 |
heim_visible_string *e_text; |
| 156 |
} Kx509Response; |
| 157 |
|
| 158 |
ASN1EXP int ASN1CALL decode_Kx509Response(const unsigned char *, size_t, Kx509Response *, size_t *); |
| 159 |
ASN1EXP int ASN1CALL encode_Kx509Response(unsigned char *, size_t, const Kx509Response *, size_t *); |
| 160 |
ASN1EXP size_t ASN1CALL length_Kx509Response(const Kx509Response *); |
| 161 |
ASN1EXP int ASN1CALL copy_Kx509Response (const Kx509Response *, Kx509Response *); |
| 162 |
ASN1EXP void ASN1CALL free_Kx509Response (Kx509Response *); |
| 163 |
|
| 164 |
|
| 165 |
#endif /* __kx509_asn1_h__ */ |