Skip to content
Snippets Groups Projects
Commit a80745a6 authored by Eric Biggers's avatar Eric Biggers Committed by David Howells
Browse files

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: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 7204eb85
Branches
Tags
No related merge requests found
...@@ -59,10 +59,7 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7, ...@@ -59,10 +59,7 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
/* Digest the message [RFC2315 9.3] */ /* Digest the message [RFC2315 9.3] */
ret = crypto_shash_init(desc); ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,
if (ret < 0)
goto error;
ret = crypto_shash_finup(desc, pkcs7->data, pkcs7->data_len,
sig->digest); sig->digest);
if (ret < 0) if (ret < 0)
goto error; goto error;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment