Commit 560efa7f authored by Herbert Xu's avatar Herbert Xu

crypto: dh - Check mpi_rshift errors

Now that mpi_rshift can return errors, check them.

Fixes: 35d2bf20 ("crypto: dh - calculate Q from P for the full public key verification")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 8e3a67f2
...@@ -145,9 +145,9 @@ static int dh_is_pubkey_valid(struct dh_ctx *ctx, MPI y) ...@@ -145,9 +145,9 @@ static int dh_is_pubkey_valid(struct dh_ctx *ctx, MPI y)
* ->p is odd, so no need to explicitly subtract one * ->p is odd, so no need to explicitly subtract one
* from it before shifting to the right. * from it before shifting to the right.
*/ */
mpi_rshift(q, ctx->p, 1); ret = mpi_rshift(q, ctx->p, 1) ?:
mpi_powm(val, y, q, ctx->p);
ret = mpi_powm(val, y, q, ctx->p);
mpi_free(q); mpi_free(q);
if (ret) { if (ret) {
mpi_free(val); mpi_free(val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment