summaryrefslogtreecommitdiffstats
path: root/src/tests/asn.1/ktest.h
blob: fa33ceffd40ea48970b0290a439d591496727cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#ifndef __KTEST_H__
#define __KTEST_H__

#include "k5-int.h"
#include "kdb.h"

#define SAMPLE_USEC 123456
#define SAMPLE_TIME 771228197  /* Fri Jun 10  6:03:17 GMT 1994 */
#define SAMPLE_SEQ_NUMBER 17
#define SAMPLE_NONCE 42
#define SAMPLE_FLAGS 0xFEDCBA98
#define SAMPLE_ERROR 0x3C;
krb5_error_code ktest_make_sample_data
	(krb5_data *d);
krb5_error_code ktest_make_sample_authenticator
	(krb5_authenticator *a);
  krb5_error_code ktest_make_sample_principal
	(krb5_principal *p);
  krb5_error_code ktest_make_sample_checksum
	(krb5_checksum *cs);
  krb5_error_code ktest_make_sample_keyblock
	(krb5_keyblock *kb);
krb5_error_code ktest_make_sample_ticket
	(krb5_ticket *tkt);
  krb5_error_code ktest_make_sample_enc_data
	(krb5_enc_data *ed);
krb5_error_code ktest_make_sample_enc_tkt_part
	(krb5_enc_tkt_part *etp);
  krb5_error_code ktest_make_sample_transited
	(krb5_transited *t);
  krb5_error_code ktest_make_sample_ticket_times
	(krb5_ticket_times *tt);
  krb5_error_code ktest_make_sample_addresses
	(krb5_address ***caddrs);
  krb5_error_code ktest_make_sample_address
	(krb5_address *a);
  krb5_error_code ktest_make_sample_authorization_data
	(krb5_authdata ***ad);
  krb5_error_code ktest_make_sample_authdata
	(krb5_authdata *ad);
krb5_error_code ktest_make_sample_enc_kdc_rep_part
	(krb5_enc_kdc_rep_part *ekr);
krb5_error_code ktest_make_sample_kdc_req
	(krb5_kdc_req *kr);

  krb5_error_code ktest_make_sample_last_req
	(krb5_last_req_entry ***lr);
  krb5_error_code ktest_make_sample_last_req_entry
	(krb5_last_req_entry **lre);
krb5_error_code ktest_make_sample_kdc_rep
	(krb5_kdc_rep *kdcr);
  krb5_error_code ktest_make_sample_pa_data_array
	(krb5_pa_data ***pad);
  krb5_error_code ktest_make_sample_empty_pa_data_array
	(krb5_pa_data ***pad);
  krb5_error_code ktest_make_sample_pa_data
	(krb5_pa_data *pad);
krb5_error_code ktest_make_sample_ap_req
	(krb5_ap_req *ar);
krb5_error_code ktest_make_sample_ap_rep
	(krb5_ap_rep *ar);
krb5_error_code ktest_make_sample_ap_rep_enc_part
	(krb5_ap_rep_enc_part *arep);
krb5_error_code ktest_make_sample_kdc_req_body
	(krb5_kdc_req *krb);
krb5_error_code ktest_make_sample_safe
	(krb5_safe *s);
krb5_error_code ktest_make_sample_priv
	(krb5_priv *p);
krb5_error_code ktest_make_sample_priv_enc_part
	(krb5_priv_enc_part *pep);
krb5_error_code ktest_make_sample_cred
	(krb5_cred *c);
krb5_error_code ktest_make_sample_cred_enc_part
	(krb5_cred_enc_part *cep);
  krb5_error_code ktest_make_sample_sequence_of_ticket
	(krb5_ticket ***sot);
krb5_error_code ktest_make_sample_error
	(krb5_error *kerr);
krb5_error_code ktest_make_sequence_of_cred_info
	(krb5_cred_info ***soci);
  krb5_error_code ktest_make_sample_cred_info
	(krb5_cred_info *ci);
krb5_error_code ktest_make_sample_passwd_phrase_element
	(passwd_phrase_element *ppe);
krb5_error_code ktest_make_sample_krb5_pwd_data
	(krb5_pwd_data *pd);
krb5_error_code ktest_make_sample_alt_method
	(krb5_alt_method *am);

krb5_error_code ktest_make_sample_etype_info
    (krb5_etype_info_entry *** p);
krb5_error_code ktest_make_sample_etype_info2
    (krb5_etype_info_entry *** p);
krb5_error_code ktest_make_sample_pa_enc_ts
	(krb5_pa_enc_ts *am);
krb5_error_code ktest_make_sample_sam_challenge
	(krb5_sam_challenge * p);
krb5_error_code ktest_make_sample_sam_response
	(krb5_sam_response * p);
krb5_error_code ktest_make_sample_sam_response_2
	(krb5_sam_response_2 * p);
krb5_error_code ktest_make_sample_sam_key(krb5_sam_key *p);
krb5_error_code ktest_make_sample_enc_sam_response_enc
	(krb5_enc_sam_response_enc *p);
