All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: testmgr - fix initialization of 'secret_size'
@ 2021-05-10  8:54 Hui Tang
  2021-05-21  8:22 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Hui Tang @ 2021-05-10  8:54 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, xuzaibo, wangzhou1, linux-kernel

Actual data length of the 'secret' is not equal to the 'secret_size'.

Since the 'curve_id' has removed in the 'secret', the 'secret_size'
should subtract the length of the 'curve_id'.

Fixes: 6763f5ea2d9a(crypto: ecdh - move curve_id of ECDH from ...)

Signed-off-by: Hui Tang <tanghui20@huawei.com>
---
 crypto/testmgr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 34e4a3d..aead75d 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -2719,7 +2719,7 @@ static const struct kpp_testvec ecdh_p192_tv_template[] = {
 	"\xf4\x57\xcc\x4f\x1f\x4e\x31\xcc"
 	"\xe3\x40\x60\xc8\x06\x93\xc6\x2e"
 	"\x99\x80\x81\x28\xaf\xc5\x51\x74",
-	.secret_size = 32,
+	.secret_size = 30,
 	.b_public_size = 48,
 	.expected_a_public_size = 48,
 	.expected_ss_size = 24
@@ -2766,7 +2766,7 @@ static const struct kpp_testvec ecdh_p256_tv_template[] = {
 	"\x9f\x4a\x38\xcc\xc0\x2c\x49\x2f"
 	"\xb1\x32\xbb\xaf\x22\x61\xda\xcb"
 	"\x6f\xdb\xa9\xaa\xfc\x77\x81\xf3",
-	.secret_size = 40,
+	.secret_size = 38,
 	.b_public_size = 64,
 	.expected_a_public_size = 64,
 	.expected_ss_size = 32
@@ -2804,8 +2804,8 @@ static const struct kpp_testvec ecdh_p256_tv_template[] = {
 	"\x37\x08\xcc\x40\x5e\x7a\xfd\x6a"
 	"\x6a\x02\x6e\x41\x87\x68\x38\x77"
 	"\xfa\xa9\x44\x43\x2d\xef\x09\xdf",
-	.secret_size = 8,
-	.b_secret_size = 40,
+	.secret_size = 6,
+	.b_secret_size = 38,
 	.b_public_size = 64,
 	.expected_a_public_size = 64,
 	.expected_ss_size = 32,
--
2.8.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: testmgr - fix initialization of 'secret_size'
  2021-05-10  8:54 [PATCH] crypto: testmgr - fix initialization of 'secret_size' Hui Tang
@ 2021-05-21  8:22 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-05-21  8:22 UTC (permalink / raw)
  To: Hui Tang; +Cc: davem, linux-crypto, xuzaibo, wangzhou1, linux-kernel

On Mon, May 10, 2021 at 04:54:08PM +0800, Hui Tang wrote:
> Actual data length of the 'secret' is not equal to the 'secret_size'.
> 
> Since the 'curve_id' has removed in the 'secret', the 'secret_size'
> should subtract the length of the 'curve_id'.
> 
> Fixes: 6763f5ea2d9a(crypto: ecdh - move curve_id of ECDH from ...)
> 
> Signed-off-by: Hui Tang <tanghui20@huawei.com>
> ---
>  crypto/testmgr.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-21  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  8:54 [PATCH] crypto: testmgr - fix initialization of 'secret_size' Hui Tang
2021-05-21  8:22 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.