Skip to content

Commit

Permalink
crypto: caam - fix non-hmac hashes
Browse files Browse the repository at this point in the history
Since 6de62f1 ("crypto: algif_hash - Require setkey before
accept(2)"), the AF_ALG interface requires userspace to provide a key
to any algorithm that has a setkey method.  However, the non-HMAC
algorithms are not keyed, so setting a key is unnecessary.

Fix this by removing the setkey method from the non-keyed hash
algorithms.

Fixes: 6de62f1 ("crypto: algif_hash - Require setkey before accept(2)")
Cc: <[email protected]>
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Russell King authored and herbertx committed Aug 9, 2016
1 parent c12abf3 commit a0118c8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/crypto/caam/caamhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,7 @@ caam_hash_alloc(struct caam_hash_template *template,
template->name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
template->driver_name);
t_alg->ahash_alg.setkey = NULL;
}
alg->cra_module = THIS_MODULE;
alg->cra_init = caam_hash_cra_init;
Expand Down

0 comments on commit a0118c8

Please sign in to comment.