diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2011-02-14 15:34:01 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:43:04 -0800 |
commit | 5af0737e99f2addfc066260a6141bc086315f7d3 (patch) | |
tree | 9d519956fb12e7d67d11027a37ef3764a1e15b46 /drivers/misc | |
parent | cf36c9c4f21ae4298dfad2279b4bdc1fd30f972c (diff) |
misc: tegra-crypto: do not specify any key when using ssk
if no key is specified then tegra-aes uses ssk by default
Original-Change-Id: Ia8f806a6822813d05f4d310b95676b058fd0c8cc
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/22163
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R74430209746f5f6cd2a600d5a392dc51723ff7d2
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/tegra-cryptodev.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/misc/tegra-cryptodev.c b/drivers/misc/tegra-cryptodev.c index 453e40ef0945..54023cbb983c 100644 --- a/drivers/misc/tegra-cryptodev.c +++ b/drivers/misc/tegra-cryptodev.c @@ -159,6 +159,7 @@ static int process_crypt_req(struct tegra_crypto_ctx *ctx, struct tegra_crypt_re int ret = 0, size = 0; unsigned long total = 0; struct tegra_crypto_completion tcrypt_complete; + const u8 *key = NULL; if (crypt_req->op & TEGRA_CRYPTO_ECB) { req = ablkcipher_request_alloc(ctx->ecb_tfm, GFP_KERNEL); @@ -177,13 +178,13 @@ static int process_crypt_req(struct tegra_crypto_ctx *ctx, struct tegra_crypt_re crypto_ablkcipher_clear_flags(tfm, ~0); - if (!ctx->use_ssk) { - ret = crypto_ablkcipher_setkey(tfm, crypt_req->key, - crypt_req->keylen); - if (ret < 0) { - pr_err("setkey failed"); - goto process_req_out; - } + if (!ctx->use_ssk) + key = crypt_req->key; + + ret = crypto_ablkcipher_setkey(tfm, key, crypt_req->keylen); + if (ret < 0) { + pr_err("setkey failed"); + goto process_req_out; } ret = alloc_bufs(xbuf); |