mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
crypto: hisilicon/hpre - return -EOVERFLOW for small ECDH output buffer
hpre_ecdh_msg_request_set() returns -EINVAL when the output buffer
is too small, after setting req->dst_len to the required size.
-EINVAL is misleading because the caller can retry with a larger
buffer. Return -EOVERFLOW as other kpp implementations do.
Fixes: 05e7b906aa ("crypto: hisilicon/hpre - add 'ECDH' algorithm")
Cc: stable@vger.kernel.org
Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
5b87f619cc
commit
232804a5ed
|
|
@ -1450,7 +1450,7 @@ static int hpre_ecdh_msg_request_set(struct hpre_ctx *ctx,
|
|||
|
||||
if (req->dst_len < ctx->key_sz << 1) {
|
||||
req->dst_len = ctx->key_sz << 1;
|
||||
return -EINVAL;
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
|
||||
tmp = kpp_request_ctx(req);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user