Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/crypto/krb5/src/tests/asn.1/ktest.h
34907 views
1
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/* tests/asn.1/ktest.h */
3
/*
4
* Copyright (C) 1994 by the Massachusetts Institute of Technology.
5
* All rights reserved.
6
*
7
* Export of this software from the United States of America may
8
* require a specific license from the United States Government.
9
* It is the responsibility of any person or organization contemplating
10
* export to obtain such a license before exporting.
11
*
12
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13
* distribute this software and its documentation for any purpose and
14
* without fee is hereby granted, provided that the above copyright
15
* notice appear in all copies and that both that copyright notice and
16
* this permission notice appear in supporting documentation, and that
17
* the name of M.I.T. not be used in advertising or publicity pertaining
18
* to distribution of the software without specific, written prior
19
* permission. Furthermore if you modify this software you must label
20
* your software as modified software and not distribute it in such a
21
* fashion that it might be confused with the original M.I.T. software.
22
* M.I.T. makes no representations about the suitability of
23
* this software for any purpose. It is provided "as is" without express
24
* or implied warranty.
25
*/
26
27
#ifndef __KTEST_H__
28
#define __KTEST_H__
29
30
#include "k5-int.h"
31
#include "k5-spake.h"
32
#include "kdb.h"
33
34
#define SAMPLE_USEC 123456
35
#define SAMPLE_TIME 771228197 /* Fri Jun 10 6:03:17 GMT 1994 */
36
#define SAMPLE_SEQ_NUMBER 17
37
#define SAMPLE_NONCE 42
38
#define SAMPLE_FLAGS 0xFEDCBA98
39
#define SAMPLE_ERROR 0x3C;
40
41
void ktest_make_sample_data(krb5_data *d);
42
void ktest_make_sample_authenticator(krb5_authenticator *a);
43
void ktest_make_sample_principal(krb5_principal *p);
44
void ktest_make_sample_checksum(krb5_checksum *cs);
45
void ktest_make_sample_keyblock(krb5_keyblock *kb);
46
void ktest_make_sample_ticket(krb5_ticket *tkt);
47
void ktest_make_sample_enc_data(krb5_enc_data *ed);
48
void ktest_make_sample_enc_tkt_part(krb5_enc_tkt_part *etp);
49
void ktest_make_sample_transited(krb5_transited *t);
50
void ktest_make_sample_ticket_times(krb5_ticket_times *tt);
51
void ktest_make_sample_addresses(krb5_address ***caddrs);
52
void ktest_make_sample_address(krb5_address *a);
53
void ktest_make_sample_authorization_data(krb5_authdata ***ad);
54
void ktest_make_sample_authdata(krb5_authdata *ad);
55
void ktest_make_sample_enc_kdc_rep_part(krb5_enc_kdc_rep_part *ekr);
56
void ktest_make_sample_kdc_req(krb5_kdc_req *kr);
57
58
void ktest_make_sample_last_req(krb5_last_req_entry ***lr);
59
void ktest_make_sample_last_req_entry(krb5_last_req_entry **lre);
60
void ktest_make_sample_kdc_rep(krb5_kdc_rep *kdcr);
61
void ktest_make_sample_pa_data_array(krb5_pa_data ***pad);
62
void ktest_make_sample_empty_pa_data_array(krb5_pa_data ***pad);
63
void ktest_make_sample_pa_data(krb5_pa_data *pad);
64
void ktest_make_sample_ap_req(krb5_ap_req *ar);
65
void ktest_make_sample_ap_rep(krb5_ap_rep *ar);
66
void ktest_make_sample_ap_rep_enc_part(krb5_ap_rep_enc_part *arep);
67
void ktest_make_sample_kdc_req_body(krb5_kdc_req *krb);
68
void ktest_make_sample_safe(krb5_safe *s);
69
void ktest_make_sample_priv(krb5_priv *p);
70
void ktest_make_sample_priv_enc_part(krb5_priv_enc_part *pep);
71
void ktest_make_sample_cred(krb5_cred *c);
72
void ktest_make_sample_cred_enc_part(krb5_cred_enc_part *cep);
73
void ktest_make_sample_sequence_of_ticket(krb5_ticket ***sot);
74
void ktest_make_sample_error(krb5_error *kerr);
75
void ktest_make_sequence_of_cred_info(krb5_cred_info ***soci);
76
void ktest_make_sample_cred_info(krb5_cred_info *ci);
77
78
void ktest_make_sample_etype_info(krb5_etype_info_entry ***p);
79
void ktest_make_sample_etype_info2(krb5_etype_info_entry ***p);
80
void ktest_make_sample_pa_enc_ts(krb5_pa_enc_ts *am);
81
void ktest_make_sample_sam_challenge_2(krb5_sam_challenge_2 *p);
82
void ktest_make_sample_sam_challenge_2_body(krb5_sam_challenge_2_body *p);
83
void ktest_make_sample_sam_response_2(krb5_sam_response_2 *p);
84
void ktest_make_sample_enc_sam_response_enc_2(krb5_enc_sam_response_enc_2 *p);
85
void ktest_make_sample_pa_for_user(krb5_pa_for_user *p);
86
void ktest_make_sample_pa_s4u_x509_user(krb5_pa_s4u_x509_user *p);
87
void ktest_make_sample_ad_kdcissued(krb5_ad_kdcissued *p);
88
void ktest_make_sample_iakerb_header(krb5_iakerb_header *p);
89
void ktest_make_sample_iakerb_finished(krb5_iakerb_finished *p);
90
void ktest_make_sample_fast_response(krb5_fast_response *p);
91
void ktest_make_sha256_alg(krb5_algorithm_identifier *p);
92
void ktest_make_sha1_alg(krb5_algorithm_identifier *p);
93
void ktest_make_minimal_otp_tokeninfo(krb5_otp_tokeninfo *p);
94
void ktest_make_maximal_otp_tokeninfo(krb5_otp_tokeninfo *p);
95
void ktest_make_minimal_pa_otp_challenge(krb5_pa_otp_challenge *p);
96
void ktest_make_maximal_pa_otp_challenge(krb5_pa_otp_challenge *p);
97
void ktest_make_minimal_pa_otp_req(krb5_pa_otp_req *p);
98
void ktest_make_maximal_pa_otp_req(krb5_pa_otp_req *p);
99
100
#ifndef DISABLE_PKINIT
101
void ktest_make_sample_pa_pk_as_req(krb5_pa_pk_as_req *p);
102
void ktest_make_sample_pa_pk_as_rep_dhInfo(krb5_pa_pk_as_rep *p);
103
void ktest_make_sample_pa_pk_as_rep_encKeyPack(krb5_pa_pk_as_rep *p);
104
void ktest_make_sample_auth_pack(krb5_auth_pack *p);
105
void ktest_make_sample_kdc_dh_key_info(krb5_kdc_dh_key_info *p);
106
void ktest_make_sample_reply_key_pack(krb5_reply_key_pack *p);
107
void ktest_make_sample_sp80056a_other_info(krb5_sp80056a_other_info *p);
108
void ktest_make_sample_pkinit_supp_pub_info(krb5_pkinit_supp_pub_info *p);
109
#endif
110
111
#ifdef ENABLE_LDAP
112
void ktest_make_sample_ldap_seqof_key_data(ldap_seqof_key_data *p);
113
#endif
114
115
void ktest_make_sample_kkdcp_message(krb5_kkdcp_message *p);
116
void ktest_make_minimal_cammac(krb5_cammac *p);
117
void ktest_make_maximal_cammac(krb5_cammac *p);
118
void ktest_make_sample_secure_cookie(krb5_secure_cookie *p);
119
void ktest_make_minimal_spake_factor(krb5_spake_factor *p);
120
void ktest_make_maximal_spake_factor(krb5_spake_factor *p);
121
void ktest_make_support_pa_spake(krb5_pa_spake *p);
122
void ktest_make_challenge_pa_spake(krb5_pa_spake *p);
123
void ktest_make_response_pa_spake(krb5_pa_spake *p);
124
void ktest_make_encdata_pa_spake(krb5_pa_spake *p);
125
126
/*----------------------------------------------------------------------*/
127
128
void ktest_empty_authorization_data(krb5_authdata **ad);
129
void ktest_destroy_authorization_data(krb5_authdata ***ad);
130
void ktest_destroy_authorization_data(krb5_authdata ***ad);
131
void ktest_empty_addresses(krb5_address **a);
132
void ktest_destroy_addresses(krb5_address ***a);
133
void ktest_destroy_address(krb5_address **a);
134
void ktest_empty_pa_data_array(krb5_pa_data **pad);
135
void ktest_destroy_pa_data_array(krb5_pa_data ***pad);
136
void ktest_destroy_pa_data(krb5_pa_data **pad);
137
138
void ktest_destroy_data(krb5_data **d);
139
void ktest_empty_data(krb5_data *d);
140
void ktest_destroy_principal(krb5_principal *p);
141
void ktest_destroy_checksum(krb5_checksum **cs);
142
void ktest_empty_keyblock(krb5_keyblock *kb);
143
void ktest_destroy_keyblock(krb5_keyblock **kb);
144
void ktest_destroy_authdata(krb5_authdata **ad);
145
void ktest_destroy_sequence_of_integer(long **soi);
146
void ktest_destroy_sequence_of_ticket(krb5_ticket ***sot);
147
void ktest_destroy_ticket(krb5_ticket **tkt);
148
void ktest_empty_ticket(krb5_ticket *tkt);
149
void ktest_destroy_enc_data(krb5_enc_data *ed);
150
void ktest_empty_error(krb5_error *kerr);
151
void ktest_destroy_etype_info_entry(krb5_etype_info_entry *i);
152
void ktest_destroy_etype_info(krb5_etype_info_entry **info);
153
154
void ktest_empty_kdc_req(krb5_kdc_req *kr);
155
void ktest_empty_kdc_rep(krb5_kdc_rep *kr);
156
157
void ktest_empty_authenticator(krb5_authenticator *a);
158
void ktest_empty_enc_tkt_part(krb5_enc_tkt_part *etp);
159
void ktest_destroy_enc_tkt_part(krb5_enc_tkt_part **etp);
160
void ktest_empty_enc_kdc_rep_part(krb5_enc_kdc_rep_part *ekr);
161
void ktest_destroy_transited(krb5_transited *t);
162
void ktest_empty_ap_rep(krb5_ap_rep *ar);
163
void ktest_empty_ap_req(krb5_ap_req *ar);
164
void ktest_empty_cred_enc_part(krb5_cred_enc_part *cep);
165
void ktest_destroy_cred_info(krb5_cred_info **ci);
166
void ktest_destroy_sequence_of_cred_info(krb5_cred_info ***soci);
167
void ktest_empty_safe(krb5_safe *s);
168
void ktest_empty_priv(krb5_priv *p);
169
void ktest_empty_priv_enc_part(krb5_priv_enc_part *pep);
170
void ktest_empty_cred(krb5_cred *c);
171
void ktest_destroy_last_req(krb5_last_req_entry ***lr);
172
void ktest_empty_ap_rep_enc_part(krb5_ap_rep_enc_part *arep);
173
void ktest_empty_sam_challenge_2(krb5_sam_challenge_2 *p);
174
void ktest_empty_sam_challenge_2_body(krb5_sam_challenge_2_body *p);
175
void ktest_empty_sam_response_2(krb5_sam_response_2 *p);
176
void ktest_empty_enc_sam_response_enc_2(krb5_enc_sam_response_enc_2 *p);
177
void ktest_empty_pa_for_user(krb5_pa_for_user *p);
178
void ktest_empty_pa_s4u_x509_user(krb5_pa_s4u_x509_user *p);
179
void ktest_empty_ad_kdcissued(krb5_ad_kdcissued *p);
180
void ktest_empty_iakerb_header(krb5_iakerb_header *p);
181
void ktest_empty_iakerb_finished(krb5_iakerb_finished *p);
182
void ktest_empty_fast_response(krb5_fast_response *p);
183
void ktest_empty_otp_tokeninfo(krb5_otp_tokeninfo *p);
184
void ktest_empty_pa_otp_challenge(krb5_pa_otp_challenge *p);
185
void ktest_empty_pa_otp_req(krb5_pa_otp_req *p);
186
187
#ifndef DISABLE_PKINIT
188
void ktest_empty_pa_pk_as_req(krb5_pa_pk_as_req *p);
189
void ktest_empty_pa_pk_as_rep(krb5_pa_pk_as_rep *p);
190
void ktest_empty_auth_pack(krb5_auth_pack *p);
191
void ktest_empty_kdc_dh_key_info(krb5_kdc_dh_key_info *p);
192
void ktest_empty_reply_key_pack(krb5_reply_key_pack *p);
193
void ktest_empty_sp80056a_other_info(krb5_sp80056a_other_info *p);
194
void ktest_empty_pkinit_supp_pub_info(krb5_pkinit_supp_pub_info *p);
195
#endif
196
197
#ifdef ENABLE_LDAP
198
void ktest_empty_ldap_seqof_key_data(ldap_seqof_key_data *p);
199
#endif
200
201
void ktest_empty_kkdcp_message(krb5_kkdcp_message *p);
202
void ktest_empty_cammac(krb5_cammac *p);
203
void ktest_empty_secure_cookie(krb5_secure_cookie *p);
204
void ktest_empty_spake_factor(krb5_spake_factor *p);
205
void ktest_empty_pa_spake(krb5_pa_spake *p);
206
207
extern krb5_context test_context;
208
extern char *sample_principal_name;
209
210
#endif
211
212