diff options
| author | Mark Brown <broonie@kernel.org> | 2021-01-13 17:56:59 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2021-01-13 17:56:59 +0000 |
| commit | 2d446c98cde3ffccfd14849b7dda4194ab62dd20 (patch) | |
| tree | 9b7f048dcddec04d94527132834fc056745fdb6d /crypto/ecdh.c | |
| parent | 44a4cfad8d78efcda9ec0dd97ceea38d8b602f24 (diff) | |
| parent | 7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff) | |
Merge v5.11-rc3
Diffstat (limited to 'crypto/ecdh.c')
| -rw-r--r-- | crypto/ecdh.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ecdh.c b/crypto/ecdh.c index d56b8603dec9..96f80c8f8e30 100644 --- a/crypto/ecdh.c +++ b/crypto/ecdh.c @@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, struct ecdh params; unsigned int ndigits; - if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0) + if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0 || + params.key_size > sizeof(ctx->private_key)) return -EINVAL; ndigits = ecdh_supported_curve(params.curve_id); |
