JNI: fix for DH state check when loading private/public keys

pull/2/merge
Chris Conlon 2017-04-27 16:39:36 -06:00
parent 1132acbae9
commit 3a306131a5
1 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public class Dh extends NativeStruct {
}
public void setPrivateKey(byte[] priv) {
if (state == WolfCryptState.READY) {
if (state != WolfCryptState.UNINITIALIZED) {
if (privateKey != null)
for (int i = 0; i < privateKey.length; i++)
privateKey[i] = 0;
@ -97,7 +97,7 @@ public class Dh extends NativeStruct {
}
public void setPublicKey(byte[] pub) {
if (state == WolfCryptState.READY) {
if (state != WolfCryptState.UNINITIALIZED) {
if (publicKey != null)
for (int i = 0; i < publicKey.length; i++)
publicKey[i] = 0;