xref: /freebsd/crypto/krb5/src/tests/asn.1/ktest_equal.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2*7f2fe78bSCy Schubert /* tests/asn.1/ktest_equal.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_EQUAL_H__
28*7f2fe78bSCy Schubert #define __KTEST_EQUAL_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 /* int ktest_equal_structure(krb5_structure *ref, *var) */
35*7f2fe78bSCy Schubert /* effects  Returns true (non-zero) if ref and var are
36*7f2fe78bSCy Schubert              semantically equivalent (i.e. have the same values,
37*7f2fe78bSCy Schubert              but aren't necessarily the same object).
38*7f2fe78bSCy Schubert             Returns false (zero) if ref and var differ. */
39*7f2fe78bSCy Schubert 
40*7f2fe78bSCy Schubert #define generic(funcname,type)\
41*7f2fe78bSCy Schubert int funcname (type *ref, type *var)
42*7f2fe78bSCy Schubert 
43*7f2fe78bSCy Schubert #define len_array(funcname,type)\
44*7f2fe78bSCy Schubert int funcname (int length, type *ref, type *var)
45*7f2fe78bSCy Schubert #define len_unsigned_array(funcname,type)\
46*7f2fe78bSCy Schubert int funcname (unsigned int length, type *ref, type *var)
47*7f2fe78bSCy Schubert 
48*7f2fe78bSCy Schubert generic(ktest_equal_authenticator,krb5_authenticator);
49*7f2fe78bSCy Schubert generic(ktest_equal_principal_data,krb5_principal_data);
50*7f2fe78bSCy Schubert generic(ktest_equal_checksum,krb5_checksum);
51*7f2fe78bSCy Schubert generic(ktest_equal_keyblock,krb5_keyblock);
52*7f2fe78bSCy Schubert generic(ktest_equal_data,krb5_data);
53*7f2fe78bSCy Schubert generic(ktest_equal_authdata,krb5_authdata);
54*7f2fe78bSCy Schubert generic(ktest_equal_ticket,krb5_ticket);
55*7f2fe78bSCy Schubert generic(ktest_equal_enc_tkt_part,krb5_enc_tkt_part);
56*7f2fe78bSCy Schubert generic(ktest_equal_transited,krb5_transited);
57*7f2fe78bSCy Schubert generic(ktest_equal_ticket_times,krb5_ticket_times);
58*7f2fe78bSCy Schubert generic(ktest_equal_address,krb5_address);
59*7f2fe78bSCy Schubert generic(ktest_equal_enc_data,krb5_enc_data);
60*7f2fe78bSCy Schubert 
61*7f2fe78bSCy Schubert generic(ktest_equal_enc_kdc_rep_part,krb5_enc_kdc_rep_part);
62*7f2fe78bSCy Schubert generic(ktest_equal_priv,krb5_priv);
63*7f2fe78bSCy Schubert generic(ktest_equal_cred,krb5_cred);
64*7f2fe78bSCy Schubert generic(ktest_equal_error,krb5_error);
65*7f2fe78bSCy Schubert generic(ktest_equal_ap_req,krb5_ap_req);
66*7f2fe78bSCy Schubert generic(ktest_equal_ap_rep,krb5_ap_rep);
67*7f2fe78bSCy Schubert generic(ktest_equal_ap_rep_enc_part,krb5_ap_rep_enc_part);
68*7f2fe78bSCy Schubert generic(ktest_equal_safe,krb5_safe);
69*7f2fe78bSCy Schubert 
70*7f2fe78bSCy Schubert generic(ktest_equal_last_req_entry,krb5_last_req_entry);
71*7f2fe78bSCy Schubert generic(ktest_equal_pa_data,krb5_pa_data);
72*7f2fe78bSCy Schubert generic(ktest_equal_cred_info,krb5_cred_info);
73*7f2fe78bSCy Schubert 
74*7f2fe78bSCy Schubert generic(ktest_equal_enc_cred_part,krb5_cred_enc_part);
75*7f2fe78bSCy Schubert generic(ktest_equal_enc_priv_part,krb5_priv_enc_part);
76*7f2fe78bSCy Schubert generic(ktest_equal_as_rep,krb5_kdc_rep);
77*7f2fe78bSCy Schubert generic(ktest_equal_tgs_rep,krb5_kdc_rep);
78*7f2fe78bSCy Schubert generic(ktest_equal_as_req,krb5_kdc_req);
79*7f2fe78bSCy Schubert generic(ktest_equal_tgs_req,krb5_kdc_req);
80*7f2fe78bSCy Schubert generic(ktest_equal_kdc_req_body,krb5_kdc_req);
81*7f2fe78bSCy Schubert generic(ktest_equal_encryption_key,krb5_keyblock);
82*7f2fe78bSCy Schubert 
83*7f2fe78bSCy Schubert generic(ktest_equal_krb5_pa_enc_ts,krb5_pa_enc_ts);
84*7f2fe78bSCy Schubert 
85*7f2fe78bSCy Schubert generic(ktest_equal_sam_challenge_2,krb5_sam_challenge_2);
86*7f2fe78bSCy Schubert generic(ktest_equal_sam_challenge_2_body,krb5_sam_challenge_2_body);
87*7f2fe78bSCy Schubert 
88*7f2fe78bSCy Schubert int ktest_equal_last_req(krb5_last_req_entry **ref, krb5_last_req_entry **var);
89*7f2fe78bSCy Schubert int ktest_equal_sequence_of_ticket(krb5_ticket **ref, krb5_ticket **var);
90*7f2fe78bSCy Schubert int ktest_equal_sequence_of_pa_data(krb5_pa_data **ref, krb5_pa_data **var);
91*7f2fe78bSCy Schubert int ktest_equal_sequence_of_cred_info(krb5_cred_info **ref,
92*7f2fe78bSCy Schubert                                       krb5_cred_info **var);
93*7f2fe78bSCy Schubert int ktest_equal_sequence_of_principal(krb5_principal *ref,
94*7f2fe78bSCy Schubert                                       krb5_principal *var);
95*7f2fe78bSCy Schubert int ktest_equal_sequence_of_checksum(krb5_checksum **ref, krb5_checksum **var);
96*7f2fe78bSCy Schubert int
97*7f2fe78bSCy Schubert ktest_equal_sequence_of_algorithm_identifier(krb5_algorithm_identifier **ref,
98*7f2fe78bSCy Schubert                                              krb5_algorithm_identifier **var);
99*7f2fe78bSCy Schubert int ktest_equal_sequence_of_otp_tokeninfo(krb5_otp_tokeninfo **ref,
100*7f2fe78bSCy Schubert                                           krb5_otp_tokeninfo **var);
101*7f2fe78bSCy Schubert int ktest_equal_sequence_of_spake_factor(krb5_spake_factor **ref,
102*7f2fe78bSCy Schubert                                          krb5_spake_factor **var);
103*7f2fe78bSCy Schubert 
104*7f2fe78bSCy Schubert len_array(ktest_equal_array_of_enctype,krb5_enctype);
105*7f2fe78bSCy Schubert len_array(ktest_equal_array_of_data,krb5_data);
106*7f2fe78bSCy Schubert len_unsigned_array(ktest_equal_array_of_octet,krb5_octet);
107*7f2fe78bSCy Schubert 
108*7f2fe78bSCy Schubert int ktest_equal_authorization_data(krb5_authdata **ref, krb5_authdata **var);
109*7f2fe78bSCy Schubert int ktest_equal_addresses(krb5_address **ref, krb5_address **var);
110*7f2fe78bSCy Schubert int ktest_equal_array_of_char(const unsigned int length, char *ref, char *var);
111*7f2fe78bSCy Schubert 
112*7f2fe78bSCy Schubert int ktest_equal_etype_info(krb5_etype_info_entry **ref,
113*7f2fe78bSCy Schubert                            krb5_etype_info_entry **var);
114*7f2fe78bSCy Schubert 
115*7f2fe78bSCy Schubert int ktest_equal_krb5_etype_info_entry(krb5_etype_info_entry *ref,
116*7f2fe78bSCy Schubert                                       krb5_etype_info_entry *var);
117*7f2fe78bSCy Schubert int ktest_equal_pa_for_user(krb5_pa_for_user *ref, krb5_pa_for_user *var);
118*7f2fe78bSCy Schubert int ktest_equal_pa_s4u_x509_user(krb5_pa_s4u_x509_user *ref,
119*7f2fe78bSCy Schubert                                  krb5_pa_s4u_x509_user *var);
120*7f2fe78bSCy Schubert int ktest_equal_ad_kdcissued(krb5_ad_kdcissued *ref, krb5_ad_kdcissued *var);
121*7f2fe78bSCy Schubert int ktest_equal_iakerb_header(krb5_iakerb_header *ref,
122*7f2fe78bSCy Schubert                               krb5_iakerb_header *var);
123*7f2fe78bSCy Schubert int ktest_equal_iakerb_finished(krb5_iakerb_finished *ref,
124*7f2fe78bSCy Schubert                                 krb5_iakerb_finished *var);
125*7f2fe78bSCy Schubert int ktest_equal_fast_response(krb5_fast_response *ref,
126*7f2fe78bSCy Schubert                               krb5_fast_response *var);
127*7f2fe78bSCy Schubert int ktest_equal_otp_tokeninfo(krb5_otp_tokeninfo *ref,
128*7f2fe78bSCy Schubert                               krb5_otp_tokeninfo *var);
129*7f2fe78bSCy Schubert int ktest_equal_pa_otp_challenge(krb5_pa_otp_challenge *ref,
130*7f2fe78bSCy Schubert                                  krb5_pa_otp_challenge *var);
131*7f2fe78bSCy Schubert int ktest_equal_pa_otp_req(krb5_pa_otp_req *ref, krb5_pa_otp_req *var);
132*7f2fe78bSCy Schubert 
133*7f2fe78bSCy Schubert int ktest_equal_ldap_sequence_of_keys(ldap_seqof_key_data *ref,
134*7f2fe78bSCy Schubert                                       ldap_seqof_key_data *var);
135*7f2fe78bSCy Schubert 
136*7f2fe78bSCy Schubert #ifndef DISABLE_PKINIT
137*7f2fe78bSCy Schubert generic(ktest_equal_pa_pk_as_req, krb5_pa_pk_as_req);
138*7f2fe78bSCy Schubert generic(ktest_equal_pa_pk_as_rep, krb5_pa_pk_as_rep);
139*7f2fe78bSCy Schubert generic(ktest_equal_auth_pack, krb5_auth_pack);
140*7f2fe78bSCy Schubert generic(ktest_equal_kdc_dh_key_info, krb5_kdc_dh_key_info);
141*7f2fe78bSCy Schubert generic(ktest_equal_reply_key_pack, krb5_reply_key_pack);
142*7f2fe78bSCy Schubert #endif /* not DISABLE_PKINIT */
143*7f2fe78bSCy Schubert 
144*7f2fe78bSCy Schubert int ktest_equal_kkdcp_message(krb5_kkdcp_message *ref,
145*7f2fe78bSCy Schubert                               krb5_kkdcp_message *var);
146*7f2fe78bSCy Schubert int ktest_equal_cammac(krb5_cammac *ref, krb5_cammac *var);
147*7f2fe78bSCy Schubert 
148*7f2fe78bSCy Schubert int ktest_equal_secure_cookie(krb5_secure_cookie *ref,
149*7f2fe78bSCy Schubert                               krb5_secure_cookie *var);
150*7f2fe78bSCy Schubert 
151*7f2fe78bSCy Schubert generic(ktest_equal_spake_factor, krb5_spake_factor);
152*7f2fe78bSCy Schubert generic(ktest_equal_pa_spake, krb5_pa_spake);
153*7f2fe78bSCy Schubert 
154*7f2fe78bSCy Schubert #endif
155