Set Enveloped data version to 2 if ktri version not zero.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 6 May 2014 13:02:17 +0000 (14:02 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 6 May 2014 13:04:37 +0000 (14:04 +0100)
(cherry picked from commit 9c5d953a07f472452ae2cb578e39eddea2de2b9c)

crypto/cms/cms_env.c

index b398f6990b5980ca881f62b221aa17fb55505d78..ffb24a7c40df4d90a1c84f05874ca3609b551710 100644 (file)
@@ -186,6 +186,8 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
        if (flags & CMS_USE_KEYID)
                {
                ktri->version = 2;
+               if (env->version < 2)
+                       env->version = 2;
                type = CMS_RECIPINFO_KEYIDENTIFIER;
                }
        else