Restore the PCTs to ECC and DH.

This commit is contained in:
John Safranek
2021-04-12 09:37:24 -07:00
committed by Daniel Pouzzner
parent 1065d2accf
commit 5d7c6dda72
2 changed files with 7 additions and 0 deletions

View File

@ -1357,6 +1357,8 @@ static int wc_DhGenerateKeyPair_Sync(DhKey* key, WC_RNG* rng,
ret = GeneratePublicDh(key, priv, *privSz, pub, pubSz);
if (ret == 0)
ret = _ffc_validate_public_key(key, pub, *pubSz, NULL, 0, 0);
if (ret == 0)
ret = _ffc_pairwise_consistency_test(key, pub, *pubSz, priv, *privSz);
return ret;
}

View File

@ -4829,6 +4829,11 @@ int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
if (err == MP_OKAY) {
err = _ecc_validate_public_key(key, 0, 0);
}
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(WOLFSSL_VALIDATE_ECC_IMPORT)
if (err == MP_OKAY) {
err = _ecc_pairwise_consistency_test(key);
}
#endif
return err;
}