Skip to content

Commit a80745a

Browse files
ebiggersdhowells
authored andcommitted
pkcs7: use crypto_shash_digest()
Use crypto_shash_digest() instead of crypto_shash_init() followed by crypto_shash_finup(). (For simplicity only; they are equivalent.) Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent 7204eb8 commit a80745a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

crypto/asymmetric_keys/pkcs7_verify.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,8 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
5959
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
6060

6161
/* Digest the message [RFC2315 9.3] */
62-
ret = crypto_shash_init(desc);
63-
if (ret < 0)
64-
goto error;
65-
ret = crypto_shash_finup(desc, pkcs7->data, pkcs7->data_len,
66-
sig->digest);
62+
ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,
63+
sig->digest);
6764
if (ret < 0)
6865
goto error;
6966
pr_devel("MsgDigest = [%*ph]\n", 8, sig->digest);

0 commit comments

Comments
 (0)