Conform to pre-existing pattern.

This commit is contained in:
Anthony Hu
2022-11-23 17:56:56 +00:00
parent 6190666108
commit f3546b50fd

View File

@ -5833,17 +5833,18 @@ int DhGenKeyPair(WOLFSSL* ssl, DhKey* dhKey,
#endif #endif
#if defined(HAVE_PK_CALLBACKS) #if defined(HAVE_PK_CALLBACKS)
ret = NOT_COMPILED_IN;
if (ssl && ssl->ctx && ssl->ctx->DhGenerateKeyPairCb) { if (ssl && ssl->ctx && ssl->ctx->DhGenerateKeyPairCb) {
ret = ssl->ctx->DhGenerateKeyPairCb(dhKey, ssl->rng, priv, privSz, ret = ssl->ctx->DhGenerateKeyPairCb(dhKey, ssl->rng, priv, privSz,
pub, pubSz); pub, pubSz);
if (ret != NOT_COMPILED_IN)
return ret;
} }
if (ret == NOT_COMPILED_IN)
#endif #endif
{
PRIVATE_KEY_UNLOCK(); PRIVATE_KEY_UNLOCK();
ret = wc_DhGenerateKeyPair(dhKey, ssl->rng, priv, privSz, pub, pubSz); ret = wc_DhGenerateKeyPair(dhKey, ssl->rng, priv, privSz, pub, pubSz);
PRIVATE_KEY_LOCK(); PRIVATE_KEY_LOCK();
}
/* Handle async pending response */ /* Handle async pending response */
#ifdef WOLFSSL_ASYNC_CRYPT #ifdef WOLFSSL_ASYNC_CRYPT