summary refs log tree commit diff
path: root/crypto/src/cms/CMSCompressedDataParser.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-10-24 15:49:27 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-10-24 15:49:27 +0700
commitbe97c80fdecadac37413a6a6a8de417e0332f6bf (patch)
treedef3bf31b937a4e59458574f6441036ffdf61616 /crypto/src/cms/CMSCompressedDataParser.cs
parentUse correct OID (diff)
downloadBouncyCastle.NET-ed25519-be97c80fdecadac37413a6a6a8de417e0332f6bf.tar.xz
Use platform compression where available
- Move Bzip2 code into Utilities
Diffstat (limited to 'crypto/src/cms/CMSCompressedDataParser.cs')
-rw-r--r--crypto/src/cms/CMSCompressedDataParser.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/src/cms/CMSCompressedDataParser.cs b/crypto/src/cms/CMSCompressedDataParser.cs
index b107ff608..38ff88968 100644
--- a/crypto/src/cms/CMSCompressedDataParser.cs
+++ b/crypto/src/cms/CMSCompressedDataParser.cs
@@ -3,7 +3,7 @@ using System.IO;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
-using Org.BouncyCastle.Utilities.Zlib;
+using Org.BouncyCastle.Utilities.IO.Compression;
 
 namespace Org.BouncyCastle.Cms
 {
@@ -44,8 +44,9 @@ namespace Org.BouncyCastle.Cms
                 ContentInfoParser content = comData.GetEncapContentInfo();
 
                 Asn1OctetStringParser bytes = (Asn1OctetStringParser)content.GetContent(Asn1Tags.OctetString);
+                Stream zIn = ZLib.DecompressInput(bytes.GetOctetStream());
 
-                return new CmsTypedStream(content.ContentType.ToString(), new ZInputStream(bytes.GetOctetStream()));
+                return new CmsTypedStream(content.ContentType.ToString(), zIn);
             }
             catch (IOException e)
             {