comparison nss/lib/util/templates.c @ 0:1e5118fa0cb1

This is NSS with a Cmake Buildsyste To compile a static NSS library for Windows we've used the Chromium-NSS fork and added a Cmake buildsystem to compile it statically for Windows. See README.chromium for chromium changes and README.trustbridge for our modifications.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 28 Jul 2014 10:47:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e5118fa0cb1
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 /*
6 * Templates that are compiled and exported from both libnss3 and libnssutil3.
7 * They have to be, because they were previously exported from libnss3, and
8 * there is no way to create data forwarder symbols on Unix.
9 *
10 * Please do not add to this file. New shared templates should be exported
11 * from libnssutil3 only.
12 *
13 */
14
15 #include "utilrename.h"
16 #include "secasn1.h"
17 #include "secder.h"
18 #include "secoid.h"
19 #include "secdig.h"
20
21 const SEC_ASN1Template SECOID_AlgorithmIDTemplate[] = {
22 { SEC_ASN1_SEQUENCE,
23 0, NULL, sizeof(SECAlgorithmID) },
24 { SEC_ASN1_OBJECT_ID,
25 offsetof(SECAlgorithmID,algorithm), },
26 { SEC_ASN1_OPTIONAL | SEC_ASN1_ANY,
27 offsetof(SECAlgorithmID,parameters), },
28 { 0, }
29 };
30
31 SEC_ASN1_CHOOSER_IMPLEMENT(SECOID_AlgorithmIDTemplate)
32
33 const SEC_ASN1Template SEC_AnyTemplate[] = {
34 { SEC_ASN1_ANY | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
35 };
36
37 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_AnyTemplate)
38
39 const SEC_ASN1Template SEC_BMPStringTemplate[] = {
40 { SEC_ASN1_BMP_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
41 };
42
43 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BMPStringTemplate)
44
45 const SEC_ASN1Template SEC_BitStringTemplate[] = {
46 { SEC_ASN1_BIT_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
47 };
48
49 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BitStringTemplate)
50
51 const SEC_ASN1Template SEC_BooleanTemplate[] = {
52 { SEC_ASN1_BOOLEAN, 0, NULL, sizeof(SECItem) }
53 };
54
55 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BooleanTemplate)
56
57 const SEC_ASN1Template SEC_GeneralizedTimeTemplate[] = {
58 { SEC_ASN1_GENERALIZED_TIME | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem)}
59 };
60
61 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_GeneralizedTimeTemplate)
62
63 const SEC_ASN1Template SEC_IA5StringTemplate[] = {
64 { SEC_ASN1_IA5_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
65 };
66
67 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_IA5StringTemplate)
68
69 const SEC_ASN1Template SEC_IntegerTemplate[] = {
70 { SEC_ASN1_INTEGER, 0, NULL, sizeof(SECItem) }
71 };
72
73 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_IntegerTemplate)
74
75 const SEC_ASN1Template SEC_NullTemplate[] = {
76 { SEC_ASN1_NULL, 0, NULL, sizeof(SECItem) }
77 };
78
79 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_NullTemplate)
80
81 const SEC_ASN1Template SEC_ObjectIDTemplate[] = {
82 { SEC_ASN1_OBJECT_ID, 0, NULL, sizeof(SECItem) }
83 };
84
85 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_ObjectIDTemplate)
86
87 const SEC_ASN1Template SEC_OctetStringTemplate[] = {
88 { SEC_ASN1_OCTET_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
89 };
90
91 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_OctetStringTemplate)
92
93 const SEC_ASN1Template SEC_PointerToAnyTemplate[] = {
94 { SEC_ASN1_POINTER, 0, SEC_AnyTemplate }
95 };
96
97 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_PointerToAnyTemplate)
98
99 const SEC_ASN1Template SEC_PointerToOctetStringTemplate[] = {
100 { SEC_ASN1_POINTER | SEC_ASN1_MAY_STREAM, 0, SEC_OctetStringTemplate }
101 };
102
103 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_PointerToOctetStringTemplate)
104
105 const SEC_ASN1Template SEC_SetOfAnyTemplate[] = {
106 { SEC_ASN1_SET_OF, 0, SEC_AnyTemplate }
107 };
108
109 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_SetOfAnyTemplate)
110
111 const SEC_ASN1Template SEC_UTCTimeTemplate[] = {
112 { SEC_ASN1_UTC_TIME | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) }
113 };
114
115 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_UTCTimeTemplate)
116
117 const SEC_ASN1Template SEC_UTF8StringTemplate[] = {
118 { SEC_ASN1_UTF8_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem)}
119 };
120
121 SEC_ASN1_CHOOSER_IMPLEMENT(SEC_UTF8StringTemplate)
122
123 /* XXX See comment below about SGN_DecodeDigestInfo -- keep this static! */
124 /* XXX Changed from static -- need to change name? */
125 const SEC_ASN1Template sgn_DigestInfoTemplate[] = {
126 { SEC_ASN1_SEQUENCE,
127 0, NULL, sizeof(SGNDigestInfo) },
128 { SEC_ASN1_INLINE,
129 offsetof(SGNDigestInfo,digestAlgorithm),
130 SECOID_AlgorithmIDTemplate },
131 { SEC_ASN1_OCTET_STRING,
132 offsetof(SGNDigestInfo,digest) },
133 { 0 }
134 };
135
136 SEC_ASN1_CHOOSER_IMPLEMENT(sgn_DigestInfoTemplate)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)