Re: [PATCH v2 1/2] crypto: dh - fix calculating encoded key size

2018-08-03 Thread Herbert Xu
On Fri, Jul 27, 2018 at 03:36:10PM -0700, Eric Biggers wrote: > From: Eric Biggers > > 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().

[PATCH v2 1/2] crypto: dh - fix calculating encoded key size

2018-07-27 Thread Eric Biggers
From: Eric Biggers 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.