/src/wireshark/epan/dissectors/packet-pkcs1.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* Do not modify this file. Changes will be overwritten. */ |
2 | | /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ |
3 | | /* packet-pkcs1.c */ |
4 | | /* asn2wrs.py -b -q -L -p pkcs1 -c ./pkcs1.cnf -s ./packet-pkcs1-template -D . -O ../.. PKIXAlgs-2009.asn */ |
5 | | |
6 | | /* packet-pkcs1.c |
7 | | * Routines for PKCS#1/RFC2313 packet dissection |
8 | | * Ronnie Sahlberg 2004 |
9 | | * |
10 | | * Wireshark - Network traffic analyzer |
11 | | * By Gerald Combs <gerald@wireshark.org> |
12 | | * Copyright 1998 Gerald Combs |
13 | | * |
14 | | * SPDX-License-Identifier: GPL-2.0-or-later |
15 | | */ |
16 | | |
17 | | #include "config.h" |
18 | | |
19 | | #include <epan/packet.h> |
20 | | #include <epan/oids.h> |
21 | | #include <epan/asn1.h> |
22 | | #include <wsutil/array.h> |
23 | | |
24 | | #include "packet-ber.h" |
25 | | #include "packet-pkcs1.h" |
26 | | #include "packet-x509af.h" |
27 | | |
28 | 14 | #define PNAME "PKCS#1" |
29 | 14 | #define PSNAME "PKCS-1" |
30 | 14 | #define PFNAME "pkcs-1" |
31 | | |
32 | | void proto_register_pkcs1(void); |
33 | | void proto_reg_handoff_pkcs1(void); |
34 | | |
35 | | /* Initialize the protocol and registered fields */ |
36 | | static int proto_pkcs1; |
37 | | static int hf_pkcs1_DSA_Params_PDU; /* DSA_Params */ |
38 | | static int hf_pkcs1_DomainParameters_PDU; /* DomainParameters */ |
39 | | static int hf_pkcs1_KEA_Params_Id_PDU; /* KEA_Params_Id */ |
40 | | static int hf_pkcs1_HashAlgorithm_PDU; /* HashAlgorithm */ |
41 | | static int hf_pkcs1_RSASSA_PSS_params_PDU; /* RSASSA_PSS_params */ |
42 | | static int hf_pkcs1_ECParameters_PDU; /* ECParameters */ |
43 | | static int hf_pkcs1_Prime_p_PDU; /* Prime_p */ |
44 | | static int hf_pkcs1_modulus; /* INTEGER */ |
45 | | static int hf_pkcs1_publicExponent; /* INTEGER */ |
46 | | static int hf_pkcs1_digestAlgorithm; /* DigestAlgorithmIdentifier */ |
47 | | static int hf_pkcs1_digest; /* Digest */ |
48 | | static int hf_pkcs1_p; /* INTEGER */ |
49 | | static int hf_pkcs1_q; /* INTEGER */ |
50 | | static int hf_pkcs1_g; /* INTEGER */ |
51 | | static int hf_pkcs1_j; /* INTEGER */ |
52 | | static int hf_pkcs1_validationParams; /* ValidationParams */ |
53 | | static int hf_pkcs1_seed; /* BIT_STRING */ |
54 | | static int hf_pkcs1_pgenCounter; /* INTEGER */ |
55 | | static int hf_pkcs1_hashAlgorithm; /* HashAlgorithm */ |
56 | | static int hf_pkcs1_maskGenAlgorithm; /* MaskGenAlgorithm */ |
57 | | static int hf_pkcs1_saltLength; /* INTEGER */ |
58 | | static int hf_pkcs1_trailerField; /* INTEGER */ |
59 | | static int hf_pkcs1_specifiedCurve; /* SpecifiedECDomain */ |
60 | | static int hf_pkcs1_namedCurve; /* OBJECT_IDENTIFIER */ |
61 | | static int hf_pkcs1_version; /* ECPVer */ |
62 | | static int hf_pkcs1_fieldID; /* FieldID */ |
63 | | static int hf_pkcs1_curve; /* Curve */ |
64 | | static int hf_pkcs1_base; /* ECPoint */ |
65 | | static int hf_pkcs1_order; /* INTEGER */ |
66 | | static int hf_pkcs1_cofactor; /* INTEGER */ |
67 | | static int hf_pkcs1_fieldType; /* T_fieldType */ |
68 | | static int hf_pkcs1_parameters; /* T_parameters */ |
69 | | static int hf_pkcs1_a; /* FieldElement */ |
70 | | static int hf_pkcs1_b; /* FieldElement */ |
71 | | static int hf_pkcs1_r; /* INTEGER */ |
72 | | static int hf_pkcs1_s; /* INTEGER */ |
73 | | |
74 | | /* Initialize the subtree pointers */ |
75 | | static int ett_pkcs1_RSAPublicKey; |
76 | | static int ett_pkcs1_DigestInfo; |
77 | | static int ett_pkcs1_DSA_Params; |
78 | | static int ett_pkcs1_DomainParameters; |
79 | | static int ett_pkcs1_ValidationParams; |
80 | | static int ett_pkcs1_RSASSA_PSS_params; |
81 | | static int ett_pkcs1_ECParameters; |
82 | | static int ett_pkcs1_SpecifiedECDomain; |
83 | | static int ett_pkcs1_FieldID; |
84 | | static int ett_pkcs1_Curve; |
85 | | static int ett_pkcs1_DSA_Sig_Value; |
86 | | static int ett_pkcs1_ECDSA_Sig_Value; |
87 | | |
88 | | |
89 | | |
90 | | static int |
91 | 0 | dissect_pkcs1_INTEGER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
92 | 0 | offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, |
93 | 0 | NULL); |
94 | |
|
95 | 0 | return offset; |
96 | 0 | } |
97 | | |
98 | | |
99 | | static const ber_sequence_t RSAPublicKey_sequence[] = { |
100 | | { &hf_pkcs1_modulus , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
101 | | { &hf_pkcs1_publicExponent, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
102 | | { NULL, 0, 0, 0, NULL } |
103 | | }; |
104 | | |
105 | | int |
106 | 0 | dissect_pkcs1_RSAPublicKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
107 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
108 | 0 | RSAPublicKey_sequence, hf_index, ett_pkcs1_RSAPublicKey); |
109 | |
|
110 | 0 | return offset; |
111 | 0 | } |
112 | | |
113 | | |
114 | | |
115 | | static int |
116 | 0 | dissect_pkcs1_DigestAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
117 | 0 | offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index); |
118 | |
|
119 | 0 | return offset; |
120 | 0 | } |
121 | | |
122 | | |
123 | | |
124 | | static int |
125 | 0 | dissect_pkcs1_Digest(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
126 | 0 | offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, |
127 | 0 | NULL); |
128 | |
|
129 | 0 | return offset; |
130 | 0 | } |
131 | | |
132 | | |
133 | | static const ber_sequence_t DigestInfo_sequence[] = { |
134 | | { &hf_pkcs1_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_DigestAlgorithmIdentifier }, |
135 | | { &hf_pkcs1_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Digest }, |
136 | | { NULL, 0, 0, 0, NULL } |
137 | | }; |
138 | | |
139 | | int |
140 | 0 | dissect_pkcs1_DigestInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
141 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
142 | 0 | DigestInfo_sequence, hf_index, ett_pkcs1_DigestInfo); |
143 | |
|
144 | 0 | return offset; |
145 | 0 | } |
146 | | |
147 | | |
148 | | static const ber_sequence_t DSA_Params_sequence[] = { |
149 | | { &hf_pkcs1_p , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
150 | | { &hf_pkcs1_q , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
151 | | { &hf_pkcs1_g , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
152 | | { NULL, 0, 0, 0, NULL } |
153 | | }; |
154 | | |
155 | | static int |
156 | 0 | dissect_pkcs1_DSA_Params(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
157 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
158 | 0 | DSA_Params_sequence, hf_index, ett_pkcs1_DSA_Params); |
159 | |
|
160 | 0 | return offset; |
161 | 0 | } |
162 | | |
163 | | |
164 | | |
165 | | |
166 | | static int |
167 | 0 | dissect_pkcs1_BIT_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
168 | 0 | offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset, |
169 | 0 | NULL, 0, hf_index, -1, |
170 | 0 | NULL); |
171 | |
|
172 | 0 | return offset; |
173 | 0 | } |
174 | | |
175 | | |
176 | | static const ber_sequence_t ValidationParams_sequence[] = { |
177 | | { &hf_pkcs1_seed , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_BIT_STRING }, |
178 | | { &hf_pkcs1_pgenCounter , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
179 | | { NULL, 0, 0, 0, NULL } |
180 | | }; |
181 | | |
182 | | static int |
183 | 0 | dissect_pkcs1_ValidationParams(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
184 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
185 | 0 | ValidationParams_sequence, hf_index, ett_pkcs1_ValidationParams); |
186 | |
|
187 | 0 | return offset; |
188 | 0 | } |
189 | | |
190 | | |
191 | | static const ber_sequence_t DomainParameters_sequence[] = { |
192 | | { &hf_pkcs1_p , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
193 | | { &hf_pkcs1_g , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
194 | | { &hf_pkcs1_q , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
195 | | { &hf_pkcs1_j , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
196 | | { &hf_pkcs1_validationParams, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_ValidationParams }, |
197 | | { NULL, 0, 0, 0, NULL } |
198 | | }; |
199 | | |
200 | | static int |
201 | 0 | dissect_pkcs1_DomainParameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
202 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
203 | 0 | DomainParameters_sequence, hf_index, ett_pkcs1_DomainParameters); |
204 | |
|
205 | 0 | return offset; |
206 | 0 | } |
207 | | |
208 | | |
209 | | |
210 | | |
211 | | static int |
212 | 0 | dissect_pkcs1_KEA_Params_Id(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
213 | 0 | offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, |
214 | 0 | NULL); |
215 | |
|
216 | 0 | return offset; |
217 | 0 | } |
218 | | |
219 | | |
220 | | |
221 | | static int |
222 | 0 | dissect_pkcs1_HashAlgorithm(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
223 | 0 | offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index); |
224 | |
|
225 | 0 | return offset; |
226 | 0 | } |
227 | | |
228 | | |
229 | | |
230 | | static int |
231 | 0 | dissect_pkcs1_MaskGenAlgorithm(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
232 | 0 | offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index); |
233 | |
|
234 | 0 | return offset; |
235 | 0 | } |
236 | | |
237 | | |
238 | | static const ber_sequence_t RSASSA_PSS_params_sequence[] = { |
239 | | { &hf_pkcs1_hashAlgorithm , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_pkcs1_HashAlgorithm }, |
240 | | { &hf_pkcs1_maskGenAlgorithm, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkcs1_MaskGenAlgorithm }, |
241 | | { &hf_pkcs1_saltLength , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkcs1_INTEGER }, |
242 | | { &hf_pkcs1_trailerField , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_pkcs1_INTEGER }, |
243 | | { NULL, 0, 0, 0, NULL } |
244 | | }; |
245 | | |
246 | | static int |
247 | 0 | dissect_pkcs1_RSASSA_PSS_params(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
248 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
249 | 0 | RSASSA_PSS_params_sequence, hf_index, ett_pkcs1_RSASSA_PSS_params); |
250 | |
|
251 | 0 | return offset; |
252 | 0 | } |
253 | | |
254 | | |
255 | | |
256 | | static int |
257 | 0 | dissect_pkcs1_ECPoint(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
258 | 0 | offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, |
259 | 0 | NULL); |
260 | |
|
261 | 0 | return offset; |
262 | 0 | } |
263 | | |
264 | | |
265 | | static const value_string pkcs1_ECPVer_vals[] = { |
266 | | { 1, "ecpVer1" }, |
267 | | { 0, NULL } |
268 | | }; |
269 | | |
270 | | |
271 | | static int |
272 | 0 | dissect_pkcs1_ECPVer(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
273 | 0 | offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, |
274 | 0 | NULL); |
275 | |
|
276 | 0 | return offset; |
277 | 0 | } |
278 | | |
279 | | |
280 | | |
281 | | static int |
282 | 0 | dissect_pkcs1_T_fieldType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
283 | 0 | offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference); |
284 | |
|
285 | 0 | return offset; |
286 | 0 | } |
287 | | |
288 | | |
289 | | |
290 | | static int |
291 | 0 | dissect_pkcs1_T_parameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
292 | 0 | offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL); |
293 | | |
294 | |
|
295 | 0 | return offset; |
296 | 0 | } |
297 | | |
298 | | |
299 | | static const ber_sequence_t FieldID_sequence[] = { |
300 | | { &hf_pkcs1_fieldType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs1_T_fieldType }, |
301 | | { &hf_pkcs1_parameters , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_pkcs1_T_parameters }, |
302 | | { NULL, 0, 0, 0, NULL } |
303 | | }; |
304 | | |
305 | | static int |
306 | 0 | dissect_pkcs1_FieldID(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
307 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
308 | 0 | FieldID_sequence, hf_index, ett_pkcs1_FieldID); |
309 | |
|
310 | 0 | return offset; |
311 | 0 | } |
312 | | |
313 | | |
314 | | |
315 | | static int |
316 | 0 | dissect_pkcs1_FieldElement(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
317 | 0 | offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, |
318 | 0 | NULL); |
319 | |
|
320 | 0 | return offset; |
321 | 0 | } |
322 | | |
323 | | |
324 | | static const ber_sequence_t Curve_sequence[] = { |
325 | | { &hf_pkcs1_a , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldElement }, |
326 | | { &hf_pkcs1_b , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldElement }, |
327 | | { &hf_pkcs1_seed , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_BIT_STRING }, |
328 | | { NULL, 0, 0, 0, NULL } |
329 | | }; |
330 | | |
331 | | static int |
332 | 0 | dissect_pkcs1_Curve(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
333 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
334 | 0 | Curve_sequence, hf_index, ett_pkcs1_Curve); |
335 | |
|
336 | 0 | return offset; |
337 | 0 | } |
338 | | |
339 | | |
340 | | static const ber_sequence_t SpecifiedECDomain_sequence[] = { |
341 | | { &hf_pkcs1_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_ECPVer }, |
342 | | { &hf_pkcs1_fieldID , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldID }, |
343 | | { &hf_pkcs1_curve , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Curve }, |
344 | | { &hf_pkcs1_base , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_ECPoint }, |
345 | | { &hf_pkcs1_order , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
346 | | { &hf_pkcs1_cofactor , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER }, |
347 | | { NULL, 0, 0, 0, NULL } |
348 | | }; |
349 | | |
350 | | static int |
351 | 0 | dissect_pkcs1_SpecifiedECDomain(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
352 | 0 | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
353 | 0 | SpecifiedECDomain_sequence, hf_index, ett_pkcs1_SpecifiedECDomain); |
354 | |
|
355 | 0 | return offset; |
356 | 0 | } |
357 | | |
358 | | |
359 | | |
360 | | static int |
361 | 0 | dissect_pkcs1_OBJECT_IDENTIFIER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
362 | 0 | offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); |
363 | |
|
364 | 0 | return offset; |
365 | 0 | } |
366 | | |
367 | | |
368 | | static const value_string pkcs1_ECParameters_vals[] = { |
369 | | { 0, "specifiedCurve" }, |
370 | | { 1, "namedCurve" }, |
371 | | { 0, NULL } |
372 | | }; |
373 | | |
374 | | static const ber_choice_t ECParameters_choice[] = { |
375 | | { 0, &hf_pkcs1_specifiedCurve, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_SpecifiedECDomain }, |
376 | | { 1, &hf_pkcs1_namedCurve , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs1_OBJECT_IDENTIFIER }, |
377 | | { 0, NULL, 0, 0, 0, NULL } |
378 | | }; |
379 | | |
380 | | static int |
381 | 0 | dissect_pkcs1_ECParameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
382 | 0 | offset = dissect_ber_choice(actx, tree, tvb, offset, |
383 | 0 | ECParameters_choice, hf_index, ett_pkcs1_ECParameters, |
384 | 0 | NULL); |
385 | |
|
386 | 0 | return offset; |
387 | 0 | } |
388 | | |
389 | | |
390 | | |
391 | | static int |
392 | 0 | dissect_pkcs1_Prime_p(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
393 | 0 | offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, |
394 | 0 | NULL); |
395 | |
|
396 | 0 | return offset; |
397 | 0 | } |
398 | | |
399 | | |
400 | | |
401 | | /*--- PDUs ---*/ |
402 | | |
403 | 0 | static int dissect_DSA_Params_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
404 | 0 | int offset = 0; |
405 | 0 | asn1_ctx_t asn1_ctx; |
406 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
407 | 0 | offset = dissect_pkcs1_DSA_Params(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_DSA_Params_PDU); |
408 | 0 | return offset; |
409 | 0 | } |
410 | 0 | static int dissect_DomainParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
411 | 0 | int offset = 0; |
412 | 0 | asn1_ctx_t asn1_ctx; |
413 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
414 | 0 | offset = dissect_pkcs1_DomainParameters(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_DomainParameters_PDU); |
415 | 0 | return offset; |
416 | 0 | } |
417 | 0 | static int dissect_KEA_Params_Id_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
418 | 0 | int offset = 0; |
419 | 0 | asn1_ctx_t asn1_ctx; |
420 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
421 | 0 | offset = dissect_pkcs1_KEA_Params_Id(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_KEA_Params_Id_PDU); |
422 | 0 | return offset; |
423 | 0 | } |
424 | 0 | static int dissect_HashAlgorithm_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
425 | 0 | int offset = 0; |
426 | 0 | asn1_ctx_t asn1_ctx; |
427 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
428 | 0 | offset = dissect_pkcs1_HashAlgorithm(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_HashAlgorithm_PDU); |
429 | 0 | return offset; |
430 | 0 | } |
431 | 0 | static int dissect_RSASSA_PSS_params_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
432 | 0 | int offset = 0; |
433 | 0 | asn1_ctx_t asn1_ctx; |
434 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
435 | 0 | offset = dissect_pkcs1_RSASSA_PSS_params(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_RSASSA_PSS_params_PDU); |
436 | 0 | return offset; |
437 | 0 | } |
438 | 0 | static int dissect_ECParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
439 | 0 | int offset = 0; |
440 | 0 | asn1_ctx_t asn1_ctx; |
441 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
442 | 0 | offset = dissect_pkcs1_ECParameters(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_ECParameters_PDU); |
443 | 0 | return offset; |
444 | 0 | } |
445 | 0 | static int dissect_Prime_p_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
446 | 0 | int offset = 0; |
447 | 0 | asn1_ctx_t asn1_ctx; |
448 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
449 | 0 | offset = dissect_pkcs1_Prime_p(false, tvb, offset, &asn1_ctx, tree, hf_pkcs1_Prime_p_PDU); |
450 | 0 | return offset; |
451 | 0 | } |
452 | | |
453 | | |
454 | | /*--- proto_register_pkcs1 ----------------------------------------------*/ |
455 | 14 | void proto_register_pkcs1(void) { |
456 | | |
457 | | /* List of fields */ |
458 | 14 | static hf_register_info hf[] = { |
459 | 14 | { &hf_pkcs1_DSA_Params_PDU, |
460 | 14 | { "DSA-Params", "pkcs1.DSA_Params_element", |
461 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
462 | 14 | NULL, HFILL }}, |
463 | 14 | { &hf_pkcs1_DomainParameters_PDU, |
464 | 14 | { "DomainParameters", "pkcs1.DomainParameters_element", |
465 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
466 | 14 | NULL, HFILL }}, |
467 | 14 | { &hf_pkcs1_KEA_Params_Id_PDU, |
468 | 14 | { "KEA-Params-Id", "pkcs1.KEA_Params_Id", |
469 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
470 | 14 | NULL, HFILL }}, |
471 | 14 | { &hf_pkcs1_HashAlgorithm_PDU, |
472 | 14 | { "HashAlgorithm", "pkcs1.HashAlgorithm_element", |
473 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
474 | 14 | NULL, HFILL }}, |
475 | 14 | { &hf_pkcs1_RSASSA_PSS_params_PDU, |
476 | 14 | { "RSASSA-PSS-params", "pkcs1.RSASSA_PSS_params_element", |
477 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
478 | 14 | NULL, HFILL }}, |
479 | 14 | { &hf_pkcs1_ECParameters_PDU, |
480 | 14 | { "ECParameters", "pkcs1.ECParameters", |
481 | 14 | FT_UINT32, BASE_DEC, VALS(pkcs1_ECParameters_vals), 0, |
482 | 14 | NULL, HFILL }}, |
483 | 14 | { &hf_pkcs1_Prime_p_PDU, |
484 | 14 | { "Prime-p", "pkcs1.Prime_p", |
485 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
486 | 14 | NULL, HFILL }}, |
487 | 14 | { &hf_pkcs1_modulus, |
488 | 14 | { "modulus", "pkcs1.modulus", |
489 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
490 | 14 | "INTEGER", HFILL }}, |
491 | 14 | { &hf_pkcs1_publicExponent, |
492 | 14 | { "publicExponent", "pkcs1.publicExponent", |
493 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
494 | 14 | "INTEGER", HFILL }}, |
495 | 14 | { &hf_pkcs1_digestAlgorithm, |
496 | 14 | { "digestAlgorithm", "pkcs1.digestAlgorithm_element", |
497 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
498 | 14 | "DigestAlgorithmIdentifier", HFILL }}, |
499 | 14 | { &hf_pkcs1_digest, |
500 | 14 | { "digest", "pkcs1.digest", |
501 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
502 | 14 | NULL, HFILL }}, |
503 | 14 | { &hf_pkcs1_p, |
504 | 14 | { "p", "pkcs1.p", |
505 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
506 | 14 | "INTEGER", HFILL }}, |
507 | 14 | { &hf_pkcs1_q, |
508 | 14 | { "q", "pkcs1.q", |
509 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
510 | 14 | "INTEGER", HFILL }}, |
511 | 14 | { &hf_pkcs1_g, |
512 | 14 | { "g", "pkcs1.g", |
513 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
514 | 14 | "INTEGER", HFILL }}, |
515 | 14 | { &hf_pkcs1_j, |
516 | 14 | { "j", "pkcs1.j", |
517 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
518 | 14 | "INTEGER", HFILL }}, |
519 | 14 | { &hf_pkcs1_validationParams, |
520 | 14 | { "validationParams", "pkcs1.validationParams_element", |
521 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
522 | 14 | NULL, HFILL }}, |
523 | 14 | { &hf_pkcs1_seed, |
524 | 14 | { "seed", "pkcs1.seed", |
525 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
526 | 14 | "BIT_STRING", HFILL }}, |
527 | 14 | { &hf_pkcs1_pgenCounter, |
528 | 14 | { "pgenCounter", "pkcs1.pgenCounter", |
529 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
530 | 14 | "INTEGER", HFILL }}, |
531 | 14 | { &hf_pkcs1_hashAlgorithm, |
532 | 14 | { "hashAlgorithm", "pkcs1.hashAlgorithm_element", |
533 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
534 | 14 | NULL, HFILL }}, |
535 | 14 | { &hf_pkcs1_maskGenAlgorithm, |
536 | 14 | { "maskGenAlgorithm", "pkcs1.maskGenAlgorithm_element", |
537 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
538 | 14 | NULL, HFILL }}, |
539 | 14 | { &hf_pkcs1_saltLength, |
540 | 14 | { "saltLength", "pkcs1.saltLength", |
541 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
542 | 14 | "INTEGER", HFILL }}, |
543 | 14 | { &hf_pkcs1_trailerField, |
544 | 14 | { "trailerField", "pkcs1.trailerField", |
545 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
546 | 14 | "INTEGER", HFILL }}, |
547 | 14 | { &hf_pkcs1_specifiedCurve, |
548 | 14 | { "specifiedCurve", "pkcs1.specifiedCurve_element", |
549 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
550 | 14 | "SpecifiedECDomain", HFILL }}, |
551 | 14 | { &hf_pkcs1_namedCurve, |
552 | 14 | { "namedCurve", "pkcs1.namedCurve", |
553 | 14 | FT_OID, BASE_NONE, NULL, 0, |
554 | 14 | "OBJECT_IDENTIFIER", HFILL }}, |
555 | 14 | { &hf_pkcs1_version, |
556 | 14 | { "version", "pkcs1.version", |
557 | 14 | FT_INT32, BASE_DEC, VALS(pkcs1_ECPVer_vals), 0, |
558 | 14 | "ECPVer", HFILL }}, |
559 | 14 | { &hf_pkcs1_fieldID, |
560 | 14 | { "fieldID", "pkcs1.fieldID_element", |
561 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
562 | 14 | NULL, HFILL }}, |
563 | 14 | { &hf_pkcs1_curve, |
564 | 14 | { "curve", "pkcs1.curve_element", |
565 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
566 | 14 | NULL, HFILL }}, |
567 | 14 | { &hf_pkcs1_base, |
568 | 14 | { "base", "pkcs1.base", |
569 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
570 | 14 | "ECPoint", HFILL }}, |
571 | 14 | { &hf_pkcs1_order, |
572 | 14 | { "order", "pkcs1.order", |
573 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
574 | 14 | "INTEGER", HFILL }}, |
575 | 14 | { &hf_pkcs1_cofactor, |
576 | 14 | { "cofactor", "pkcs1.cofactor", |
577 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
578 | 14 | "INTEGER", HFILL }}, |
579 | 14 | { &hf_pkcs1_fieldType, |
580 | 14 | { "fieldType", "pkcs1.fieldType", |
581 | 14 | FT_OID, BASE_NONE, NULL, 0, |
582 | 14 | NULL, HFILL }}, |
583 | 14 | { &hf_pkcs1_parameters, |
584 | 14 | { "parameters", "pkcs1.parameters_element", |
585 | 14 | FT_NONE, BASE_NONE, NULL, 0, |
586 | 14 | NULL, HFILL }}, |
587 | 14 | { &hf_pkcs1_a, |
588 | 14 | { "a", "pkcs1.a", |
589 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
590 | 14 | "FieldElement", HFILL }}, |
591 | 14 | { &hf_pkcs1_b, |
592 | 14 | { "b", "pkcs1.b", |
593 | 14 | FT_BYTES, BASE_NONE, NULL, 0, |
594 | 14 | "FieldElement", HFILL }}, |
595 | 14 | { &hf_pkcs1_r, |
596 | 14 | { "r", "pkcs1.r", |
597 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
598 | 14 | "INTEGER", HFILL }}, |
599 | 14 | { &hf_pkcs1_s, |
600 | 14 | { "s", "pkcs1.s", |
601 | 14 | FT_INT32, BASE_DEC, NULL, 0, |
602 | 14 | "INTEGER", HFILL }}, |
603 | 14 | }; |
604 | | |
605 | | /* List of subtrees */ |
606 | 14 | static int *ett[] = { |
607 | 14 | &ett_pkcs1_RSAPublicKey, |
608 | 14 | &ett_pkcs1_DigestInfo, |
609 | 14 | &ett_pkcs1_DSA_Params, |
610 | 14 | &ett_pkcs1_DomainParameters, |
611 | 14 | &ett_pkcs1_ValidationParams, |
612 | 14 | &ett_pkcs1_RSASSA_PSS_params, |
613 | 14 | &ett_pkcs1_ECParameters, |
614 | 14 | &ett_pkcs1_SpecifiedECDomain, |
615 | 14 | &ett_pkcs1_FieldID, |
616 | 14 | &ett_pkcs1_Curve, |
617 | 14 | &ett_pkcs1_DSA_Sig_Value, |
618 | 14 | &ett_pkcs1_ECDSA_Sig_Value, |
619 | 14 | }; |
620 | | |
621 | | /* Register protocol */ |
622 | 14 | proto_pkcs1 = proto_register_protocol(PNAME, PSNAME, PFNAME); |
623 | | |
624 | | /* Register fields and subtrees */ |
625 | 14 | proto_register_field_array(proto_pkcs1, hf, array_length(hf)); |
626 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
627 | | |
628 | 14 | } |
629 | | |
630 | | |
631 | | /*--- proto_reg_handoff_pkcs1 -------------------------------------------*/ |
632 | 14 | void proto_reg_handoff_pkcs1(void) { |
633 | 14 | register_ber_oid_dissector("1.2.840.10040.4.1", dissect_DSA_Params_PDU, proto_pkcs1, "id-dsa"); |
634 | 14 | register_ber_oid_dissector("1.2.840.10046.2.1", dissect_DomainParameters_PDU, proto_pkcs1, "dhpublicnumber"); |
635 | 14 | register_ber_oid_dissector("2.16.840.1.101.2.1.1.22", dissect_KEA_Params_Id_PDU, proto_pkcs1, "id-keyExchangeAlgorithm"); |
636 | 14 | register_ber_oid_dissector("1.2.840.10045.2.1", dissect_ECParameters_PDU, proto_pkcs1, "id-ecPublicKey"); |
637 | 14 | register_ber_oid_dissector("1.3.132.1.12", dissect_ECParameters_PDU, proto_pkcs1, "id-ecDH"); |
638 | 14 | register_ber_oid_dissector("1.2.840.10045.2.13", dissect_ECParameters_PDU, proto_pkcs1, "id-ecMQV"); |
639 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.10", dissect_RSASSA_PSS_params_PDU, proto_pkcs1, "id-RSASSA-PSS"); |
640 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.8", dissect_HashAlgorithm_PDU, proto_pkcs1, "id-mgf1"); |
641 | 14 | register_ber_oid_dissector("1.2.840.10045.1.1", dissect_Prime_p_PDU, proto_pkcs1, "prime-field"); |
642 | | |
643 | | |
644 | 14 | register_ber_oid_dissector("1.2.840.113549.2.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2"); |
645 | 14 | register_ber_oid_dissector("1.2.840.113549.2.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4"); |
646 | 14 | register_ber_oid_dissector("1.2.840.113549.2.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5"); |
647 | | |
648 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaEncryption"); |
649 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2WithRSAEncryption"); |
650 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.3", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4WithRSAEncryption"); |
651 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5WithRSAEncryption"); |
652 | | |
653 | | |
654 | | /* these two are not from RFC2313 but pulled in from |
655 | | http://www.alvestrand.no/objectid/1.2.840.113549.1.1.html |
656 | | */ |
657 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha1WithRSAEncryption"); |
658 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.6", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaOAEPEncryptionSET"); |
659 | | |
660 | | /* these sha2 algorithms are from RFC3447 */ |
661 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.11", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha256WithRSAEncryption"); |
662 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.12", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha384WithRSAEncryption"); |
663 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.13", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha512WithRSAEncryption"); |
664 | 14 | register_ber_oid_dissector("1.2.840.113549.1.1.14", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha224WithRSAEncryption"); |
665 | | |
666 | | /* ECDSA SHA-1 algorithm from RFC 3279 */ |
667 | 14 | register_ber_oid_dissector("1.2.840.10045.4.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA1"); |
668 | | |
669 | | /* SM2-with-SM3 from GM/T 0006 Cryptographic application identifier criterion specification */ |
670 | 14 | register_ber_oid_dissector("1.2.156.10197.1.501", dissect_ber_oid_NULL_callback, proto_pkcs1, "SM2-with-SM3"); |
671 | | |
672 | | /* ECDSA SHA2 algorithms from X9.62, RFC5480, RFC 5758, RFC 5912 */ |
673 | 14 | register_ber_oid_dissector("1.2.840.10045.4.3.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA224"); |
674 | 14 | register_ber_oid_dissector("1.2.840.10045.4.3.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA256"); |
675 | 14 | register_ber_oid_dissector("1.2.840.10045.4.3.3", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA384"); |
676 | 14 | register_ber_oid_dissector("1.2.840.10045.4.3.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA512"); |
677 | | |
678 | | /* DSA SHA2 algorithms from FIPS186-3, RFC5480, RFC 5758, RFC 5912 */ |
679 | 14 | register_ber_oid_dissector("2.16.840.1.101.3.4.3.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "id-dsa-with-sha224"); |
680 | 14 | register_ber_oid_dissector("2.16.840.1.101.3.4.3.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "id-dsa-with-sha256"); |
681 | | |
682 | 14 | oid_add_from_string("secp192r1","1.2.840.10045.3.1.1"); |
683 | 14 | oid_add_from_string("sect163k1","1.3.132.0.1"); |
684 | 14 | oid_add_from_string("sect163r2","1.3.132.0.15"); |
685 | 14 | oid_add_from_string("secp224r1","1.3.132.0.33"); |
686 | 14 | oid_add_from_string("sect233k1","1.3.132.0.26"); |
687 | 14 | oid_add_from_string("sect233r1","1.3.132.0.27"); |
688 | 14 | oid_add_from_string("secp256r1","1.2.840.10045.3.1.7"); |
689 | 14 | oid_add_from_string("sect283k1","1.3.132.0.16"); |
690 | 14 | oid_add_from_string("sect283r1","1.3.132.0.17"); |
691 | 14 | oid_add_from_string("secp384r1","1.3.132.0.34"); |
692 | 14 | oid_add_from_string("sect409k1","1.3.132.0.36"); |
693 | 14 | oid_add_from_string("sect409r1","1.3.132.0.37"); |
694 | 14 | oid_add_from_string("secp521r1","1.3.132.0.35"); |
695 | 14 | oid_add_from_string("sect571k1","1.3.132.0.38"); |
696 | 14 | oid_add_from_string("sect571r1","1.3.132.0.39"); |
697 | | |
698 | | /* SM2 from GM/T 0006 Cryptographic application identifier criterion specification */ |
699 | 14 | oid_add_from_string("sm2","1.2.156.10197.1.301"); |
700 | | |
701 | | /* sha2 family, see RFC3447 and http://www.oid-info.com/get/2.16.840.1.101.3.4.2 */ |
702 | 14 | oid_add_from_string("sha256", "2.16.840.1.101.3.4.2.1"); |
703 | 14 | oid_add_from_string("sha384", "2.16.840.1.101.3.4.2.2"); |
704 | 14 | oid_add_from_string("sha512", "2.16.840.1.101.3.4.2.3"); |
705 | 14 | oid_add_from_string("sha224", "2.16.840.1.101.3.4.2.4"); |
706 | | |
707 | | /* SM3 from GM/T 0006 Cryptographic application identifier criterion specification */ |
708 | 14 | oid_add_from_string("sm3","1.2.156.10197.1.401"); |
709 | | |
710 | | /* PQC digital signature algorithms from OQS-OpenSSL, |
711 | | see https://github.com/open-quantum-safe/openssl/blob/OQS-OpenSSL_1_1_1-stable/oqs-template/oqs-sig-info.md */ |
712 | 14 | oid_add_from_string("dilithium2", "1.3.6.1.4.1.2.267.7.4.4"); |
713 | 14 | oid_add_from_string("p256_dilithium2", "1.3.9999.2.7.1"); |
714 | 14 | oid_add_from_string("rsa3072_dilithium2", "1.3.9999.2.7.2"); |
715 | 14 | oid_add_from_string("dilithium3", "1.3.6.1.4.1.2.267.7.6.5"); |
716 | 14 | oid_add_from_string("p384_dilithium3", "1.3.9999.2.7.3"); |
717 | 14 | oid_add_from_string("dilithium5", "1.3.6.1.4.1.2.267.7.8.7"); |
718 | 14 | oid_add_from_string("p521_dilithium5", "1.3.9999.2.7.4"); |
719 | 14 | oid_add_from_string("dilithium2_aes", "1.3.6.1.4.1.2.267.11.4.4"); |
720 | 14 | oid_add_from_string("p256_dilithium2_aes", "1.3.9999.2.11.1"); |
721 | 14 | oid_add_from_string("rsa3072_dilithium2_aes", "1.3.9999.2.11.2"); |
722 | 14 | oid_add_from_string("dilithium3_aes", "1.3.6.1.4.1.2.267.11.6.5"); |
723 | 14 | oid_add_from_string("p384_dilithium3_aes", "1.3.9999.2.11.3"); |
724 | 14 | oid_add_from_string("dilithium5_aes", "1.3.6.1.4.1.2.267.11.8.7"); |
725 | 14 | oid_add_from_string("p521_dilithium5_aes", "1.3.9999.2.11.4"); |
726 | 14 | oid_add_from_string("falcon512", "1.3.9999.3.1"); |
727 | 14 | oid_add_from_string("p256_falcon512", "1.3.9999.3.2"); |
728 | 14 | oid_add_from_string("rsa3072_falcon512", "1.3.9999.3.3"); |
729 | 14 | oid_add_from_string("falcon1024", "1.3.9999.3.4"); |
730 | 14 | oid_add_from_string("p521_falcon1024", "1.3.9999.3.5"); |
731 | 14 | oid_add_from_string("picnicl1full", "1.3.6.1.4.1.311.89.2.1.7"); |
732 | 14 | oid_add_from_string("p256_picnicl1full", "1.3.6.1.4.1.311.89.2.1.8"); |
733 | 14 | oid_add_from_string("rsa3072_picnicl1full", "1.3.6.1.4.1.311.89.2.1.9"); |
734 | 14 | oid_add_from_string("picnic3l1", "1.3.6.1.4.1.311.89.2.1.21"); |
735 | 14 | oid_add_from_string("p256_picnic3l1", "1.3.6.1.4.1.311.89.2.1.22"); |
736 | 14 | oid_add_from_string("rsa3072_picnic3l1", "1.3.6.1.4.1.311.89.2.1.23"); |
737 | 14 | oid_add_from_string("rainbowIclassic", "1.3.9999.5.1.1.1"); |
738 | 14 | oid_add_from_string("p256_rainbowIclassic", "1.3.9999.5.1.2.1"); |
739 | 14 | oid_add_from_string("rsa3072_rainbowIclassic", "1.3.9999.5.1.3.1"); |
740 | 14 | oid_add_from_string("rainbowVclassic", "1.3.9999.5.3.1.1"); |
741 | 14 | oid_add_from_string("p521_rainbowVclassic", "1.3.9999.5.3.2.1"); |
742 | 14 | oid_add_from_string("sphincsharaka128frobust", "1.3.9999.6.1.1"); |
743 | 14 | oid_add_from_string("p256_sphincsharaka128frobust", "1.3.9999.6.1.2"); |
744 | 14 | oid_add_from_string("rsa3072_sphincsharaka128frobust", "1.3.9999.6.1.3"); |
745 | 14 | oid_add_from_string("sphincssha256128frobust", "1.3.9999.6.4.1"); |
746 | 14 | oid_add_from_string("p256_sphincssha256128frobust", "1.3.9999.6.4.2"); |
747 | 14 | oid_add_from_string("rsa3072_sphincssha256128frobust", "1.3.9999.6.4.3"); |
748 | 14 | oid_add_from_string("sphincsshake256128frobust", "1.3.9999.6.7.1"); |
749 | 14 | oid_add_from_string("p256_sphincsshake256128frobust", "1.3.9999.6.7.2"); |
750 | 14 | oid_add_from_string("rsa3072_sphincsshake256128frobust", "1.3.9999.6.7.3"); |
751 | | |
752 | 14 | } |
753 | | |