fix for unused variable in dh.c from Jenkins test

This commit is contained in:
Jacob Barthelmeh
2021-03-18 20:34:38 +07:00
parent a64bb8aef7
commit 360c961b48

View File

@@ -2126,7 +2126,6 @@ int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz,
const byte* pub, word32 pubSz)
{
byte havePriv, havePub;
mp_int *keyPriv = NULL, *keyPub = NULL;
if (key == NULL) {
return BAD_FUNC_ARG;
@@ -2154,7 +2153,6 @@ int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz,
mp_clear(&key->priv);
havePriv = 0;
} else {
keyPriv = &key->priv;
WOLFSSL_MSG("DH Private Key Set");
}
}
@@ -2172,8 +2170,11 @@ int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz,
if (mp_read_unsigned_bin(&key->pub, pub, pubSz) != MP_OKAY) {
mp_clear(&key->pub);
havePub = 0;
if (havePriv) {
mp_clear(&key->priv);
havePriv = 0; /* set to 0 to error out with failed read pub */
}
} else {
keyPub = &key->pub;
WOLFSSL_MSG("DH Public Key Set");
}
}