提交 41b920ef 编写于 作者: D Dr. Stephen Henson

Return correct enveloped data type in ASN1 methods.

For RSA and DSA keys return an appropriate RecipientInfo type. By setting
CMS_RECIPINFO_NONE for DSA keys an appropriate error is returned if
an attempt is made to use DSA with enveloped data.
上级 88e20b85
...@@ -631,6 +631,10 @@ static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) ...@@ -631,6 +631,10 @@ static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0);
} }
return 1; return 1;
case ASN1_PKEY_CTRL_CMS_RI_TYPE:
*(int *)arg2 = CMS_RECIPINFO_NONE;
return 1;
#endif #endif
case ASN1_PKEY_CTRL_DEFAULT_MD_NID: case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
......
...@@ -448,6 +448,10 @@ static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) ...@@ -448,6 +448,10 @@ static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
else if (arg1 == 1) else if (arg1 == 1)
return rsa_cms_decrypt(arg2); return rsa_cms_decrypt(arg2);
break; break;
case ASN1_PKEY_CTRL_CMS_RI_TYPE:
*(int *)arg2 = CMS_RECIPINFO_TRANS;
return 1;
#endif #endif
case ASN1_PKEY_CTRL_DEFAULT_MD_NID: case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册