Add GOST12 cms/smime capabilities
authorMatt Caswell <matt@openssl.org>
Tue, 29 Sep 2015 15:43:27 +0000 (16:43 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 30 Sep 2015 10:39:24 +0000 (11:39 +0100)
Add additional NID references in the CMS/SMIME capabilities code to cater
for GOST12.

Patch supplied by Dmitry Belyavsky <beldmit@gmail.com>

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/cms/cms_sd.c
crypto/pkcs7/pk7_smime.c

index 8fc407e6b92c37f47e51dea70e6c961d5e5d8641..50064e286c79523496395acd4af24efa26216f4d 100644 (file)
@@ -933,6 +933,8 @@ static int cms_add_digest_smcap(STACK_OF(X509_ALGOR) **sk, int nid, int arg)
 int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap)
 {
     if (!cms_add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
+        || !cms_add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
         || !cms_add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
         || !cms_add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
         || !cms_add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
index 16df4eacd68411ed1e450d0891a9d86c47bb9cbb..ea5eb1b704ee4b211f7ba64ef662d2f0401fc0c6 100644 (file)
@@ -189,6 +189,8 @@ PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert,
                 goto err;
             }
             if (!add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
+                || !add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
                 || !add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
                 || !add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
                 || !add_cipher_smcap(smcap, NID_aes_192_cbc, -1)