crypto: drop mask=CRYPTO_ALG_ASYNC from 'shash' tfm allocations
'shash' algorithms are always synchronous, so passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_shash() has no effect. Many users therefore already don't pass it, but some still do. This inconsistency can cause confusion, especially since the way the 'mask' argument works is somewhat counterintuitive. Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags. This patch shouldn't change any actual behavior. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:

committato da
Herbert Xu

parent
1ad0f1603a
commit
3d234b3313
@@ -342,7 +342,7 @@ static int calc_hmac(u8 *digest, const u8 *key, unsigned int keylen,
|
||||
struct crypto_shash *tfm;
|
||||
int err;
|
||||
|
||||
tfm = crypto_alloc_shash(hmac_alg, 0, CRYPTO_ALG_ASYNC);
|
||||
tfm = crypto_alloc_shash(hmac_alg, 0, 0);
|
||||
if (IS_ERR(tfm)) {
|
||||
pr_err("encrypted_key: can't alloc %s transform: %ld\n",
|
||||
hmac_alg, PTR_ERR(tfm));
|
||||
@@ -984,7 +984,7 @@ static int __init init_encrypted(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
hash_tfm = crypto_alloc_shash(hash_alg, 0, CRYPTO_ALG_ASYNC);
|
||||
hash_tfm = crypto_alloc_shash(hash_alg, 0, 0);
|
||||
if (IS_ERR(hash_tfm)) {
|
||||
pr_err("encrypted_key: can't allocate %s transform: %ld\n",
|
||||
hash_alg, PTR_ERR(hash_tfm));
|
||||
|
@@ -1199,14 +1199,14 @@ static int __init trusted_shash_alloc(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
hmacalg = crypto_alloc_shash(hmac_alg, 0, CRYPTO_ALG_ASYNC);
|
||||
hmacalg = crypto_alloc_shash(hmac_alg, 0, 0);
|
||||
if (IS_ERR(hmacalg)) {
|
||||
pr_info("trusted_key: could not allocate crypto %s\n",
|
||||
hmac_alg);
|
||||
return PTR_ERR(hmacalg);
|
||||
}
|
||||
|
||||
hashalg = crypto_alloc_shash(hash_alg, 0, CRYPTO_ALG_ASYNC);
|
||||
hashalg = crypto_alloc_shash(hash_alg, 0, 0);
|
||||
if (IS_ERR(hashalg)) {
|
||||
pr_info("trusted_key: could not allocate crypto %s\n",
|
||||
hash_alg);
|
||||
|
Fai riferimento in un nuovo problema
Block a user