-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gost CMS Encryption #17
Comments
Did I understand correctly that CMS Encryption is not working now? var contentInfo = new ContentInfo(msg);
var envelopedCms = new EnvelopedCms(contentInfo);
// myCert, recipientCert - X509Certificate2 objects of Gost certificates
var certsColl = new X509Certificate2Collection(new [] { myCert, recipientCert });
var cmsRecipients = new CmsRecipientCollection(SubjectIdentifierType.IssuerAndSerialNumber, certsColl);
// throws an exception
envelopedCms.Encrypt(cmsRecipients); Exception stack trace:
OS: Windows 10 Home 1909, Ubuntu 18.04.4 LTS, .net core 3.1 (SDK 3.1.202, runtime 3.1.4), Crypto-Pro CSP 5.0.11732 KC1 (5.0.11455 on Windows), instruction Linux.md, Windows.md was used, corefx ver.3.1.1.241 (4.7.0-dev.20175.1). |
ms где то поменяло логику, переписав её в методе EncodeKeyTransRecipientInfo private static unsafe CMSG_ENVELOPED_ENCODE_INFO* CreateCmsEnvelopedEncodeInfo(CmsRecipientCollection recipients, AlgorithmIdentifier contentEncryptionAlgorithm, X509Certificate2Collection originatorCerts, CryptographicAttributeObjectCollection unprotectedAttributes, HeapBlockRetainer hb) не вижу кода, который бы соотв. коду из старого fw (при этом он раньше вызывался) if (encryptParam.useCms)
{
// похожий код есть в текущей реализации
}
// этого кода просто нет
else
{
EnvelopedCms.SetPkcs7RecipientParams(recipients, ref encryptParam, out certContexts);
envelopedEncodeInfo.rgpRecipients = encryptParam.rgpRecipients.DangerousGetHandle();
} Не знаю пока, в этом ли причина, но падает в CryptMsgOpenToEncode, флаги все те же, что и в FW. |
Основная работа по поддержке CMS шифрования тут |
No description provided.
The text was updated successfully, but these errors were encountered: