]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_smime/lib/cmsasn1.c
Security-58286.260.20.tar.gz
[apple/security.git] / OSX / libsecurity_smime / lib / cmsasn1.c
index 6e8a3ebaf1a5b0d0a8af283cc119702c085ee656..bbb53f57ceefb1ca4109c9e706e2191004649189 100644 (file)
@@ -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;