From 040051e5c65dadcffe73668be6639088e6b4e7da Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 7 Mar 2024 11:14:56 -0800 Subject: [PATCH] Fix for crypto callback hashing return code initialization. ZD 17634 --- src/tpm2_cryptocb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tpm2_cryptocb.c b/src/tpm2_cryptocb.c index 0115d86..4746374 100644 --- a/src/tpm2_cryptocb.c +++ b/src/tpm2_cryptocb.c @@ -436,8 +436,8 @@ int wolfTPM2_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx) if (hashCtx) hash.handle.hndl = hashCtx->handle; + rc = 0; /* initialize return code */ if (info->hash.in != NULL) { /* Update */ - rc = 0; /* If not single shot (update and final) then allocate context */ if (hashCtx == NULL && info->hash.digest == NULL) { hashCtx = (WOLFTPM2_HASHCTX*)XMALLOC(sizeof(*hashCtx), NULL,