Skip to content

Commit

Permalink
crypto: qat - comply with crypto_kpp_maxsize()
Browse files Browse the repository at this point in the history
crypto_kpp_maxsize() asks for the output buffer size without
caring for errors. It allways assume that will be called after
a valid setkey. Comply with it and return what he wants.

Signed-off-by: Tudor Ambarus <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ambarus authored and herbertx committed Jun 10, 2017
1 parent d0efb48 commit 85ac98c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/crypto/qat/qat_common/qat_asym_algs.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,11 @@ static int qat_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
return 0;
}

static int qat_dh_max_size(struct crypto_kpp *tfm)
static unsigned int qat_dh_max_size(struct crypto_kpp *tfm)
{
struct qat_dh_ctx *ctx = kpp_tfm_ctx(tfm);

return ctx->p ? ctx->p_size : -EINVAL;
return ctx->p_size;
}

static int qat_dh_init_tfm(struct crypto_kpp *tfm)
Expand Down

0 comments on commit 85ac98c

Please sign in to comment.