diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/testmgr.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 67ff4aaa3c9c..a75f11ffb957 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -843,6 +843,14 @@ static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate, | |||
843 | goto out; | 843 | goto out; |
844 | } | 844 | } |
845 | 845 | ||
846 | if (dlen != ctemplate[i].outlen) { | ||
847 | printk(KERN_ERR "alg: comp: Compression test %d " | ||
848 | "failed for %s: output len = %d\n", i + 1, algo, | ||
849 | dlen); | ||
850 | ret = -EINVAL; | ||
851 | goto out; | ||
852 | } | ||
853 | |||
846 | if (memcmp(result, ctemplate[i].output, dlen)) { | 854 | if (memcmp(result, ctemplate[i].output, dlen)) { |
847 | printk(KERN_ERR "alg: comp: Compression test %d " | 855 | printk(KERN_ERR "alg: comp: Compression test %d " |
848 | "failed for %s\n", i + 1, algo); | 856 | "failed for %s\n", i + 1, algo); |
@@ -867,6 +875,14 @@ static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate, | |||
867 | goto out; | 875 | goto out; |
868 | } | 876 | } |
869 | 877 | ||
878 | if (dlen != dtemplate[i].outlen) { | ||
879 | printk(KERN_ERR "alg: comp: Decompression test %d " | ||
880 | "failed for %s: output len = %d\n", i + 1, algo, | ||
881 | dlen); | ||
882 | ret = -EINVAL; | ||
883 | goto out; | ||
884 | } | ||
885 | |||
870 | if (memcmp(result, dtemplate[i].output, dlen)) { | 886 | if (memcmp(result, dtemplate[i].output, dlen)) { |
871 | printk(KERN_ERR "alg: comp: Decompression test %d " | 887 | printk(KERN_ERR "alg: comp: Decompression test %d " |
872 | "failed for %s\n", i + 1, algo); | 888 | "failed for %s\n", i + 1, algo); |