summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2010-09-21 22:28:55 -0700
committerBrian Carlstrom <bdc@google.com>2010-09-21 22:28:55 -0700
commit02c8f348933077d53ccd82e4923adab2fbb23a5d (patch)
tree8490cf5787e00362916b2c5377c18abd68f8bc41
parentb9a95895304a2d1ffad46094cd525e3e38408083 (diff)
downloadbouncycastle-02c8f348933077d53ccd82e4923adab2fbb23a5d.tar.gz
Fix OpenSSLDigest.reset broken by uninitialized openssl field
Bug: 3024499 Change-Id: I70c54fa912251e17c5f48b258b006006e9085e7a
-rw-r--r--src/main/java/org/bouncycastle/crypto/digests/OpenSSLDigest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/bouncycastle/crypto/digests/OpenSSLDigest.java b/src/main/java/org/bouncycastle/crypto/digests/OpenSSLDigest.java
index 14e69122..ba765778 100644
--- a/src/main/java/org/bouncycastle/crypto/digests/OpenSSLDigest.java
+++ b/src/main/java/org/bouncycastle/crypto/digests/OpenSSLDigest.java
@@ -27,12 +27,12 @@ public class OpenSSLDigest implements ExtendedDigest {
/**
* Holds the standard name of the hashing algorithm, e.g. "SHA-1";
*/
- private String algorithm;
+ private final String algorithm;
/**
* Holds the OpenSSL name of the hashing algorithm, e.g. "sha1";
*/
- private String openssl;
+ private final String openssl;
/**
* Holds a pointer to the native message digest context.
@@ -42,7 +42,7 @@ public class OpenSSLDigest implements ExtendedDigest {
/**
* Holds a dummy buffer for writing single bytes to the digest.
*/
- private byte[] singleByte = new byte[1];
+ private final byte[] singleByte = new byte[1];
/**
* Creates a new OpenSSLMessageDigest instance for the given algorithm
@@ -53,6 +53,7 @@ public class OpenSSLDigest implements ExtendedDigest {
*/
private OpenSSLDigest(String algorithm, String openssl) {
this.algorithm = algorithm;
+ this.openssl = openssl;
ctx = NativeCrypto.EVP_MD_CTX_create();
try {
NativeCrypto.EVP_DigestInit(ctx, openssl);