X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..07691282a056c4efea71e1e505527601e8cc166b:/OSX/libsecurity_smime/lib/cmsasn1.c diff --git a/OSX/libsecurity_smime/lib/cmsasn1.c b/OSX/libsecurity_smime/lib/cmsasn1.c index 6e8a3eba..bbb53f57 100644 --- a/OSX/libsecurity_smime/lib/cmsasn1.c +++ b/OSX/libsecurity_smime/lib/cmsasn1.c @@ -61,7 +61,7 @@ SEC_ASN1_MKSUB(kSecAsn1SetOfAnyTemplate) /* forward declaration */ static const SecAsn1Template * -nss_cms_choose_content_template(void *src_or_dest, Boolean encoding, const char *buf, void *dest); +nss_cms_choose_content_template(void *src_or_dest, Boolean encoding, const char *buf, size_t len, void *dest); static const SecAsn1TemplateChooserPtr nss_cms_chooser = nss_cms_choose_content_template; @@ -253,11 +253,10 @@ static const SecAsn1Template SecCmsRecipientIdentifierTemplate[] = { { SEC_ASN1_CHOICE, offsetof(SecCmsRecipientIdentifier,identifierType), NULL, sizeof(SecCmsRecipientIdentifier) }, - { SEC_ASN1_EXPLICIT | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | - SEC_ASN1_XTRN | 0, - offsetof(SecCmsRecipientIdentifier,id.subjectKeyID), - SEC_ASN1_SUB(kSecAsn1PointerToOctetStringTemplate) , - SecCmsRecipientIDSubjectKeyID }, + { SEC_ASN1_POINTER | SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_XTRN | 0, + offsetof(SecCmsRecipientIdentifier,id.subjectKeyID), + SEC_ASN1_SUB(kSecAsn1OctetStringTemplate) , + SecCmsRecipientIDSubjectKeyID }, { SEC_ASN1_POINTER | SEC_ASN1_XTRN, offsetof(SecCmsRecipientIdentifier,id.issuerAndSN), SEC_ASN1_SUB(SecCmsIssuerAndSNTemplate), @@ -323,11 +322,13 @@ static const SecAsn1Template SecCmsOriginatorIdentifierOrKeyTemplate[] = { const SecAsn1Template SecCmsRecipientKeyIdentifierTemplate[] = { { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(SecCmsRecipientKeyIdentifier) }, - { SEC_ASN1_OCTET_STRING, - offsetof(SecCmsRecipientKeyIdentifier,subjectKeyIdentifier) }, - { SEC_ASN1_OPTIONAL | SEC_ASN1_OCTET_STRING, - offsetof(SecCmsRecipientKeyIdentifier,date) }, - { SEC_ASN1_OPTIONAL | SEC_ASN1_OCTET_STRING, + { SEC_ASN1_INLINE | SEC_ASN1_OCTET_STRING, + offsetof(SecCmsRecipientKeyIdentifier,subjectKeyIdentifier), + SEC_ASN1_SUB(kSecAsn1OctetStringTemplate) }, + { SEC_ASN1_INLINE | SEC_ASN1_OPTIONAL | SEC_ASN1_GENERALIZED_TIME, + offsetof(SecCmsRecipientKeyIdentifier,date), + SEC_ASN1_SUB(kSecAsn1GeneralizedTimeTemplate) }, + { SEC_ASN1_INLINE | SEC_ASN1_OPTIONAL | SEC_ASN1_ANY, offsetof(SecCmsRecipientKeyIdentifier,other) }, { 0 } }; @@ -564,7 +565,7 @@ nss_cms_get_kea_template(SecCmsKEATemplateSelector whichTemplate) * */ static const SecAsn1Template * -nss_cms_choose_content_template(void *src_or_dest, Boolean encoding, const char *buf, void *dest) +nss_cms_choose_content_template(void *src_or_dest, Boolean encoding, const char *buf, size_t len, void *dest) { const SecAsn1Template *theTemplate; SecCmsContentInfoRef cinfo;