lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] crypto: testmgr - call shash_init in crc32c algo
Date
In case of device call required in low level driver,
the context must be initialized before calling the final
function.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
crypto/testmgr.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 8386038..4a00d7c 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2181,6 +2181,13 @@ static int alg_test_crc32c(const struct alg_test_desc *desc,
shash->tfm = tfm;
shash->flags = 0;

+ err = crypto_shash_init(shash);
+ if (err) {
+ printk(KERN_ERR "alg: crc32c: init failed for "
+ "%s: %d\n", driver, err);
+ break;
+ }
+
*ctx = 420553207;
err = crypto_shash_final(shash, (u8 *)&val);
if (err) {
--
2.7.4
\
 
 \ /
  Last update: 2019-04-01 14:55    [W:0.036 / U:34.708 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site