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:
@@ -323,19 +323,6 @@ error:
|
||||
return ukey;
|
||||
}
|
||||
|
||||
static int calc_hash(struct crypto_shash *tfm, u8 *digest,
|
||||
const u8 *buf, unsigned int buflen)
|
||||
{
|
||||
SHASH_DESC_ON_STACK(desc, tfm);
|
||||
int err;
|
||||
|
||||
desc->tfm = tfm;
|
||||
|
||||
err = crypto_shash_digest(desc, buf, buflen, digest);
|
||||
shash_desc_zero(desc);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int calc_hmac(u8 *digest, const u8 *key, unsigned int keylen,
|
||||
const u8 *buf, unsigned int buflen)
|
||||
{
|
||||
@@ -351,7 +338,7 @@ static int calc_hmac(u8 *digest, const u8 *key, unsigned int keylen,
|
||||
|
||||
err = crypto_shash_setkey(tfm, key, keylen);
|
||||
if (!err)
|
||||
err = calc_hash(tfm, digest, buf, buflen);
|
||||
err = crypto_shash_tfm_digest(tfm, buf, buflen, digest);
|
||||
crypto_free_shash(tfm);
|
||||
return err;
|
||||
}
|
||||
@@ -381,7 +368,8 @@ static int get_derived_key(u8 *derived_key, enum derived_key_type key_type,
|
||||
|
||||
memcpy(derived_buf + strlen(derived_buf) + 1, master_key,
|
||||
master_keylen);
|
||||
ret = calc_hash(hash_tfm, derived_key, derived_buf, derived_buf_len);
|
||||
ret = crypto_shash_tfm_digest(hash_tfm, derived_buf, derived_buf_len,
|
||||
derived_key);
|
||||
kzfree(derived_buf);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user