michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Templates that are compiled and exported from both libnss3 and libnssutil3. michael@0: * They have to be, because they were previously exported from libnss3, and michael@0: * there is no way to create data forwarder symbols on Unix. michael@0: * michael@0: * Please do not add to this file. New shared templates should be exported michael@0: * from libnssutil3 only. michael@0: * michael@0: */ michael@0: michael@0: #include "utilrename.h" michael@0: #include "secasn1.h" michael@0: #include "secder.h" michael@0: #include "secoid.h" michael@0: #include "secdig.h" michael@0: michael@0: const SEC_ASN1Template SECOID_AlgorithmIDTemplate[] = { michael@0: { SEC_ASN1_SEQUENCE, michael@0: 0, NULL, sizeof(SECAlgorithmID) }, michael@0: { SEC_ASN1_OBJECT_ID, michael@0: offsetof(SECAlgorithmID,algorithm), }, michael@0: { SEC_ASN1_OPTIONAL | SEC_ASN1_ANY, michael@0: offsetof(SECAlgorithmID,parameters), }, michael@0: { 0, } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SECOID_AlgorithmIDTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_AnyTemplate[] = { michael@0: { SEC_ASN1_ANY | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_AnyTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_BMPStringTemplate[] = { michael@0: { SEC_ASN1_BMP_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BMPStringTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_BitStringTemplate[] = { michael@0: { SEC_ASN1_BIT_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BitStringTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_BooleanTemplate[] = { michael@0: { SEC_ASN1_BOOLEAN, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_BooleanTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_GeneralizedTimeTemplate[] = { michael@0: { SEC_ASN1_GENERALIZED_TIME | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem)} michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_GeneralizedTimeTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_IA5StringTemplate[] = { michael@0: { SEC_ASN1_IA5_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_IA5StringTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_IntegerTemplate[] = { michael@0: { SEC_ASN1_INTEGER, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_IntegerTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_NullTemplate[] = { michael@0: { SEC_ASN1_NULL, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_NullTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_ObjectIDTemplate[] = { michael@0: { SEC_ASN1_OBJECT_ID, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_ObjectIDTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_OctetStringTemplate[] = { michael@0: { SEC_ASN1_OCTET_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_OctetStringTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_PointerToAnyTemplate[] = { michael@0: { SEC_ASN1_POINTER, 0, SEC_AnyTemplate } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_PointerToAnyTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_PointerToOctetStringTemplate[] = { michael@0: { SEC_ASN1_POINTER | SEC_ASN1_MAY_STREAM, 0, SEC_OctetStringTemplate } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_PointerToOctetStringTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_SetOfAnyTemplate[] = { michael@0: { SEC_ASN1_SET_OF, 0, SEC_AnyTemplate } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_SetOfAnyTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_UTCTimeTemplate[] = { michael@0: { SEC_ASN1_UTC_TIME | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem) } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_UTCTimeTemplate) michael@0: michael@0: const SEC_ASN1Template SEC_UTF8StringTemplate[] = { michael@0: { SEC_ASN1_UTF8_STRING | SEC_ASN1_MAY_STREAM, 0, NULL, sizeof(SECItem)} michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(SEC_UTF8StringTemplate) michael@0: michael@0: /* XXX See comment below about SGN_DecodeDigestInfo -- keep this static! */ michael@0: /* XXX Changed from static -- need to change name? */ michael@0: const SEC_ASN1Template sgn_DigestInfoTemplate[] = { michael@0: { SEC_ASN1_SEQUENCE, michael@0: 0, NULL, sizeof(SGNDigestInfo) }, michael@0: { SEC_ASN1_INLINE, michael@0: offsetof(SGNDigestInfo,digestAlgorithm), michael@0: SECOID_AlgorithmIDTemplate }, michael@0: { SEC_ASN1_OCTET_STRING, michael@0: offsetof(SGNDigestInfo,digest) }, michael@0: { 0 } michael@0: }; michael@0: michael@0: SEC_ASN1_CHOOSER_IMPLEMENT(sgn_DigestInfoTemplate)