Skip to content
Snippets Groups Projects
Commit 35f7d522 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu
Browse files

crypto: dh - fix calculating encoded key size


It was forgotten to increase DH_KPP_SECRET_MIN_SIZE to include 'q_size',
causing an out-of-bounds write of 4 bytes in crypto_dh_encode_key(), and
an out-of-bounds read of 4 bytes in crypto_dh_decode_key().  Fix it, and
fix the lengths of the test vectors to match this.

Reported-by: default avatar <syzbot+6d38d558c25b53b8f4ed@syzkaller.appspotmail.com>
Fixes: e3fe0ae1 ("crypto: dh - add public key verification test")
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent afb31cd2
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment