Commit 82d1585b authored by Tom Lendacky's avatar Tom Lendacky Committed by Herbert Xu

crypto: ccp - Cleanup hash invocation calls

Cleanup the ahash digest invocations to check the init
return code and make use of the finup routine.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 81a59f00
...@@ -198,7 +198,7 @@ static int ccp_aes_cmac_digest(struct ahash_request *req) ...@@ -198,7 +198,7 @@ static int ccp_aes_cmac_digest(struct ahash_request *req)
if (ret) if (ret)
return ret; return ret;
return ccp_do_cmac_update(req, req->nbytes, 1); return ccp_aes_cmac_finup(req);
} }
static int ccp_aes_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, static int ccp_aes_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
......
...@@ -248,9 +248,13 @@ static int ccp_sha_finup(struct ahash_request *req) ...@@ -248,9 +248,13 @@ static int ccp_sha_finup(struct ahash_request *req)
static int ccp_sha_digest(struct ahash_request *req) static int ccp_sha_digest(struct ahash_request *req)
{ {
ccp_sha_init(req); int ret;
return ccp_do_sha_update(req, req->nbytes, 1); ret = ccp_sha_init(req);
if (ret)
return ret;
return ccp_sha_finup(req);
} }
static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key, static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment