Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qce - Improve the conditions for requesting AES fallback cipher

The following are the conditions for requesting AES fallback cipher.
- AES-192
- AES-XTS request with len <= 512 byte (Allow messages of length
less than 512 bytes for all other AES encryption algorithms other
than AES XTS)
- AES-XTS request with len > QCE_SECTOR_SIZE and is not a multiple
of it

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thara Gopinath and committed by
Herbert Xu
25b71d61 02d0dae3

+11 -6
+11 -6
drivers/crypto/qce/skcipher.c
··· 274 274 if (!IS_ALIGNED(req->cryptlen, blocksize)) 275 275 return -EINVAL; 276 276 277 - /* qce is hanging when AES-XTS request len > QCE_SECTOR_SIZE and 278 - * is not a multiple of it; pass such requests to the fallback 277 + /* 278 + * Conditions for requesting a fallback cipher 279 + * AES-192 (not supported by crypto engine (CE)) 280 + * AES-XTS request with len <= 512 byte (not recommended to use CE) 281 + * AES-XTS request with len > QCE_SECTOR_SIZE and 282 + * is not a multiple of it.(Revisit this condition to check if it is 283 + * needed in all versions of CE) 279 284 */ 280 285 if (IS_AES(rctx->flags) && 281 - (((keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_256) || 282 - req->cryptlen <= aes_sw_max_len) || 283 - (IS_XTS(rctx->flags) && req->cryptlen > QCE_SECTOR_SIZE && 284 - req->cryptlen % QCE_SECTOR_SIZE))) { 286 + ((keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_256) || 287 + (IS_XTS(rctx->flags) && ((req->cryptlen <= aes_sw_max_len) || 288 + (req->cryptlen > QCE_SECTOR_SIZE && 289 + req->cryptlen % QCE_SECTOR_SIZE))))) { 285 290 skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback); 286 291 skcipher_request_set_callback(&rctx->fallback_req, 287 292 req->base.flags,