4 files changed, 4 insertions, 11 deletions
diff --git a/crypto/src/crmf/PKMacBuilder.cs b/crypto/src/crmf/PKMacBuilder.cs
index 6741177da..b74eb6d18 100644
--- a/crypto/src/crmf/PKMacBuilder.cs
+++ b/crypto/src/crmf/PKMacBuilder.cs
@@ -93,8 +93,7 @@ namespace Org.BouncyCastle.Crmf
private SecureRandom random;
private PbmParameter parameters;
private int iterationCount;
- private int saltLength;
- private byte[] salt;
+ private int saltLength = 20;
private int maxIterations;
/// <summary>
diff --git a/crypto/src/util/zlib/Deflate.cs b/crypto/src/util/zlib/Deflate.cs
index 99878c01d..90f8eb09c 100644
--- a/crypto/src/util/zlib/Deflate.cs
+++ b/crypto/src/util/zlib/Deflate.cs
@@ -174,7 +174,6 @@ namespace Org.BouncyCastle.Utilities.Zlib {
internal ZStream strm; // pointer back to this zlib stream
internal int status; // as the name implies
internal byte[] pending_buf; // output still pending
- internal int pending_buf_size; // size of pending_buf
internal int pending_out; // next pending byte to output to the stream
internal int pending; // nb of bytes in the pending buffer
internal int noheader; // suppress zlib header and adler32
@@ -802,13 +801,9 @@ namespace Org.BouncyCastle.Utilities.Zlib {
// Stored blocks are limited to 0xffff bytes, pending_buf is limited
// to pending_buf_size, and each stored block has a 5 byte header:
- int max_block_size = 0xffff;
+ int max_block_size = System.Math.Min(0xffff, pending_buf.Length - 5);
int max_start;
- if(max_block_size > pending_buf_size - 5) {
- max_block_size = pending_buf_size - 5;
- }
-
// Copy as much as possible from input to output:
while(true){
// Fill the window as much as possible:
@@ -1382,7 +1377,6 @@ namespace Org.BouncyCastle.Utilities.Zlib {
// We overlay pending_buf and d_buf+l_buf. This works since the average
// output size for (length,distance) codes is <= 24 bits.
pending_buf = new byte[lit_bufsize*4];
- pending_buf_size = lit_bufsize*4;
d_buf = lit_bufsize;
l_buf = (1+2)*lit_bufsize;
diff --git a/crypto/src/util/zlib/ZInputStream.cs b/crypto/src/util/zlib/ZInputStream.cs
index 434fe95c8..ea803fa4f 100644
--- a/crypto/src/util/zlib/ZInputStream.cs
+++ b/crypto/src/util/zlib/ZInputStream.cs
@@ -49,7 +49,7 @@ namespace Org.BouncyCastle.Utilities.Zlib
return z;
}
- private const int BufferSize = 512;
+ private const int BufferSize = 4096;
protected ZStream z;
protected int flushLevel = JZlib.Z_NO_FLUSH;
diff --git a/crypto/src/util/zlib/ZOutputStream.cs b/crypto/src/util/zlib/ZOutputStream.cs
index 1633b2d8f..a1482a07f 100644
--- a/crypto/src/util/zlib/ZOutputStream.cs
+++ b/crypto/src/util/zlib/ZOutputStream.cs
@@ -49,7 +49,7 @@ namespace Org.BouncyCastle.Utilities.Zlib
return z;
}
- private const int BufferSize = 512;
+ private const int BufferSize = 4096;
protected ZStream z;
protected int flushLevel = JZlib.Z_NO_FLUSH;
|