Skip to content

Commit aa33003

Browse files
ebiggersdhowells
authored andcommitted
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 <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent 72f9a07 commit aa33003

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crypto/asymmetric_keys/x509_public_key.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ int x509_get_sig_params(struct x509_certificate *cert)
7979
desc->tfm = tfm;
8080
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
8181

82-
ret = crypto_shash_init(desc);
83-
if (ret < 0)
84-
goto error_2;
85-
might_sleep();
86-
ret = crypto_shash_finup(desc, cert->tbs, cert->tbs_size, sig->digest);
82+
ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest);
8783
if (ret < 0)
8884
goto error_2;
8985

0 commit comments

Comments
 (0)