xref: /freebsd/crypto/krb5/src/tests/asn.1/make-vectors.c (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2*7f2fe78bSCy Schubert /* tests/asn.1/make-vectors.c - Generate ASN.1 test vectors using asn1c */
3*7f2fe78bSCy Schubert /*
4*7f2fe78bSCy Schubert  * Copyright (C) 2011 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 /*
28*7f2fe78bSCy Schubert  * This program generates test vectors using asn1c, to be included in other
29*7f2fe78bSCy Schubert  * test programs which exercise the krb5 ASN.1 encoder and decoder functions.
30*7f2fe78bSCy Schubert  * It is intended to be used via "make test-vectors".  Currently, test vectors
31*7f2fe78bSCy Schubert  * are only generated for a subset of newer ASN.1 objects.
32*7f2fe78bSCy Schubert  */
33*7f2fe78bSCy Schubert 
34*7f2fe78bSCy Schubert #include <PrincipalName.h>
35*7f2fe78bSCy Schubert #include <KRB5PrincipalName.h>
36*7f2fe78bSCy Schubert #include <OtherInfo.h>
37*7f2fe78bSCy Schubert #include <PkinitSuppPubInfo.h>
38*7f2fe78bSCy Schubert #include <OTP-TOKENINFO.h>
39*7f2fe78bSCy Schubert #include <PA-OTP-CHALLENGE.h>
40*7f2fe78bSCy Schubert #include <PA-OTP-REQUEST.h>
41*7f2fe78bSCy Schubert #include <PA-OTP-ENC-REQUEST.h>
42*7f2fe78bSCy Schubert #include <AD-CAMMAC.h>
43*7f2fe78bSCy Schubert #include <SPAKESecondFactor.h>
44*7f2fe78bSCy Schubert #include <PA-SPAKE.h>
45*7f2fe78bSCy Schubert 
46*7f2fe78bSCy Schubert static unsigned char buf[8192];
47*7f2fe78bSCy Schubert static size_t buf_pos;
48*7f2fe78bSCy Schubert 
49*7f2fe78bSCy Schubert /* PrincipalName and KRB5PrincipalName */
50*7f2fe78bSCy Schubert static KerberosString_t comp_1 = { "hftsai", 6 };
51*7f2fe78bSCy Schubert static KerberosString_t comp_2 = { "extra", 5 };
52*7f2fe78bSCy Schubert static KerberosString_t *comps[] = { &comp_1, &comp_2 };
53*7f2fe78bSCy Schubert static PrincipalName_t princ = { 1, { comps, 2, 2 } };
54*7f2fe78bSCy Schubert static KRB5PrincipalName_t krb5princ = { { "ATHENA.MIT.EDU", 14 },
55*7f2fe78bSCy Schubert                                          { 1, { comps, 2, 2 } } };
56*7f2fe78bSCy Schubert 
57*7f2fe78bSCy Schubert /* OtherInfo */
58*7f2fe78bSCy Schubert static unsigned int krb5_arcs[] = { 1, 2, 840, 113554, 1, 2, 2 };
59*7f2fe78bSCy Schubert static OCTET_STRING_t krb5data_ostring = { "krb5data", 8 };
60*7f2fe78bSCy Schubert static OtherInfo_t other_info = {
61*7f2fe78bSCy Schubert     { 0 }, { 0 }, { 0 },        /* Initialized in main() */
62*7f2fe78bSCy Schubert     &krb5data_ostring, NULL
63*7f2fe78bSCy Schubert };
64*7f2fe78bSCy Schubert 
65*7f2fe78bSCy Schubert /* PkinitSuppPubInfo */
66*7f2fe78bSCy Schubert static PkinitSuppPubInfo_t supp_pub_info = { 1, { "krb5data", 8 },
67*7f2fe78bSCy Schubert                                              { "krb5data", 8 } };
68*7f2fe78bSCy Schubert 
69*7f2fe78bSCy Schubert /* Minimal OTP-TOKENINFO */
70*7f2fe78bSCy Schubert static OTP_TOKENINFO_t token_info_1 = { { "\0\0\0\0", 4, 0 } };
71*7f2fe78bSCy Schubert 
72*7f2fe78bSCy Schubert /* Maximal OTP-TOKENINFO */
73*7f2fe78bSCy Schubert static UTF8String_t vendor = { "Examplecorp", 11 };
74*7f2fe78bSCy Schubert static OCTET_STRING_t challenge = { "hark!", 5 };
75*7f2fe78bSCy Schubert static Int32_t otp_length = 10;
76*7f2fe78bSCy Schubert static OTPFormat_t otp_format; /* Initialized to 2 in main(). */
77*7f2fe78bSCy Schubert static OCTET_STRING_t token_id = { "yourtoken", 9 };
78*7f2fe78bSCy Schubert static AnyURI_t otp_alg = { "urn:ietf:params:xml:ns:keyprov:pskc:hotp", 40 };
79*7f2fe78bSCy Schubert static unsigned int sha256_arcs[] = { 2, 16, 840, 1, 101, 3, 4, 2, 1 };
80*7f2fe78bSCy Schubert static unsigned int sha1_arcs[] = { 1, 3, 14, 3, 2, 26 };
81*7f2fe78bSCy Schubert static AlgorithmIdentifier_t alg_sha256, alg_sha1; /* Initialized in main(). */
82*7f2fe78bSCy Schubert static AlgorithmIdentifier_t *algs[] = { &alg_sha256, &alg_sha1 };
83*7f2fe78bSCy Schubert static struct supportedHashAlg hash_algs = { algs, 2, 2 };
84*7f2fe78bSCy Schubert static Int32_t iter_count = 1000;
85*7f2fe78bSCy Schubert /* Flags are nextOTP | combine | collect-pin | must-encrypt-nonce |
86*7f2fe78bSCy Schubert  * separate-pin-required | check-digit */
87*7f2fe78bSCy Schubert static OTP_TOKENINFO_t token_info_2 = { { "\x77\0\0\0", 4, 0 }, &vendor,
88*7f2fe78bSCy Schubert                                         &challenge, &otp_length, &otp_format,
89*7f2fe78bSCy Schubert                                         &token_id, &otp_alg, &hash_algs,
90*7f2fe78bSCy Schubert                                         &iter_count };
91*7f2fe78bSCy Schubert 
92*7f2fe78bSCy Schubert /* Minimal PA-OTP-CHALLENGE */
93*7f2fe78bSCy Schubert static OTP_TOKENINFO_t *tinfo_1[] = { &token_info_1 };
94*7f2fe78bSCy Schubert static PA_OTP_CHALLENGE_t challenge_1 = { { "minnonce", 8 }, NULL,
95*7f2fe78bSCy Schubert                                           { { tinfo_1, 1, 1 } } };
96*7f2fe78bSCy Schubert 
97*7f2fe78bSCy Schubert /* Maximal PA-OTP-CHALLENGE */
98*7f2fe78bSCy Schubert static OTP_TOKENINFO_t *tinfo_2[] = { &token_info_1, &token_info_2 };
99*7f2fe78bSCy Schubert static UTF8String_t service = { "testservice", 11 };
100*7f2fe78bSCy Schubert static KerberosString_t salt = { "keysalt", 7 };
101*7f2fe78bSCy Schubert static OCTET_STRING_t s2kparams = { "1234", 4 };
102*7f2fe78bSCy Schubert static PA_OTP_CHALLENGE_t challenge_2 = { { "maxnonce", 8 }, &service,
103*7f2fe78bSCy Schubert                                           { { tinfo_2, 2, 2 } }, &salt,
104*7f2fe78bSCy Schubert                                           &s2kparams };
105*7f2fe78bSCy Schubert 
106*7f2fe78bSCy Schubert /* Minimal PA-OTP-REQUEST */
107*7f2fe78bSCy Schubert static UInt32_t kvno = 5;
108*7f2fe78bSCy Schubert static PA_OTP_REQUEST_t request_1 = { { "\0\0\0\0", 4, 0 }, NULL,
109*7f2fe78bSCy Schubert                                       { 0, &kvno,
110*7f2fe78bSCy Schubert                                         { "krbASN.1 test message", 21 } } };
111*7f2fe78bSCy Schubert 
112*7f2fe78bSCy Schubert /* Maximal PA-OTP-REQUEST */
113*7f2fe78bSCy Schubert /* Flags are nextOTP | combine */
114*7f2fe78bSCy Schubert static OCTET_STRING_t nonce = { "nonce", 5 };
115*7f2fe78bSCy Schubert static OCTET_STRING_t otp_value = { "frogs", 5 };
116*7f2fe78bSCy Schubert static UTF8String_t otp_pin = { "myfirstpin", 10 };
117*7f2fe78bSCy Schubert /* Corresponds to Unix time 771228197 */
118*7f2fe78bSCy Schubert static KerberosTime_t otp_time = { "19940610060317Z", 15 };
119*7f2fe78bSCy Schubert static OCTET_STRING_t counter = { "346", 3 };
120*7f2fe78bSCy Schubert static PA_OTP_REQUEST_t request_2 = { { "\x60\0\0\0", 4, 0 }, &nonce,
121*7f2fe78bSCy Schubert                                       { 0, &kvno,
122*7f2fe78bSCy Schubert                                         { "krbASN.1 test message", 21 } },
123*7f2fe78bSCy Schubert                                       &alg_sha256, &iter_count, &otp_value,
124*7f2fe78bSCy Schubert                                       &otp_pin, &challenge, &otp_time,
125*7f2fe78bSCy Schubert                                       &counter, &otp_format, &token_id,
126*7f2fe78bSCy Schubert                                       &otp_alg, &vendor };
127*7f2fe78bSCy Schubert 
128*7f2fe78bSCy Schubert /* PA-OTP-ENC-REQUEST */
129*7f2fe78bSCy Schubert static PA_OTP_ENC_REQUEST_t enc_request = { { "krb5data", 8 } };
130*7f2fe78bSCy Schubert 
131*7f2fe78bSCy Schubert /*
132*7f2fe78bSCy Schubert  * There is no ASN.1 name for a single authorization data element, so asn1c
133*7f2fe78bSCy Schubert  * declares it as "struct Member" in an inner scope.  This structure must be
134*7f2fe78bSCy Schubert  * laid out identically to that one.
135*7f2fe78bSCy Schubert  */
136*7f2fe78bSCy Schubert struct ad_element {
137*7f2fe78bSCy Schubert     Int32_t ad_type;
138*7f2fe78bSCy Schubert     OCTET_STRING_t ad_data;
139*7f2fe78bSCy Schubert     asn_struct_ctx_t _asn_ctx;
140*7f2fe78bSCy Schubert };
141*7f2fe78bSCy Schubert 
142*7f2fe78bSCy Schubert /* Authorization data elements and lists, for use in CAMMAC */
143*7f2fe78bSCy Schubert static struct ad_element ad_1 = { 1, { "ad1", 3 } };
144*7f2fe78bSCy Schubert static struct ad_element ad_2 = { 2, { "ad2", 3 } };
145*7f2fe78bSCy Schubert static struct ad_element *adlist_1[] = { &ad_1 };
146*7f2fe78bSCy Schubert static struct ad_element *adlist_2[] = { &ad_1, &ad_2 };
147*7f2fe78bSCy Schubert 
148*7f2fe78bSCy Schubert /* Minimal Verifier */
149*7f2fe78bSCy Schubert static Verifier_t verifier_1 = { Verifier_PR_mac,
150*7f2fe78bSCy Schubert                                  { { NULL, NULL, NULL,
151*7f2fe78bSCy Schubert                                      { 1, { "cksum1", 6 } } } } };
152*7f2fe78bSCy Schubert 
153*7f2fe78bSCy Schubert /* Maximal Verifier */
154*7f2fe78bSCy Schubert static Int32_t enctype = 16;
155*7f2fe78bSCy Schubert static Verifier_t verifier_2 = { Verifier_PR_mac,
156*7f2fe78bSCy Schubert                                  { { &princ, &kvno, &enctype,
157*7f2fe78bSCy Schubert                                      { 1, { "cksum2", 6 } } } } };
158*7f2fe78bSCy Schubert 
159*7f2fe78bSCy Schubert /* Minimal CAMMAC */
160*7f2fe78bSCy Schubert static AD_CAMMAC_t cammac_1 = { { { (void *)adlist_1, 1, 1 } },
161*7f2fe78bSCy Schubert                                 NULL, NULL, NULL };
162*7f2fe78bSCy Schubert 
163*7f2fe78bSCy Schubert /* Maximal CAMMAC */
164*7f2fe78bSCy Schubert static Verifier_MAC_t vmac_1 = { &princ, &kvno, &enctype,
165*7f2fe78bSCy Schubert                                  { 1, { "cksumkdc", 8 } } };
166*7f2fe78bSCy Schubert static Verifier_MAC_t vmac_2 = { &princ, &kvno, &enctype,
167*7f2fe78bSCy Schubert                                  { 1, { "cksumsvc", 8 } } };
168*7f2fe78bSCy Schubert static Verifier_t *verifiers[] = { &verifier_1, &verifier_2 };
169*7f2fe78bSCy Schubert static struct other_verifiers overfs = { { verifiers, 2, 2 } };
170*7f2fe78bSCy Schubert static AD_CAMMAC_t cammac_2 = { { { (void *)adlist_2, 2, 2 } },
171*7f2fe78bSCy Schubert                                 &vmac_1, &vmac_2, &overfs };
172*7f2fe78bSCy Schubert 
173*7f2fe78bSCy Schubert /* SPAKESecondFactor */
174*7f2fe78bSCy Schubert static SPAKESecondFactor_t factor_1 = { 1, NULL };
175*7f2fe78bSCy Schubert static OCTET_STRING_t factor_data = { "fdata", 5 };
176*7f2fe78bSCy Schubert static SPAKESecondFactor_t factor_2 = { 2, &factor_data };
177*7f2fe78bSCy Schubert 
178*7f2fe78bSCy Schubert /* PA-SPAKE (support) */
179*7f2fe78bSCy Schubert static Int32_t group_1 = 1, group_2 = 2, *groups[] = { &group_1, &group_2 };
180*7f2fe78bSCy Schubert static PA_SPAKE_t pa_spake_1 = { PA_SPAKE_PR_support,
181*7f2fe78bSCy Schubert                                  { .support = { { groups, 2, 2 } } } };
182*7f2fe78bSCy Schubert 
183*7f2fe78bSCy Schubert /* PA-SPAKE (challenge) */
184*7f2fe78bSCy Schubert static SPAKESecondFactor_t *factors[2] = { &factor_1, &factor_2 };
185*7f2fe78bSCy Schubert static PA_SPAKE_t pa_spake_2 = { PA_SPAKE_PR_challenge,
186*7f2fe78bSCy Schubert                                  { .challenge = { 1, { "T value", 7 },
187*7f2fe78bSCy Schubert                                                   { factors, 2, 2 } } } };
188*7f2fe78bSCy Schubert 
189*7f2fe78bSCy Schubert /* PA-SPAKE (response) */
190*7f2fe78bSCy Schubert UInt32_t enctype_5 = 5;
191*7f2fe78bSCy Schubert static PA_SPAKE_t pa_spake_3 = { PA_SPAKE_PR_response,
192*7f2fe78bSCy Schubert                                  { .response = { { "S value", 7 },
193*7f2fe78bSCy Schubert                                                  { 0, &enctype_5,
194*7f2fe78bSCy Schubert                                                    { "krbASN.1 test message",
195*7f2fe78bSCy Schubert                                                      21 } } } } };
196*7f2fe78bSCy Schubert 
197*7f2fe78bSCy Schubert /* PA-SPAKE (encdata) */
198*7f2fe78bSCy Schubert static PA_SPAKE_t pa_spake_4 = { PA_SPAKE_PR_encdata,
199*7f2fe78bSCy Schubert                                  { .encdata = { 0, &enctype_5,
200*7f2fe78bSCy Schubert                                                 { "krbASN.1 test message",
201*7f2fe78bSCy Schubert                                                   21 } } } };
202*7f2fe78bSCy Schubert 
203*7f2fe78bSCy Schubert static int
consume(const void * data,size_t size,void * dummy)204*7f2fe78bSCy Schubert consume(const void *data, size_t size, void *dummy)
205*7f2fe78bSCy Schubert {
206*7f2fe78bSCy Schubert     memcpy(buf + buf_pos, data, size);
207*7f2fe78bSCy Schubert     buf_pos += size;
208*7f2fe78bSCy Schubert     return 0;
209*7f2fe78bSCy Schubert }
210*7f2fe78bSCy Schubert 
211*7f2fe78bSCy Schubert /* Display a C string literal representing the contents of buf, and
212*7f2fe78bSCy Schubert  * reinitialize buf_pos for the next encoding operation. */
213*7f2fe78bSCy Schubert static void
printbuf(void)214*7f2fe78bSCy Schubert printbuf(void)
215*7f2fe78bSCy Schubert {
216*7f2fe78bSCy Schubert     size_t i;
217*7f2fe78bSCy Schubert 
218*7f2fe78bSCy Schubert     for (i = 0; i < buf_pos; i++) {
219*7f2fe78bSCy Schubert         printf("%02X", buf[i]);
220*7f2fe78bSCy Schubert         if (i + 1 < buf_pos)
221*7f2fe78bSCy Schubert             printf(" ");
222*7f2fe78bSCy Schubert     }
223*7f2fe78bSCy Schubert     buf_pos = 0;
224*7f2fe78bSCy Schubert }
225*7f2fe78bSCy Schubert 
226*7f2fe78bSCy Schubert int
main()227*7f2fe78bSCy Schubert main()
228*7f2fe78bSCy Schubert {
229*7f2fe78bSCy Schubert     /* Initialize values which can't use static initializers. */
230*7f2fe78bSCy Schubert     asn_long2INTEGER(&otp_format, 2);  /* Alphanumeric */
231*7f2fe78bSCy Schubert     OBJECT_IDENTIFIER_set_arcs(&alg_sha256.algorithm, sha256_arcs,
232*7f2fe78bSCy Schubert                                sizeof(*sha256_arcs),
233*7f2fe78bSCy Schubert                                sizeof(sha256_arcs) / sizeof(*sha256_arcs));
234*7f2fe78bSCy Schubert     OBJECT_IDENTIFIER_set_arcs(&alg_sha1.algorithm, sha1_arcs,
235*7f2fe78bSCy Schubert                                sizeof(*sha1_arcs),
236*7f2fe78bSCy Schubert                                sizeof(sha1_arcs) / sizeof(*sha1_arcs));
237*7f2fe78bSCy Schubert     OBJECT_IDENTIFIER_set_arcs(&other_info.algorithmID.algorithm, krb5_arcs,
238*7f2fe78bSCy Schubert                                sizeof(*krb5_arcs),
239*7f2fe78bSCy Schubert                                sizeof(krb5_arcs) / sizeof(*krb5_arcs));
240*7f2fe78bSCy Schubert 
241*7f2fe78bSCy Schubert     printf("PrincipalName:\n");
242*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PrincipalName, &princ, consume, NULL);
243*7f2fe78bSCy Schubert     printbuf();
244*7f2fe78bSCy Schubert 
245*7f2fe78bSCy Schubert     /* Print this encoding and also use it to initialize two fields of
246*7f2fe78bSCy Schubert      * other_info. */
247*7f2fe78bSCy Schubert     printf("\nKRB5PrincipalName:\n");
248*7f2fe78bSCy Schubert     der_encode(&asn_DEF_KRB5PrincipalName, &krb5princ, consume, NULL);
249*7f2fe78bSCy Schubert     OCTET_STRING_fromBuf(&other_info.partyUInfo, buf, buf_pos);
250*7f2fe78bSCy Schubert     OCTET_STRING_fromBuf(&other_info.partyVInfo, buf, buf_pos);
251*7f2fe78bSCy Schubert     printbuf();
252*7f2fe78bSCy Schubert 
253*7f2fe78bSCy Schubert     printf("\nOtherInfo:\n");
254*7f2fe78bSCy Schubert     der_encode(&asn_DEF_OtherInfo, &other_info, consume, NULL);
255*7f2fe78bSCy Schubert     printbuf();
256*7f2fe78bSCy Schubert     free(other_info.partyUInfo.buf);
257*7f2fe78bSCy Schubert     free(other_info.partyVInfo.buf);
258*7f2fe78bSCy Schubert 
259*7f2fe78bSCy Schubert     printf("\nPkinitSuppPubInfo:\n");
260*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PkinitSuppPubInfo, &supp_pub_info, consume, NULL);
261*7f2fe78bSCy Schubert     printbuf();
262*7f2fe78bSCy Schubert 
263*7f2fe78bSCy Schubert     printf("\nMinimal OTP-TOKEN-INFO:\n");
264*7f2fe78bSCy Schubert     der_encode(&asn_DEF_OTP_TOKENINFO, &token_info_1, consume, NULL);
265*7f2fe78bSCy Schubert     printbuf();
266*7f2fe78bSCy Schubert 
267*7f2fe78bSCy Schubert     printf("\nMaximal OTP-TOKEN-INFO:\n");
268*7f2fe78bSCy Schubert     der_encode(&asn_DEF_OTP_TOKENINFO, &token_info_2, consume, NULL);
269*7f2fe78bSCy Schubert     printbuf();
270*7f2fe78bSCy Schubert 
271*7f2fe78bSCy Schubert     printf("\nMinimal PA-OTP-CHALLENGE:\n");
272*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_OTP_CHALLENGE, &challenge_1, consume, NULL);
273*7f2fe78bSCy Schubert     printbuf();
274*7f2fe78bSCy Schubert 
275*7f2fe78bSCy Schubert     printf("\nMaximal PA-OTP-CHALLENGE:\n");
276*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_OTP_CHALLENGE, &challenge_2, consume, NULL);
277*7f2fe78bSCy Schubert     printbuf();
278*7f2fe78bSCy Schubert 
279*7f2fe78bSCy Schubert     printf("\nMinimal PA-OTP-REQUEST:\n");
280*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_OTP_REQUEST, &request_1, consume, NULL);
281*7f2fe78bSCy Schubert     printbuf();
282*7f2fe78bSCy Schubert 
283*7f2fe78bSCy Schubert     printf("\nMaximal PA-OTP-REQUEST:\n");
284*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_OTP_REQUEST, &request_2, consume, NULL);
285*7f2fe78bSCy Schubert     printbuf();
286*7f2fe78bSCy Schubert 
287*7f2fe78bSCy Schubert     printf("\nPA-OTP-ENC-REQUEST:\n");
288*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_OTP_ENC_REQUEST, &enc_request, consume, NULL);
289*7f2fe78bSCy Schubert     printbuf();
290*7f2fe78bSCy Schubert 
291*7f2fe78bSCy Schubert     printf("\nMinimal Verifier:\n");
292*7f2fe78bSCy Schubert     der_encode(&asn_DEF_Verifier, &verifier_1, consume, NULL);
293*7f2fe78bSCy Schubert     printbuf();
294*7f2fe78bSCy Schubert 
295*7f2fe78bSCy Schubert     printf("\nMaximal Verifier:\n");
296*7f2fe78bSCy Schubert     der_encode(&asn_DEF_Verifier, &verifier_2, consume, NULL);
297*7f2fe78bSCy Schubert     printbuf();
298*7f2fe78bSCy Schubert 
299*7f2fe78bSCy Schubert     printf("\nMinimal AD-CAMMAC:\n");
300*7f2fe78bSCy Schubert     der_encode(&asn_DEF_AD_CAMMAC, &cammac_1, consume, NULL);
301*7f2fe78bSCy Schubert     printbuf();
302*7f2fe78bSCy Schubert 
303*7f2fe78bSCy Schubert     printf("\nMaximal AD-CAMMAC:\n");
304*7f2fe78bSCy Schubert     der_encode(&asn_DEF_AD_CAMMAC, &cammac_2, consume, NULL);
305*7f2fe78bSCy Schubert     printbuf();
306*7f2fe78bSCy Schubert 
307*7f2fe78bSCy Schubert     printf("\nMinimal SPAKESecondFactor:\n");
308*7f2fe78bSCy Schubert     der_encode(&asn_DEF_SPAKESecondFactor, &factor_1, consume, NULL);
309*7f2fe78bSCy Schubert     printbuf();
310*7f2fe78bSCy Schubert 
311*7f2fe78bSCy Schubert     printf("\nMaximal SPAKESecondFactor:\n");
312*7f2fe78bSCy Schubert     der_encode(&asn_DEF_SPAKESecondFactor, &factor_2, consume, NULL);
313*7f2fe78bSCy Schubert     printbuf();
314*7f2fe78bSCy Schubert 
315*7f2fe78bSCy Schubert     printf("\nPA-SPAKE (support):\n");
316*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_SPAKE, &pa_spake_1, consume, NULL);
317*7f2fe78bSCy Schubert     printbuf();
318*7f2fe78bSCy Schubert 
319*7f2fe78bSCy Schubert     printf("\nPA-SPAKE (challenge):\n");
320*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_SPAKE, &pa_spake_2, consume, NULL);
321*7f2fe78bSCy Schubert     printbuf();
322*7f2fe78bSCy Schubert 
323*7f2fe78bSCy Schubert     printf("\nPA-SPAKE (response):\n");
324*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_SPAKE, &pa_spake_3, consume, NULL);
325*7f2fe78bSCy Schubert     printbuf();
326*7f2fe78bSCy Schubert 
327*7f2fe78bSCy Schubert     printf("\nPA-SPAKE (encdata):\n");
328*7f2fe78bSCy Schubert     der_encode(&asn_DEF_PA_SPAKE, &pa_spake_4, consume, NULL);
329*7f2fe78bSCy Schubert     printbuf();
330*7f2fe78bSCy Schubert 
331*7f2fe78bSCy Schubert     printf("\n");
332*7f2fe78bSCy Schubert     return 0;
333*7f2fe78bSCy Schubert }
334