From 60b001da03e19c8e22ce8d7f448e9c752e3ebdfa Mon Sep 17 00:00:00 2001 From: David Hook Date: Sat, 19 Jan 2019 15:38:11 +1100 Subject: fixed KeyTransRecipientInfoGenerator to invoke overridable method for wrapping symmetric session key --- crypto/src/cms/KeyTransRecipientInfoGenerator.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crypto/src/cms') diff --git a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs index b18d18153..23b06d3b3 100644 --- a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs +++ b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs @@ -73,14 +73,11 @@ namespace Org.BouncyCastle.Cms public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random) { - byte[] keyBytes = contentEncryptionKey.GetKey(); AlgorithmIdentifier keyEncryptionAlgorithm = this.AlgorithmDetails; this.random = random; - IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id); - keyWrapper.Init(true, new ParametersWithRandom(recipientPublicKey, random)); - byte[] encryptedKeyBytes = keyWrapper.Wrap(keyBytes, 0, keyBytes.Length); + byte[] encryptedKeyBytes = GenerateWrappedKey(contentEncryptionKey); RecipientIdentifier recipId; if (recipientTbsCert != null) -- cgit 1.5.1