diff options
author | Eric Biggers <ebiggers@google.com> | 2017-12-08 16:13:29 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-12-08 16:13:29 +0100 |
commit | aa3300362060525fe1a32de56df9578033530d98 (patch) | |
tree | fc00a8c9e989ef2d7b3a5444324f8e596c99aea9 /crypto | |
parent | KEYS: be careful with error codes in public_key_verify_signature() (diff) | |
download | linux-aa3300362060525fe1a32de56df9578033530d98.tar.xz linux-aa3300362060525fe1a32de56df9578033530d98.zip |
X.509: 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>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asymmetric_keys/x509_public_key.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index c9013582c026..e67fd29fbd11 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c @@ -79,11 +79,7 @@ int x509_get_sig_params(struct x509_certificate *cert) desc->tfm = tfm; desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; - ret = crypto_shash_init(desc); - if (ret < 0) - goto error_2; - might_sleep(); - ret = crypto_shash_finup(desc, cert->tbs, cert->tbs_size, sig->digest); + ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); if (ret < 0) goto error_2; |