xref: /freebsd/crypto/openssl/crypto/crmf/crmf_asn.c (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery /*-
2*b077aed3SPierre Pronchery  * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
3*b077aed3SPierre Pronchery  * Copyright Nokia 2007-2019
4*b077aed3SPierre Pronchery  * Copyright Siemens AG 2015-2019
5*b077aed3SPierre Pronchery  *
6*b077aed3SPierre Pronchery  * Licensed under the Apache License 2.0 (the "License").  You may not use
7*b077aed3SPierre Pronchery  * this file except in compliance with the License.  You can obtain a copy
8*b077aed3SPierre Pronchery  * in the file LICENSE in the source distribution or at
9*b077aed3SPierre Pronchery  * https://www.openssl.org/source/license.html
10*b077aed3SPierre Pronchery  *
11*b077aed3SPierre Pronchery  * CRMF implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb.
12*b077aed3SPierre Pronchery  */
13*b077aed3SPierre Pronchery 
14*b077aed3SPierre Pronchery #include <openssl/asn1t.h>
15*b077aed3SPierre Pronchery 
16*b077aed3SPierre Pronchery #include "crmf_local.h"
17*b077aed3SPierre Pronchery 
18*b077aed3SPierre Pronchery /* explicit #includes not strictly needed since implied by the above: */
19*b077aed3SPierre Pronchery #include <openssl/crmf.h>
20*b077aed3SPierre Pronchery 
21*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_PRIVATEKEYINFO) = {
22*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, version, ASN1_INTEGER),
23*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, privateKeyAlgorithm, X509_ALGOR),
24*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, privateKey, ASN1_OCTET_STRING),
25*b077aed3SPierre Pronchery     ASN1_IMP_SET_OF_OPT(OSSL_CRMF_PRIVATEKEYINFO, attributes, X509_ATTRIBUTE, 0)
26*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_PRIVATEKEYINFO)
27*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_PRIVATEKEYINFO)
28*b077aed3SPierre Pronchery 
29*b077aed3SPierre Pronchery 
30*b077aed3SPierre Pronchery ASN1_CHOICE(OSSL_CRMF_ENCKEYWITHID_IDENTIFIER) = {
31*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_ENCKEYWITHID_IDENTIFIER, value.string, ASN1_UTF8STRING),
32*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_ENCKEYWITHID_IDENTIFIER, value.generalName, GENERAL_NAME)
33*b077aed3SPierre Pronchery } ASN1_CHOICE_END(OSSL_CRMF_ENCKEYWITHID_IDENTIFIER)
34*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_ENCKEYWITHID_IDENTIFIER)
35*b077aed3SPierre Pronchery 
36*b077aed3SPierre Pronchery 
37*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_ENCKEYWITHID) = {
38*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_ENCKEYWITHID, privateKey, OSSL_CRMF_PRIVATEKEYINFO),
39*b077aed3SPierre Pronchery     ASN1_OPT(OSSL_CRMF_ENCKEYWITHID, identifier,
40*b077aed3SPierre Pronchery              OSSL_CRMF_ENCKEYWITHID_IDENTIFIER)
41*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_ENCKEYWITHID)
42*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_ENCKEYWITHID)
43*b077aed3SPierre Pronchery 
44*b077aed3SPierre Pronchery 
45*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_CERTID) = {
46*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_CERTID, issuer, GENERAL_NAME),
47*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_CERTID, serialNumber, ASN1_INTEGER)
48*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_CERTID)
49*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
50*b077aed3SPierre Pronchery IMPLEMENT_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
51*b077aed3SPierre Pronchery 
52*b077aed3SPierre Pronchery 
53*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_ENCRYPTEDVALUE) = {
54*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_ENCRYPTEDVALUE, intendedAlg, X509_ALGOR, 0),
55*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_ENCRYPTEDVALUE, symmAlg, X509_ALGOR, 1),
56*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_ENCRYPTEDVALUE, encSymmKey, ASN1_BIT_STRING, 2),
57*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_ENCRYPTEDVALUE, keyAlg, X509_ALGOR, 3),
58*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_ENCRYPTEDVALUE, valueHint, ASN1_OCTET_STRING, 4),
59*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_ENCRYPTEDVALUE, encValue, ASN1_BIT_STRING)
60*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_ENCRYPTEDVALUE)
61*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
62*b077aed3SPierre Pronchery 
63*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_SINGLEPUBINFO) = {
64*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_SINGLEPUBINFO, pubMethod, ASN1_INTEGER),
65*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_SINGLEPUBINFO, pubLocation, GENERAL_NAME)
66*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_SINGLEPUBINFO)
67*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_SINGLEPUBINFO)
68*b077aed3SPierre Pronchery 
69*b077aed3SPierre Pronchery 
70*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_PKIPUBLICATIONINFO) = {
71*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PKIPUBLICATIONINFO, action, ASN1_INTEGER),
72*b077aed3SPierre Pronchery     ASN1_SEQUENCE_OF_OPT(OSSL_CRMF_PKIPUBLICATIONINFO, pubInfos,
73*b077aed3SPierre Pronchery                          OSSL_CRMF_SINGLEPUBINFO)
74*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_PKIPUBLICATIONINFO)
75*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
76*b077aed3SPierre Pronchery IMPLEMENT_ASN1_DUP_FUNCTION(OSSL_CRMF_PKIPUBLICATIONINFO)
77*b077aed3SPierre Pronchery 
78*b077aed3SPierre Pronchery 
79*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_PKMACVALUE) = {
80*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PKMACVALUE, algId, X509_ALGOR),
81*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PKMACVALUE, value, ASN1_BIT_STRING)
82*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_PKMACVALUE)
83*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_PKMACVALUE)
84*b077aed3SPierre Pronchery 
85*b077aed3SPierre Pronchery 
86*b077aed3SPierre Pronchery ASN1_CHOICE(OSSL_CRMF_POPOPRIVKEY) = {
87*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPOPRIVKEY, value.thisMessage, ASN1_BIT_STRING, 0),
88*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPOPRIVKEY, value.subsequentMessage, ASN1_INTEGER, 1),
89*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPOPRIVKEY, value.dhMAC, ASN1_BIT_STRING, 2),
90*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPOPRIVKEY, value.agreeMAC, OSSL_CRMF_PKMACVALUE, 3),
91*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPOPRIVKEY, value.encryptedKey, ASN1_NULL, 4),
92*b077aed3SPierre Pronchery } ASN1_CHOICE_END(OSSL_CRMF_POPOPRIVKEY)
93*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPOPRIVKEY)
94*b077aed3SPierre Pronchery 
95*b077aed3SPierre Pronchery 
96*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_PBMPARAMETER) = {
97*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PBMPARAMETER, salt, ASN1_OCTET_STRING),
98*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PBMPARAMETER, owf, X509_ALGOR),
99*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PBMPARAMETER, iterationCount, ASN1_INTEGER),
100*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_PBMPARAMETER, mac, X509_ALGOR)
101*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_PBMPARAMETER)
102*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
103*b077aed3SPierre Pronchery 
104*b077aed3SPierre Pronchery 
105*b077aed3SPierre Pronchery ASN1_CHOICE(OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO) = {
106*b077aed3SPierre Pronchery     ASN1_EXP(OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO, value.sender,
107*b077aed3SPierre Pronchery              GENERAL_NAME, 0),
108*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO, value.publicKeyMAC,
109*b077aed3SPierre Pronchery                 OSSL_CRMF_PKMACVALUE)
110*b077aed3SPierre Pronchery } ASN1_CHOICE_END(OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO)
111*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO)
112*b077aed3SPierre Pronchery 
113*b077aed3SPierre Pronchery 
114*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_POPOSIGNINGKEYINPUT) = {
115*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_POPOSIGNINGKEYINPUT, authInfo,
116*b077aed3SPierre Pronchery                 OSSL_CRMF_POPOSIGNINGKEYINPUT_AUTHINFO),
117*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_POPOSIGNINGKEYINPUT, publicKey, X509_PUBKEY)
118*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_POPOSIGNINGKEYINPUT)
119*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPOSIGNINGKEYINPUT)
120*b077aed3SPierre Pronchery 
121*b077aed3SPierre Pronchery 
122*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_POPOSIGNINGKEY) = {
123*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_POPOSIGNINGKEY, poposkInput,
124*b077aed3SPierre Pronchery                  OSSL_CRMF_POPOSIGNINGKEYINPUT, 0),
125*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_POPOSIGNINGKEY, algorithmIdentifier, X509_ALGOR),
126*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_POPOSIGNINGKEY, signature, ASN1_BIT_STRING)
127*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_POPOSIGNINGKEY)
128*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPOSIGNINGKEY)
129*b077aed3SPierre Pronchery 
130*b077aed3SPierre Pronchery 
131*b077aed3SPierre Pronchery ASN1_CHOICE(OSSL_CRMF_POPO) = {
132*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPO, value.raVerified, ASN1_NULL, 0),
133*b077aed3SPierre Pronchery     ASN1_IMP(OSSL_CRMF_POPO, value.signature, OSSL_CRMF_POPOSIGNINGKEY, 1),
134*b077aed3SPierre Pronchery     ASN1_EXP(OSSL_CRMF_POPO, value.keyEncipherment, OSSL_CRMF_POPOPRIVKEY, 2),
135*b077aed3SPierre Pronchery     ASN1_EXP(OSSL_CRMF_POPO, value.keyAgreement, OSSL_CRMF_POPOPRIVKEY, 3)
136*b077aed3SPierre Pronchery } ASN1_CHOICE_END(OSSL_CRMF_POPO)
137*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_POPO)
138*b077aed3SPierre Pronchery 
139*b077aed3SPierre Pronchery 
140*b077aed3SPierre Pronchery ASN1_ADB_TEMPLATE(attributetypeandvalue_default) =
141*b077aed3SPierre Pronchery     ASN1_OPT(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, value.other, ASN1_ANY);
142*b077aed3SPierre Pronchery ASN1_ADB(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) = {
143*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regCtrl_regToken,
144*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
145*b077aed3SPierre Pronchery                           value.regToken, ASN1_UTF8STRING)),
146*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regCtrl_authenticator,
147*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
148*b077aed3SPierre Pronchery                           value.authenticator, ASN1_UTF8STRING)),
149*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regCtrl_pkiPublicationInfo,
150*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
151*b077aed3SPierre Pronchery                           value.pkiPublicationInfo,
152*b077aed3SPierre Pronchery                           OSSL_CRMF_PKIPUBLICATIONINFO)),
153*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regCtrl_oldCertID,
154*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
155*b077aed3SPierre Pronchery                           value.oldCertID, OSSL_CRMF_CERTID)),
156*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regCtrl_protocolEncrKey,
157*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
158*b077aed3SPierre Pronchery                           value.protocolEncrKey, X509_PUBKEY)),
159*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regInfo_utf8Pairs,
160*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
161*b077aed3SPierre Pronchery                           value.utf8Pairs, ASN1_UTF8STRING)),
162*b077aed3SPierre Pronchery     ADB_ENTRY(NID_id_regInfo_certReq,
163*b077aed3SPierre Pronchery               ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE,
164*b077aed3SPierre Pronchery                           value.certReq, OSSL_CRMF_CERTREQUEST)),
165*b077aed3SPierre Pronchery } ASN1_ADB_END(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, 0, type, 0,
166*b077aed3SPierre Pronchery                &attributetypeandvalue_default_tt, NULL);
167*b077aed3SPierre Pronchery 
168*b077aed3SPierre Pronchery 
169*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) = {
170*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, type, ASN1_OBJECT),
171*b077aed3SPierre Pronchery     ASN1_ADB_OBJECT(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
172*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
173*b077aed3SPierre Pronchery 
174*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
175*b077aed3SPierre Pronchery IMPLEMENT_ASN1_DUP_FUNCTION(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
176*b077aed3SPierre Pronchery 
177*b077aed3SPierre Pronchery 
178*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_OPTIONALVALIDITY) = {
179*b077aed3SPierre Pronchery     ASN1_EXP_OPT(OSSL_CRMF_OPTIONALVALIDITY, notBefore, ASN1_TIME, 0),
180*b077aed3SPierre Pronchery     ASN1_EXP_OPT(OSSL_CRMF_OPTIONALVALIDITY, notAfter,  ASN1_TIME, 1)
181*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_OPTIONALVALIDITY)
182*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_OPTIONALVALIDITY)
183*b077aed3SPierre Pronchery 
184*b077aed3SPierre Pronchery 
185*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_CERTTEMPLATE) = {
186*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, version, ASN1_INTEGER, 0),
187*b077aed3SPierre Pronchery     /*
188*b077aed3SPierre Pronchery      * serialNumber MUST be omitted. This field is assigned by the CA
189*b077aed3SPierre Pronchery      * during certificate creation.
190*b077aed3SPierre Pronchery      */
191*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, serialNumber, ASN1_INTEGER, 1),
192*b077aed3SPierre Pronchery     /*
193*b077aed3SPierre Pronchery      * signingAlg MUST be omitted. This field is assigned by the CA
194*b077aed3SPierre Pronchery      * during certificate creation.
195*b077aed3SPierre Pronchery      */
196*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, signingAlg, X509_ALGOR, 2),
197*b077aed3SPierre Pronchery     ASN1_EXP_OPT(OSSL_CRMF_CERTTEMPLATE, issuer, X509_NAME, 3),
198*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, validity,
199*b077aed3SPierre Pronchery                  OSSL_CRMF_OPTIONALVALIDITY, 4),
200*b077aed3SPierre Pronchery     ASN1_EXP_OPT(OSSL_CRMF_CERTTEMPLATE, subject, X509_NAME, 5),
201*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, publicKey, X509_PUBKEY, 6),
202*b077aed3SPierre Pronchery     /* issuerUID is deprecated in version 2 */
203*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, issuerUID, ASN1_BIT_STRING, 7),
204*b077aed3SPierre Pronchery     /* subjectUID is deprecated in version 2 */
205*b077aed3SPierre Pronchery     ASN1_IMP_OPT(OSSL_CRMF_CERTTEMPLATE, subjectUID, ASN1_BIT_STRING, 8),
206*b077aed3SPierre Pronchery     ASN1_IMP_SEQUENCE_OF_OPT(OSSL_CRMF_CERTTEMPLATE, extensions,
207*b077aed3SPierre Pronchery                              X509_EXTENSION, 9),
208*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_CERTTEMPLATE)
209*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_CERTTEMPLATE)
210*b077aed3SPierre Pronchery 
211*b077aed3SPierre Pronchery 
212*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_CERTREQUEST) = {
213*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_CERTREQUEST, certReqId, ASN1_INTEGER),
214*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_CERTREQUEST, certTemplate, OSSL_CRMF_CERTTEMPLATE),
215*b077aed3SPierre Pronchery     ASN1_SEQUENCE_OF_OPT(OSSL_CRMF_CERTREQUEST, controls,
216*b077aed3SPierre Pronchery                          OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
217*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_CERTREQUEST)
218*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_CERTREQUEST)
219*b077aed3SPierre Pronchery IMPLEMENT_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTREQUEST)
220*b077aed3SPierre Pronchery 
221*b077aed3SPierre Pronchery 
222*b077aed3SPierre Pronchery ASN1_SEQUENCE(OSSL_CRMF_MSG) = {
223*b077aed3SPierre Pronchery     ASN1_SIMPLE(OSSL_CRMF_MSG, certReq, OSSL_CRMF_CERTREQUEST),
224*b077aed3SPierre Pronchery     ASN1_OPT(OSSL_CRMF_MSG, popo, OSSL_CRMF_POPO),
225*b077aed3SPierre Pronchery     ASN1_SEQUENCE_OF_OPT(OSSL_CRMF_MSG, regInfo,
226*b077aed3SPierre Pronchery                          OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
227*b077aed3SPierre Pronchery } ASN1_SEQUENCE_END(OSSL_CRMF_MSG)
228*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
229*b077aed3SPierre Pronchery IMPLEMENT_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
230*b077aed3SPierre Pronchery 
231*b077aed3SPierre Pronchery ASN1_ITEM_TEMPLATE(OSSL_CRMF_MSGS) =
232*b077aed3SPierre Pronchery     ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0,
233*b077aed3SPierre Pronchery                           OSSL_CRMF_MSGS, OSSL_CRMF_MSG)
234*b077aed3SPierre Pronchery ASN1_ITEM_TEMPLATE_END(OSSL_CRMF_MSGS)
235*b077aed3SPierre Pronchery IMPLEMENT_ASN1_FUNCTIONS(OSSL_CRMF_MSGS)
236