Merge pull request #822 from JacobBarthelmeh/Testing

testing buffer size with const DH and remove redeclaration of WOLFSSL…
This commit is contained in:
toddouska
2017-03-31 08:53:49 -07:00
committed by GitHub
3 changed files with 15 additions and 4 deletions

View File

@@ -179,7 +179,14 @@ static int GeneratePublic(DhKey* key, const byte* priv, word32 privSz,
int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv, word32* privSz,
byte* pub, word32* pubSz)
{
int ret = GeneratePrivate(key, rng, priv, privSz);
int ret;
if (key == NULL || rng == NULL || priv == NULL || privSz == NULL ||
pub == NULL || pubSz == NULL) {
return BAD_FUNC_ARG;
}
ret = GeneratePrivate(key, rng, priv, privSz);
return (ret != 0) ? ret : GeneratePublic(key, priv, *privSz, pub, pubSz);
}