Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes the following issues: - missing selection in public_key that may result in a build failure - Potential crash in error path in omap-sham - ccp AES XTS bug that affects requests larger than 4096" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ccp - Fix AES XTS error for request sizes above 4096 crypto: public_key: select CRYPTO_AKCIPHER crypto: omap-sham - potential Oops on error in probehifive-unleashed-5.1
commit
446985428d
|
@ -13,6 +13,7 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
|
||||||
tristate "Asymmetric public-key crypto algorithm subtype"
|
tristate "Asymmetric public-key crypto algorithm subtype"
|
||||||
select MPILIB
|
select MPILIB
|
||||||
select CRYPTO_HASH_INFO
|
select CRYPTO_HASH_INFO
|
||||||
|
select CRYPTO_AKCIPHER
|
||||||
help
|
help
|
||||||
This option provides support for asymmetric public key type handling.
|
This option provides support for asymmetric public key type handling.
|
||||||
If signature generation and/or verification are to be used,
|
If signature generation and/or verification are to be used,
|
||||||
|
|
|
@ -122,6 +122,7 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
|
||||||
struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
|
struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
|
||||||
struct ccp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
|
struct ccp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
|
||||||
unsigned int unit;
|
unsigned int unit;
|
||||||
|
u32 unit_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!ctx->u.aes.key_len)
|
if (!ctx->u.aes.key_len)
|
||||||
|
@ -133,11 +134,17 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
|
||||||
if (!req->info)
|
if (!req->info)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++)
|
unit_size = CCP_XTS_AES_UNIT_SIZE__LAST;
|
||||||
if (!(req->nbytes & (unit_size_map[unit].size - 1)))
|
if (req->nbytes <= unit_size_map[0].size) {
|
||||||
break;
|
for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) {
|
||||||
|
if (!(req->nbytes & (unit_size_map[unit].size - 1))) {
|
||||||
|
unit_size = unit_size_map[unit].value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((unit_size_map[unit].value == CCP_XTS_AES_UNIT_SIZE__LAST) ||
|
if ((unit_size == CCP_XTS_AES_UNIT_SIZE__LAST) ||
|
||||||
(ctx->u.aes.key_len != AES_KEYSIZE_128)) {
|
(ctx->u.aes.key_len != AES_KEYSIZE_128)) {
|
||||||
/* Use the fallback to process the request for any
|
/* Use the fallback to process the request for any
|
||||||
* unsupported unit sizes or key sizes
|
* unsupported unit sizes or key sizes
|
||||||
|
@ -158,7 +165,7 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
|
||||||
rctx->cmd.engine = CCP_ENGINE_XTS_AES_128;
|
rctx->cmd.engine = CCP_ENGINE_XTS_AES_128;
|
||||||
rctx->cmd.u.xts.action = (encrypt) ? CCP_AES_ACTION_ENCRYPT
|
rctx->cmd.u.xts.action = (encrypt) ? CCP_AES_ACTION_ENCRYPT
|
||||||
: CCP_AES_ACTION_DECRYPT;
|
: CCP_AES_ACTION_DECRYPT;
|
||||||
rctx->cmd.u.xts.unit_size = unit_size_map[unit].value;
|
rctx->cmd.u.xts.unit_size = unit_size;
|
||||||
rctx->cmd.u.xts.key = &ctx->u.aes.key_sg;
|
rctx->cmd.u.xts.key = &ctx->u.aes.key_sg;
|
||||||
rctx->cmd.u.xts.key_len = ctx->u.aes.key_len;
|
rctx->cmd.u.xts.key_len = ctx->u.aes.key_len;
|
||||||
rctx->cmd.u.xts.iv = &rctx->iv_sg;
|
rctx->cmd.u.xts.iv = &rctx->iv_sg;
|
||||||
|
|
|
@ -1986,7 +1986,7 @@ err_algs:
|
||||||
&dd->pdata->algs_info[i].algs_list[j]);
|
&dd->pdata->algs_info[i].algs_list[j]);
|
||||||
err_pm:
|
err_pm:
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
if (dd->polling_mode)
|
if (!dd->polling_mode)
|
||||||
dma_release_channel(dd->dma_lch);
|
dma_release_channel(dd->dma_lch);
|
||||||
data_err:
|
data_err:
|
||||||
dev_err(dev, "initialization failed.\n");
|
dev_err(dev, "initialization failed.\n");
|
||||||
|
|
Loading…
Reference in New Issue