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