Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-17 12:38:06 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-17 12:38:06 +0200
commit19327c8d7b562ea9dc2199e3b211e7170e00b844 (patch)
treef30beda05294428a1b8a9d01fc9743d595a764e1
parent3eef5f61d68ca0c8979dfc4688e875f0cde67fb1 (diff)
parent3cedd93eaeabe4c76a951d93b7008d722914a157 (diff)
Merge branch 'users/msuchanek/SLE15/for-next' into SLE15
Pull powerpc crypto fix from Michal Suchanek suse-commit: 187af5acf5ad2298218938a66776e34cab0ddb90
-rw-r--r--arch/powerpc/crypto/crc-vpmsum_test.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/powerpc/crypto/crc-vpmsum_test.c b/arch/powerpc/crypto/crc-vpmsum_test.c
index 0153a9c6f4af..98ea4f4d3dde 100644
--- a/arch/powerpc/crypto/crc-vpmsum_test.c
+++ b/arch/powerpc/crypto/crc-vpmsum_test.c
@@ -78,16 +78,12 @@ static int __init crc_test_init(void)
pr_info("crc-vpmsum_test begins, %lu iterations\n", iterations);
for (i=0; i<iterations; i++) {
- size_t len, offset;
+ size_t offset = prandom_u32_max(16);
+ size_t len = prandom_u32_max(MAX_CRC_LENGTH);
- get_random_bytes(data, MAX_CRC_LENGTH);
- get_random_bytes(&len, sizeof(len));
- get_random_bytes(&offset, sizeof(offset));
-
- len %= MAX_CRC_LENGTH;
- offset &= 15;
if (len <= offset)
continue;
+ prandom_bytes(data, len);
len -= offset;
crypto_shash_update(crct10dif_shash, data+offset, len);