diff options
author | Vakul Garg <vakul@freescale.com> | 2014-05-09 21:34:40 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-05-13 07:43:46 -0400 |
commit | 80cd88f2f54a01c8cdb459a3ee0569b25bb3d26a (patch) | |
tree | 3a15d14a2468fc229cc2fa21aa6f0ccb5136da5a /drivers/crypto | |
parent | 56b284461923e83daa0b622dcf0e34e264b733ef (diff) |
crypto: caam - reinitialize keys_fit_inline for decrypt and givencrypt
Re-initialize keys_fit_inline to avoid using its stale encrypt() shared
descriptor value prior to building descriptors for the decrypt() and
givencrypt() cases.
Signed-off-by: Vakul Garg <vakul@freescale.com>
[reworded commit text, enhanced code readability]
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 339277c7acb9..c09ce1f040d3 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -303,6 +303,7 @@ static int aead_null_set_sh_desc(struct crypto_aead *aead) | |||
303 | * Job Descriptor and Shared Descriptors | 303 | * Job Descriptor and Shared Descriptors |
304 | * must all fit into the 64-word Descriptor h/w Buffer | 304 | * must all fit into the 64-word Descriptor h/w Buffer |
305 | */ | 305 | */ |
306 | keys_fit_inline = false; | ||
306 | if (DESC_AEAD_NULL_DEC_LEN + DESC_JOB_IO_LEN + | 307 | if (DESC_AEAD_NULL_DEC_LEN + DESC_JOB_IO_LEN + |
307 | ctx->split_key_pad_len <= CAAM_DESC_BYTES_MAX) | 308 | ctx->split_key_pad_len <= CAAM_DESC_BYTES_MAX) |
308 | keys_fit_inline = true; | 309 | keys_fit_inline = true; |
@@ -472,6 +473,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead) | |||
472 | * Job Descriptor and Shared Descriptors | 473 | * Job Descriptor and Shared Descriptors |
473 | * must all fit into the 64-word Descriptor h/w Buffer | 474 | * must all fit into the 64-word Descriptor h/w Buffer |
474 | */ | 475 | */ |
476 | keys_fit_inline = false; | ||
475 | if (DESC_AEAD_DEC_LEN + DESC_JOB_IO_LEN + | 477 | if (DESC_AEAD_DEC_LEN + DESC_JOB_IO_LEN + |
476 | ctx->split_key_pad_len + ctx->enckeylen <= | 478 | ctx->split_key_pad_len + ctx->enckeylen <= |
477 | CAAM_DESC_BYTES_MAX) | 479 | CAAM_DESC_BYTES_MAX) |
@@ -527,6 +529,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead) | |||
527 | * Job Descriptor and Shared Descriptors | 529 | * Job Descriptor and Shared Descriptors |
528 | * must all fit into the 64-word Descriptor h/w Buffer | 530 | * must all fit into the 64-word Descriptor h/w Buffer |
529 | */ | 531 | */ |
532 | keys_fit_inline = false; | ||
530 | if (DESC_AEAD_GIVENC_LEN + DESC_JOB_IO_LEN + | 533 | if (DESC_AEAD_GIVENC_LEN + DESC_JOB_IO_LEN + |
531 | ctx->split_key_pad_len + ctx->enckeylen <= | 534 | ctx->split_key_pad_len + ctx->enckeylen <= |
532 | CAAM_DESC_BYTES_MAX) | 535 | CAAM_DESC_BYTES_MAX) |