Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Introduce crypto_shash_tfm_digest() and use it wherever possible. - Fix use-after-free and race in crypto_spawn_alg. - Add support for parallel and batch requests to crypto_engine. Algorithms: - Update jitter RNG for SP800-90B compliance. - Always use jitter RNG as seed in drbg. Drivers: - Add Arm CryptoCell driver cctrng. - Add support for SEV-ES to the PSP driver in ccp" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (114 commits) crypto: hisilicon - fix driver compatibility issue with different versions of devices crypto: engine - do not requeue in case of fatal error crypto: cavium/nitrox - Fix a typo in a comment crypto: hisilicon/qm - change debugfs file name from qm_regs to regs crypto: hisilicon/qm - add DebugFS for xQC and xQE dump crypto: hisilicon/zip - add debugfs for Hisilicon ZIP crypto: hisilicon/hpre - add debugfs for Hisilicon HPRE crypto: hisilicon/sec2 - add debugfs for Hisilicon SEC crypto: hisilicon/qm - add debugfs to the QM state machine crypto: hisilicon/qm - add debugfs for QM crypto: stm32/crc32 - protect from concurrent accesses crypto: stm32/crc32 - don't sleep in runtime pm crypto: stm32/crc32 - fix multi-instance crypto: stm32/crc32 - fix run-time self test issue. crypto: stm32/crc32 - fix ext4 chksum BUG_ON() crypto: hisilicon/zip - Use temporary sqe when doing work crypto: hisilicon - add device error report through abnormal irq crypto: hisilicon - remove codes of directly report device errors through MSI crypto: hisilicon - QM memory management optimization crypto: hisilicon - unify initial value assignment into QM ...
This commit is contained in:
@@ -127,16 +127,8 @@ nfs4_make_rec_clidname(char *dname, const struct xdr_netobj *clname)
|
||||
goto out;
|
||||
}
|
||||
|
||||
{
|
||||
SHASH_DESC_ON_STACK(desc, tfm);
|
||||
|
||||
desc->tfm = tfm;
|
||||
|
||||
status = crypto_shash_digest(desc, clname->data, clname->len,
|
||||
cksum.data);
|
||||
shash_desc_zero(desc);
|
||||
}
|
||||
|
||||
status = crypto_shash_tfm_digest(tfm, clname->data, clname->len,
|
||||
cksum.data);
|
||||
if (status)
|
||||
goto out;
|
||||
|
||||
@@ -1148,7 +1140,6 @@ nfsd4_cld_create_v2(struct nfs4_client *clp)
|
||||
struct crypto_shash *tfm = cn->cn_tfm;
|
||||
struct xdr_netobj cksum;
|
||||
char *principal = NULL;
|
||||
SHASH_DESC_ON_STACK(desc, tfm);
|
||||
|
||||
/* Don't upcall if it's already stored */
|
||||
if (test_bit(NFSD4_CLIENT_STABLE, &clp->cl_flags))
|
||||
@@ -1170,16 +1161,14 @@ nfsd4_cld_create_v2(struct nfs4_client *clp)
|
||||
else if (clp->cl_cred.cr_principal)
|
||||
principal = clp->cl_cred.cr_principal;
|
||||
if (principal) {
|
||||
desc->tfm = tfm;
|
||||
cksum.len = crypto_shash_digestsize(tfm);
|
||||
cksum.data = kmalloc(cksum.len, GFP_KERNEL);
|
||||
if (cksum.data == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
ret = crypto_shash_digest(desc, principal, strlen(principal),
|
||||
cksum.data);
|
||||
shash_desc_zero(desc);
|
||||
ret = crypto_shash_tfm_digest(tfm, principal, strlen(principal),
|
||||
cksum.data);
|
||||
if (ret) {
|
||||
kfree(cksum.data);
|
||||
goto out;
|
||||
@@ -1343,7 +1332,6 @@ nfsd4_cld_check_v2(struct nfs4_client *clp)
|
||||
struct crypto_shash *tfm = cn->cn_tfm;
|
||||
struct xdr_netobj cksum;
|
||||
char *principal = NULL;
|
||||
SHASH_DESC_ON_STACK(desc, tfm);
|
||||
|
||||
/* did we already find that this client is stable? */
|
||||
if (test_bit(NFSD4_CLIENT_STABLE, &clp->cl_flags))
|
||||
@@ -1381,14 +1369,12 @@ found:
|
||||
principal = clp->cl_cred.cr_principal;
|
||||
if (principal == NULL)
|
||||
return -ENOENT;
|
||||
desc->tfm = tfm;
|
||||
cksum.len = crypto_shash_digestsize(tfm);
|
||||
cksum.data = kmalloc(cksum.len, GFP_KERNEL);
|
||||
if (cksum.data == NULL)
|
||||
return -ENOENT;
|
||||
status = crypto_shash_digest(desc, principal, strlen(principal),
|
||||
cksum.data);
|
||||
shash_desc_zero(desc);
|
||||
status = crypto_shash_tfm_digest(tfm, principal,
|
||||
strlen(principal), cksum.data);
|
||||
if (status) {
|
||||
kfree(cksum.data);
|
||||
return -ENOENT;
|
||||
|
Reference in New Issue
Block a user