krb5_error_code ktest_make_sample_predicted_sam_response(krb5_predicted_sam_response *p);
krb5_error_code ktest_make_sample_enc_sam_response_enc_2(krb5_enc_sam_response_enc_2 *p);
krb5_error_code ktest_make_sample_pa_s4u_x509_user(krb5_pa_s4u_x509_user *p);
krb5_error_code ktest_make_sample_ad_kdcissued(krb5_ad_kdcissued *p);

#ifdef ENABLE_LDAP
krb5_error_code ktest_make_sample_ldap_seqof_key_data(ldap_seqof_key_data * p);
#endif
/*----------------------------------------------------------------------*/

void ktest_empty_authorization_data
	(krb5_authdata **ad);
void ktest_destroy_authorization_data
	(krb5_authdata ***ad);
  void ktest_destroy_authorization_data
	(krb5_authdata ***ad);
void ktest_empty_addresses
	(krb5_address **a);
void ktest_destroy_addresses
	(krb5_address ***a);
  void ktest_destroy_address
	(krb5_address **a);
void ktest_empty_pa_data_array
	(krb5_pa_data **pad);
void ktest_destroy_pa_data_array
	(krb5_pa_data ***pad);
  void ktest_destroy_pa_data
	(krb5_pa_data **pad);

void ktest_destroy_data
	(krb5_data **d);
void ktest_empty_data
	(krb5_data *d);
void ktest_destroy_principal
	(krb5_principal *p);
void ktest_destroy_checksum
	(krb5_checksum **cs);
void ktest_empty_keyblock
	(krb5_keyblock *kb);
void ktest_destroy_keyblock
	(krb5_keyblock **kb);
void ktest_destroy_authdata
	(krb5_authdata **ad);
void ktest_destroy_sequence_of_integer
	(long **soi);
void ktest_destroy_sequence_of_ticket
	(krb5_ticket ***sot);
  void ktest_destroy_ticket
	(krb5_ticket **tkt);
void ktest_empty_ticket
	(krb5_ticket *tkt);
void ktest_destroy_enc_data
	(krb5_enc_data *ed);
void ktest_empty_error
        (krb5_error * kerr);
void ktest_destroy_etype_info_entry
	(krb5_etype_info_entry *i);
void ktest_destroy_etype_info
	(krb5_etype_info_entry **info);

void ktest_empty_kdc_req
        (krb5_kdc_req *kr);
void ktest_empty_kdc_rep
        (krb5_kdc_rep *kr);

void ktest_empty_authenticator
        (krb5_authenticator *a);
void ktest_empty_enc_tkt_part
        (krb5_enc_tkt_part * etp);
void ktest_destroy_enc_tkt_part
        (krb5_enc_tkt_part ** etp);
void ktest_empty_enc_kdc_rep_part
        (krb5_enc_kdc_rep_part * ekr);
void ktest_destroy_transited
        (krb5_transited * t);
void ktest_empty_ap_rep
        (krb5_ap_rep * ar);
void ktest_empty_ap_req
        (krb5_ap_req * ar);
void ktest_empty_cred_enc_part
        (krb5_cred_enc_part * cep);
void ktest_destroy_cred_info
        (krb5_cred_info ** ci);
void ktest_destroy_sequence_of_cred_info
        (krb5_cred_info *** soci);
void ktest_empty_safe
        (krb5_safe * s);
void ktest_empty_priv
        (krb5_priv * p);
void ktest_empty_priv_enc_part
        (krb5_priv_enc_part * pep);
void ktest_empty_cred
        (krb5_cred * c);
void ktest_destroy_last_req
        (krb5_last_req_entry *** lr);
void ktest_empty_ap_rep_enc_part
        (krb5_ap_rep_enc_part * arep);
void ktest_empty_passwd_phrase_element
        (passwd_phrase_element * ppe);
void ktest_empty_pwd_data
        (krb5_pwd_data * pd);
void ktest_empty_alt_method
	(krb5_alt_method *am);
void ktest_empty_sam_challenge
	(krb5_sam_challenge * p);
void ktest_empty_sam_response
	(krb5_sam_response * p);
void ktest_empty_sam_key(krb5_sam_key *p);
void ktest_empty_enc_sam_response_enc(krb5_enc_sam_response_enc *p);
void ktest_empty_predicted_sam_response(krb5_predicted_sam_response *p);
void ktest_empty_sam_response_2(krb5_sam_response_2 *p);
void ktest_empty_enc_sam_response_enc_2(krb5_enc_sam_response_enc_2 *p);
void ktest_empty_pa_s4u_x509_user(krb5_pa_s4u_x509_user *p);
void ktest_empty_ad_kdcissued(krb5_ad_kdcissued *p);

#ifdef ENABLE_LDAP
void ktest_empty_ldap_seqof_key_data(krb5_context, ldap_seqof_key_data *p);
#endif

extern krb5_context test_context;
extern char *sample_principal_name;

#endif