fix MIC buffer sizing in selftest
PATCH 1/1 fix MIC buffer sizing in selftest
From: Joep Duin <[email protected]>
Signed-off-by Joep Duin <[email protected]>
--- crypto/krb5/selftest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
crypto/krb5/selftest.c +3 -3
@@ -427,10 +427,10 @@ static int krb5_test_one_mic(const struct krb5_mic_test *test, void *buf)memcpy (buf + offset, plain.data, plain.len);/* Generate a MIC generation request. */ -sg_init_one (sg, buf,1024 ); +sg_init_one (sg, buf, message_len); - ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 ,1024 , - krb5->cksum_len, plain.len); + ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 , message_len, + krb5->cksum_len, plain.len);if (ret <0 ) {CHECK (1 );pr_warn ("Get MIC failed %d\n" , ret);
Signature · 1 line
2.51.2
Herbert Xu
maintainerQuoted 12 lines · Joep Duin
From: Joep Duin <[email protected]>
Signed-off-by Joep Duin <[email protected]>---
crypto/krb5/selftest.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)crypto/krb5/selftest.c +0
-0
crypto/krb5/selftest.c static int krb5_test_one_mic(const struct krb5_mic_test *test, void *buf) · line 433
Quoted 10 lines
crypto/krb5/selftest.c +3
-3@@ -427,10 +427,10 @@ static int krb5_test_one_mic(const struct krb5_mic_test *test, void *buf)memcpy (buf + offset, plain.data, plain.len);/* Generate a MIC generation request. */ -sg_init_one (sg, buf,1024 ); +sg_init_one (sg, buf, message_len); - ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 ,1024 , - krb5->cksum_len, plain.len); + ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 , message_len, + krb5->cksum_len, plain.len);
I have no idea what you're trying to fix here. Please explain the problem.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 8 lines · Herbert Xu
crypto/krb5/selftest.c static int krb5_test_one_mic(const struct krb5_mic_test *test, void *buf) · line 433
Quoted 8 lines
/* Generate a MIC generation request. */crypto/krb5/selftest.c +3
-3-sg_init_one (sg, buf,1024 ); +sg_init_one (sg, buf, message_len); - ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 ,1024 , - krb5->cksum_len, plain.len); + ret =crypto_krb5_get_mic (krb5, ci,NULL , sg,1 , message_len, + krb5->cksum_len, plain.len);
The buffer doesn't need to fit exactly, it just needs to be big enough to hold the output produced, but it can be bigger.
David