From: Tom Lendacky Date: Mon, 6 Jan 2014 19:34:23 +0000 (-0600) Subject: crypto: ccp - Cleanup hash invocation calls X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=82d1585b9a9d5106ec6a630696f3e2e532fc3cba;p=linux-beck.git 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: Tom Lendacky Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index a52b97a4c843..8e162ad82085 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c @@ -198,7 +198,7 @@ static int ccp_aes_cmac_digest(struct ahash_request *req) if (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, diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index d30f6c893ffb..3867290b3531 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c @@ -248,9 +248,13 @@ static int ccp_sha_finup(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,