X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FLibrary%2FDxeTcg2PhysicalPresenceLib%2FDxeTcg2PhysicalPresenceLib.c;h=e34fd8da25720e4bb2dfccf93686659f3c32d463;hp=8912ee4108e329e367b5679198fe4d572d650536;hb=c31313da22176002010abbcfcf5d5c5200d182ec;hpb=0e47ac1535a5fff47b088c30a72d1abe7c817d37 diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c index 8912ee4108..e34fd8da25 100644 --- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c +++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c @@ -225,7 +225,7 @@ Tpm2CommandAllocPcr ( ); DEBUG ((EFI_D_INFO, "Tpm2PcrAllocate - %r\n", Status)); if (EFI_ERROR (Status)) { - return Status; + goto Done; } DEBUG ((EFI_D_INFO, "AllocationSuccess - %02x\n", AllocationSuccess)); @@ -233,7 +233,9 @@ Tpm2CommandAllocPcr ( DEBUG ((EFI_D_INFO, "SizeNeeded - %08x\n", SizeNeeded)); DEBUG ((EFI_D_INFO, "SizeAvailable - %08x\n", SizeAvailable)); - return EFI_SUCCESS; +Done: + ZeroMem(&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac)); + return Status; } /** @@ -264,6 +266,8 @@ Tpm2CommandChangeEps ( Status = Tpm2ChangeEPS (TPM_RH_PLATFORM, AuthSession); DEBUG ((EFI_D_INFO, "Tpm2ChangeEPS - %r\n", Status)); + + ZeroMem(&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac)); return Status; }