diff options
author | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-03-04 20:26:33 +0000 |
---|---|---|
committer | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-03-04 20:26:33 +0000 |
commit | d51b217cf87d055293c6264175436a28945cdc80 (patch) | |
tree | 4a8815cdcbab7dfd061ddacbf700312e1743f1a6 /crypto | |
parent | 13155f4c5e198e91b853f830447e7786241a4540 (diff) | |
parent | 7f324ea75baa059ea126cddd4141198895880a69 (diff) |
Merge tag 'v5.4.102' into 5.4-2.3.x-imx
This is the 5.4.102 stable release
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ecdh_helper.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/ecdh_helper.c b/crypto/ecdh_helper.c index 66fcb2ea8154..fca63b559f65 100644 --- a/crypto/ecdh_helper.c +++ b/crypto/ecdh_helper.c @@ -67,6 +67,9 @@ int crypto_ecdh_decode_key(const char *buf, unsigned int len, if (secret.type != CRYPTO_KPP_SECRET_TYPE_ECDH) return -EINVAL; + if (unlikely(len < secret.len)) + return -EINVAL; + ptr = ecdh_unpack_data(¶ms->curve_id, ptr, sizeof(params->curve_id)); ptr = ecdh_unpack_data(¶ms->key_size, ptr, sizeof(params->key_size)); if (secret.len != crypto_ecdh_key_len(params)) |