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