Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: dh - Don't permit 'key' or 'g' size longer than 'p'
The "qat-dh" DH implementation assumes that 'key' and 'g' can be copied into a buffer with size 'p_size'. However it was never checked that that was actually the case, which most likely allowed users to cause a buffer underflow via KEYCTL_DH_COMPUTE. Fix this by updating crypto_dh_decode_key() to verify this precondition for all DH implementations. Fixes: c983914 ("crypto: qat - Add DH support") Cc: <[email protected]> # v4.8+ Signed-off-by: Eric Biggers <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information