Added support for configuring custom IMF headers.
[obnox/wireshark/wip.git] / epan / dissectors / packet-pkcs1.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* packet-pkcs1.c                                                             */
4 /* ../../tools/asn2wrs.py -b -p pkcs1 -c ./pkcs1.cnf -s ./packet-pkcs1-template -D . PKIXAlgs-2009.asn */
5
6 /* Input file: packet-pkcs1-template.c */
7
8 #line 1 "../../asn1/pkcs1/packet-pkcs1-template.c"
9 /* packet-pkcs1.c
10  * Routines for PKCS#1/RFC2313 packet dissection
11  *  Ronnie Sahlberg 2004
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40 #include <epan/oids.h>
41 #include <epan/asn1.h>
42
43 #include "packet-ber.h"
44 #include "packet-pkcs1.h"
45 #include "packet-x509af.h"
46
47 #define PNAME  "PKCS#1"
48 #define PSNAME "PKCS-1"
49 #define PFNAME "pkcs-1"
50
51 /* Initialize the protocol and registered fields */
52 static int proto_pkcs1 = -1;
53
54 /*--- Included file: packet-pkcs1-hf.c ---*/
55 #line 1 "../../asn1/pkcs1/packet-pkcs1-hf.c"
56 static int hf_pkcs1_DSA_Params_PDU = -1;          /* DSA_Params */
57 static int hf_pkcs1_DomainParameters_PDU = -1;    /* DomainParameters */
58 static int hf_pkcs1_KEA_Params_Id_PDU = -1;       /* KEA_Params_Id */
59 static int hf_pkcs1_ECParameters_PDU = -1;        /* ECParameters */
60 static int hf_pkcs1_modulus = -1;                 /* INTEGER */
61 static int hf_pkcs1_publicExponent = -1;          /* INTEGER */
62 static int hf_pkcs1_version = -1;                 /* Version */
63 static int hf_pkcs1_privateExponent = -1;         /* INTEGER */
64 static int hf_pkcs1_prime1 = -1;                  /* INTEGER */
65 static int hf_pkcs1_prime2 = -1;                  /* INTEGER */
66 static int hf_pkcs1_exponent1 = -1;               /* INTEGER */
67 static int hf_pkcs1_exponent2 = -1;               /* INTEGER */
68 static int hf_pkcs1_coefficient = -1;             /* INTEGER */
69 static int hf_pkcs1_digestAlgorithm = -1;         /* DigestAlgorithmIdentifier */
70 static int hf_pkcs1_digest = -1;                  /* Digest */
71 static int hf_pkcs1_p = -1;                       /* INTEGER */
72 static int hf_pkcs1_q = -1;                       /* INTEGER */
73 static int hf_pkcs1_g = -1;                       /* INTEGER */
74 static int hf_pkcs1_j = -1;                       /* INTEGER */
75 static int hf_pkcs1_validationParams = -1;        /* ValidationParams */
76 static int hf_pkcs1_seed = -1;                    /* BIT_STRING */
77 static int hf_pkcs1_pgenCounter = -1;             /* INTEGER */
78 static int hf_pkcs1_namedCurve = -1;              /* OBJECT_IDENTIFIER */
79 static int hf_pkcs1_r = -1;                       /* INTEGER */
80 static int hf_pkcs1_s = -1;                       /* INTEGER */
81
82 /*--- End of included file: packet-pkcs1-hf.c ---*/
83 #line 46 "../../asn1/pkcs1/packet-pkcs1-template.c"
84
85 /* Initialize the subtree pointers */
86
87 /*--- Included file: packet-pkcs1-ett.c ---*/
88 #line 1 "../../asn1/pkcs1/packet-pkcs1-ett.c"
89 static gint ett_pkcs1_RSAPublicKey = -1;
90 static gint ett_pkcs1_RSAPrivateKey = -1;
91 static gint ett_pkcs1_DigestInfo = -1;
92 static gint ett_pkcs1_DSA_Params = -1;
93 static gint ett_pkcs1_DomainParameters = -1;
94 static gint ett_pkcs1_ValidationParams = -1;
95 static gint ett_pkcs1_ECParameters = -1;
96 static gint ett_pkcs1_DSA_Sig_Value = -1;
97 static gint ett_pkcs1_ECDSA_Sig_Value = -1;
98
99 /*--- End of included file: packet-pkcs1-ett.c ---*/
100 #line 49 "../../asn1/pkcs1/packet-pkcs1-template.c"
101
102
103 /*--- Included file: packet-pkcs1-fn.c ---*/
104 #line 1 "../../asn1/pkcs1/packet-pkcs1-fn.c"
105
106
107 static int
108 dissect_pkcs1_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
109   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
110                                                 NULL);
111
112   return offset;
113 }
114
115
116 static const ber_sequence_t RSAPublicKey_sequence[] = {
117   { &hf_pkcs1_modulus       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
118   { &hf_pkcs1_publicExponent, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
119   { NULL, 0, 0, 0, NULL }
120 };
121
122 int
123 dissect_pkcs1_RSAPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
124   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
125                                    RSAPublicKey_sequence, hf_index, ett_pkcs1_RSAPublicKey);
126
127   return offset;
128 }
129
130
131
132 static int
133 dissect_pkcs1_Version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
134   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
135                                                 NULL);
136
137   return offset;
138 }
139
140
141 static const ber_sequence_t RSAPrivateKey_sequence[] = {
142   { &hf_pkcs1_version       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Version },
143   { &hf_pkcs1_modulus       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
144   { &hf_pkcs1_publicExponent, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
145   { &hf_pkcs1_privateExponent, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
146   { &hf_pkcs1_prime1        , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
147   { &hf_pkcs1_prime2        , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
148   { &hf_pkcs1_exponent1     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
149   { &hf_pkcs1_exponent2     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
150   { &hf_pkcs1_coefficient   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
151   { NULL, 0, 0, 0, NULL }
152 };
153
154 int
155 dissect_pkcs1_RSAPrivateKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
156   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
157                                    RSAPrivateKey_sequence, hf_index, ett_pkcs1_RSAPrivateKey);
158
159   return offset;
160 }
161
162
163
164 static int
165 dissect_pkcs1_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
166   offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
167
168   return offset;
169 }
170
171
172
173 static int
174 dissect_pkcs1_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
175   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
176                                        NULL);
177
178   return offset;
179 }
180
181
182 static const ber_sequence_t DigestInfo_sequence[] = {
183   { &hf_pkcs1_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_DigestAlgorithmIdentifier },
184   { &hf_pkcs1_digest        , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Digest },
185   { NULL, 0, 0, 0, NULL }
186 };
187
188 int
189 dissect_pkcs1_DigestInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
190   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
191                                    DigestInfo_sequence, hf_index, ett_pkcs1_DigestInfo);
192
193   return offset;
194 }
195
196
197 static const ber_sequence_t DSA_Params_sequence[] = {
198   { &hf_pkcs1_p             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
199   { &hf_pkcs1_q             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
200   { &hf_pkcs1_g             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
201   { NULL, 0, 0, 0, NULL }
202 };
203
204 static int
205 dissect_pkcs1_DSA_Params(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
206   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
207                                    DSA_Params_sequence, hf_index, ett_pkcs1_DSA_Params);
208
209   return offset;
210 }
211
212
213
214
215 static int
216 dissect_pkcs1_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
217   offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
218                                     NULL, hf_index, -1,
219                                     NULL);
220
221   return offset;
222 }
223
224
225 static const ber_sequence_t ValidationParams_sequence[] = {
226   { &hf_pkcs1_seed          , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_BIT_STRING },
227   { &hf_pkcs1_pgenCounter   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
228   { NULL, 0, 0, 0, NULL }
229 };
230
231 static int
232 dissect_pkcs1_ValidationParams(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
233   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
234                                    ValidationParams_sequence, hf_index, ett_pkcs1_ValidationParams);
235
236   return offset;
237 }
238
239
240 static const ber_sequence_t DomainParameters_sequence[] = {
241   { &hf_pkcs1_p             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
242   { &hf_pkcs1_g             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
243   { &hf_pkcs1_q             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
244   { &hf_pkcs1_j             , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
245   { &hf_pkcs1_validationParams, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_ValidationParams },
246   { NULL, 0, 0, 0, NULL }
247 };
248
249 static int
250 dissect_pkcs1_DomainParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
251   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
252                                    DomainParameters_sequence, hf_index, ett_pkcs1_DomainParameters);
253
254   return offset;
255 }
256
257
258
259
260 static int
261 dissect_pkcs1_KEA_Params_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
262   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
263                                        NULL);
264
265   return offset;
266 }
267
268
269
270
271 static int
272 dissect_pkcs1_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
273   offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
274
275   return offset;
276 }
277
278
279 static const value_string pkcs1_ECParameters_vals[] = {
280   {   0, "namedCurve" },
281   { 0, NULL }
282 };
283
284 static const ber_choice_t ECParameters_choice[] = {
285   {   0, &hf_pkcs1_namedCurve    , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs1_OBJECT_IDENTIFIER },
286   { 0, NULL, 0, 0, 0, NULL }
287 };
288
289 static int
290 dissect_pkcs1_ECParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
291   offset = dissect_ber_choice(actx, tree, tvb, offset,
292                                  ECParameters_choice, hf_index, ett_pkcs1_ECParameters,
293                                  NULL);
294
295   return offset;
296 }
297
298
299
300 /*--- PDUs ---*/
301
302 static void dissect_DSA_Params_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
303   asn1_ctx_t asn1_ctx;
304   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
305   dissect_pkcs1_DSA_Params(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs1_DSA_Params_PDU);
306 }
307 static void dissect_DomainParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
308   asn1_ctx_t asn1_ctx;
309   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
310   dissect_pkcs1_DomainParameters(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs1_DomainParameters_PDU);
311 }
312 static void dissect_KEA_Params_Id_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
313   asn1_ctx_t asn1_ctx;
314   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
315   dissect_pkcs1_KEA_Params_Id(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs1_KEA_Params_Id_PDU);
316 }
317 static void dissect_ECParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
318   asn1_ctx_t asn1_ctx;
319   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
320   dissect_pkcs1_ECParameters(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs1_ECParameters_PDU);
321 }
322
323
324 /*--- End of included file: packet-pkcs1-fn.c ---*/
325 #line 51 "../../asn1/pkcs1/packet-pkcs1-template.c"
326
327 /*--- proto_register_pkcs1 ----------------------------------------------*/
328 void proto_register_pkcs1(void) {
329
330   /* List of fields */
331   static hf_register_info hf[] = {
332
333 /*--- Included file: packet-pkcs1-hfarr.c ---*/
334 #line 1 "../../asn1/pkcs1/packet-pkcs1-hfarr.c"
335     { &hf_pkcs1_DSA_Params_PDU,
336       { "DSA-Params", "pkcs1.DSA_Params",
337         FT_NONE, BASE_NONE, NULL, 0,
338         NULL, HFILL }},
339     { &hf_pkcs1_DomainParameters_PDU,
340       { "DomainParameters", "pkcs1.DomainParameters",
341         FT_NONE, BASE_NONE, NULL, 0,
342         NULL, HFILL }},
343     { &hf_pkcs1_KEA_Params_Id_PDU,
344       { "KEA-Params-Id", "pkcs1.KEA_Params_Id",
345         FT_BYTES, BASE_NONE, NULL, 0,
346         NULL, HFILL }},
347     { &hf_pkcs1_ECParameters_PDU,
348       { "ECParameters", "pkcs1.ECParameters",
349         FT_UINT32, BASE_DEC, VALS(pkcs1_ECParameters_vals), 0,
350         NULL, HFILL }},
351     { &hf_pkcs1_modulus,
352       { "modulus", "pkcs1.modulus",
353         FT_INT32, BASE_DEC, NULL, 0,
354         "INTEGER", HFILL }},
355     { &hf_pkcs1_publicExponent,
356       { "publicExponent", "pkcs1.publicExponent",
357         FT_INT32, BASE_DEC, NULL, 0,
358         "INTEGER", HFILL }},
359     { &hf_pkcs1_version,
360       { "version", "pkcs1.version",
361         FT_INT32, BASE_DEC, NULL, 0,
362         NULL, HFILL }},
363     { &hf_pkcs1_privateExponent,
364       { "privateExponent", "pkcs1.privateExponent",
365         FT_INT32, BASE_DEC, NULL, 0,
366         "INTEGER", HFILL }},
367     { &hf_pkcs1_prime1,
368       { "prime1", "pkcs1.prime1",
369         FT_INT32, BASE_DEC, NULL, 0,
370         "INTEGER", HFILL }},
371     { &hf_pkcs1_prime2,
372       { "prime2", "pkcs1.prime2",
373         FT_INT32, BASE_DEC, NULL, 0,
374         "INTEGER", HFILL }},
375     { &hf_pkcs1_exponent1,
376       { "exponent1", "pkcs1.exponent1",
377         FT_INT32, BASE_DEC, NULL, 0,
378         "INTEGER", HFILL }},
379     { &hf_pkcs1_exponent2,
380       { "exponent2", "pkcs1.exponent2",
381         FT_INT32, BASE_DEC, NULL, 0,
382         "INTEGER", HFILL }},
383     { &hf_pkcs1_coefficient,
384       { "coefficient", "pkcs1.coefficient",
385         FT_INT32, BASE_DEC, NULL, 0,
386         "INTEGER", HFILL }},
387     { &hf_pkcs1_digestAlgorithm,
388       { "digestAlgorithm", "pkcs1.digestAlgorithm",
389         FT_NONE, BASE_NONE, NULL, 0,
390         "DigestAlgorithmIdentifier", HFILL }},
391     { &hf_pkcs1_digest,
392       { "digest", "pkcs1.digest",
393         FT_BYTES, BASE_NONE, NULL, 0,
394         NULL, HFILL }},
395     { &hf_pkcs1_p,
396       { "p", "pkcs1.p",
397         FT_INT32, BASE_DEC, NULL, 0,
398         "INTEGER", HFILL }},
399     { &hf_pkcs1_q,
400       { "q", "pkcs1.q",
401         FT_INT32, BASE_DEC, NULL, 0,
402         "INTEGER", HFILL }},
403     { &hf_pkcs1_g,
404       { "g", "pkcs1.g",
405         FT_INT32, BASE_DEC, NULL, 0,
406         "INTEGER", HFILL }},
407     { &hf_pkcs1_j,
408       { "j", "pkcs1.j",
409         FT_INT32, BASE_DEC, NULL, 0,
410         "INTEGER", HFILL }},
411     { &hf_pkcs1_validationParams,
412       { "validationParams", "pkcs1.validationParams",
413         FT_NONE, BASE_NONE, NULL, 0,
414         NULL, HFILL }},
415     { &hf_pkcs1_seed,
416       { "seed", "pkcs1.seed",
417         FT_BYTES, BASE_NONE, NULL, 0,
418         "BIT_STRING", HFILL }},
419     { &hf_pkcs1_pgenCounter,
420       { "pgenCounter", "pkcs1.pgenCounter",
421         FT_INT32, BASE_DEC, NULL, 0,
422         "INTEGER", HFILL }},
423     { &hf_pkcs1_namedCurve,
424       { "namedCurve", "pkcs1.namedCurve",
425         FT_OID, BASE_NONE, NULL, 0,
426         "OBJECT_IDENTIFIER", HFILL }},
427     { &hf_pkcs1_r,
428       { "r", "pkcs1.r",
429         FT_INT32, BASE_DEC, NULL, 0,
430         "INTEGER", HFILL }},
431     { &hf_pkcs1_s,
432       { "s", "pkcs1.s",
433         FT_INT32, BASE_DEC, NULL, 0,
434         "INTEGER", HFILL }},
435
436 /*--- End of included file: packet-pkcs1-hfarr.c ---*/
437 #line 58 "../../asn1/pkcs1/packet-pkcs1-template.c"
438   };
439
440   /* List of subtrees */
441   static gint *ett[] = {
442
443 /*--- Included file: packet-pkcs1-ettarr.c ---*/
444 #line 1 "../../asn1/pkcs1/packet-pkcs1-ettarr.c"
445     &ett_pkcs1_RSAPublicKey,
446     &ett_pkcs1_RSAPrivateKey,
447     &ett_pkcs1_DigestInfo,
448     &ett_pkcs1_DSA_Params,
449     &ett_pkcs1_DomainParameters,
450     &ett_pkcs1_ValidationParams,
451     &ett_pkcs1_ECParameters,
452     &ett_pkcs1_DSA_Sig_Value,
453     &ett_pkcs1_ECDSA_Sig_Value,
454
455 /*--- End of included file: packet-pkcs1-ettarr.c ---*/
456 #line 63 "../../asn1/pkcs1/packet-pkcs1-template.c"
457   };
458
459   /* Register protocol */
460   proto_pkcs1 = proto_register_protocol(PNAME, PSNAME, PFNAME);
461
462   /* Register fields and subtrees */
463   proto_register_field_array(proto_pkcs1, hf, array_length(hf));
464   proto_register_subtree_array(ett, array_length(ett));
465
466 }
467
468
469 /*--- proto_reg_handoff_pkcs1 -------------------------------------------*/
470 void proto_reg_handoff_pkcs1(void) {
471
472 /*--- Included file: packet-pkcs1-dis-tab.c ---*/
473 #line 1 "../../asn1/pkcs1/packet-pkcs1-dis-tab.c"
474   register_ber_oid_dissector("1.2.840.10040.4.1", dissect_DSA_Params_PDU, proto_pkcs1, "id-dsa");
475   register_ber_oid_dissector("1.2.840.10046.2.1", dissect_DomainParameters_PDU, proto_pkcs1, "dhpublicnumber");
476   register_ber_oid_dissector("2.16.840.1.101.2.1.1.22", dissect_KEA_Params_Id_PDU, proto_pkcs1, "id-keyExchangeAlgorithm");
477   register_ber_oid_dissector("1.2.840.10045.2.1", dissect_ECParameters_PDU, proto_pkcs1, "id-ecPublicKey");
478   register_ber_oid_dissector("1.3.132.1.12", dissect_ECParameters_PDU, proto_pkcs1, "id-ecDH");
479   register_ber_oid_dissector("1.2.840.10045.2.13", dissect_ECParameters_PDU, proto_pkcs1, "id-ecMQV");
480
481
482 /*--- End of included file: packet-pkcs1-dis-tab.c ---*/
483 #line 78 "../../asn1/pkcs1/packet-pkcs1-template.c"
484
485         register_ber_oid_dissector("1.2.840.113549.2.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2");
486         register_ber_oid_dissector("1.2.840.113549.2.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4");
487         register_ber_oid_dissector("1.2.840.113549.2.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5");
488
489         register_ber_oid_dissector("1.2.840.113549.1.1.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaEncryption");
490         register_ber_oid_dissector("1.2.840.113549.1.1.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2WithRSAEncryption");
491         register_ber_oid_dissector("1.2.840.113549.1.1.3", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4WithRSAEncryption");
492         register_ber_oid_dissector("1.2.840.113549.1.1.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5WithRSAEncryption");
493
494
495         /* these two are not from RFC2313  but pulled in from
496            http://www.alvestrand.no/objectid/1.2.840.113549.1.1.html
497         */
498         register_ber_oid_dissector("1.2.840.113549.1.1.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "shaWithRSAEncryption");
499         register_ber_oid_dissector("1.2.840.113549.1.1.6", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaOAEPEncryptionSET");
500
501         oid_add_from_string("secp192r1","1.2.840.10045.3.1.1");
502         oid_add_from_string("sect163k1","1.3.132.0.1");
503         oid_add_from_string("sect163r2","1.3.132.0.15");
504         oid_add_from_string("secp224r1","1.3.132.0.33");
505         oid_add_from_string("sect233k1","1.3.132.0.26");
506         oid_add_from_string("sect233r1","1.3.132.0.27");
507         oid_add_from_string("secp256r1","1.2.840.10045.3.1.7");
508         oid_add_from_string("sect283k1","1.3.132.0.16");
509         oid_add_from_string("sect283r1","1.3.132.0.17");
510         oid_add_from_string("secp384r1","1.3.132.0.34");
511         oid_add_from_string("sect409k1","1.3.132.0.36");
512         oid_add_from_string("sect409r1","1.3.132.0.37");
513         oid_add_from_string("sect521r1","1.3.132.0.35")
514 ;       oid_add_from_string("sect571k1","1.3.132.0.38");
515         oid_add_from_string("sect571r1","1.3.132.0.39");
516
517 }
518