aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-12-08 10:13:28 -0500
committerDavid Howells <dhowells@redhat.com>2017-12-08 10:13:28 -0500
commita80745a6de51a651977a16ef81cba0126f9dd66f (patch)
tree8c06d3929fbf4f365a57a85100fecd576fd1d75c
parent7204eb8590c750e8c10b47f4acd4efe6e4138452 (diff)
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 <ebiggers@google.com> Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--crypto/asymmetric_keys/pkcs7_verify.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/asymmetric_keys/pkcs7_verify.c b/crypto/asymmetric_keys/pkcs7_verify.c
index 2d93d9eccb4d..255e84abdc69 100644
--- a/crypto/asymmetric_keys/pkcs7_verify.c
+++ b/crypto/asymmetric_keys/pkcs7_verify.c
@@ -59,11 +59,8 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
59 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; 59 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
60 60
61 /* Digest the message [RFC2315 9.3] */ 61 /* Digest the message [RFC2315 9.3] */
62 ret = crypto_shash_init(desc); 62 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,
63 if (ret < 0) 63 sig->digest);
64 goto error;
65 ret = crypto_shash_finup(desc, pkcs7->data, pkcs7->data_len,
66 sig->digest);
67 if (ret < 0) 64 if (ret < 0)
68 goto error; 65 goto error;
69 pr_devel("MsgDigest = [%*ph]\n", 8, sig->digest); 66 pr_devel("MsgDigest = [%*ph]\n", 8, sig->digest);