The patch looks good.
And one typo was in original comment: 
   // Check the reponse data header (tag,parasize and returncode )
                             ------> response

Reviewed-by: Qin Long <qin.l...@intel.com>


Best Regards & Thanks,
LONG, Qin

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang, 
> Chao B
> Sent: Tuesday, June 7, 2016 10:20 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kin...@intel.com>; Yao, Jiewen 
> <jiewen....@intel.com>; Zhang, Chao B <chao.b.zh...@intel.com>
> Subject: [edk2] [PATCH] SecurityPkg : Tpm12DeviceLibDTpm: Fix TPM12 wrong 
> Response Tag check
> 
> TcgDxePassThroughToTpm should be able to handle all TPM12 Command & Response 
> correctly.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chao Zhang <chao.b.zh...@intel.com>
> ---
>  SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c 
> b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> index 4e04299..5e154d0 100644
> --- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> +++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> @@ -267,6 +267,7 @@ Tpm12TisTpmCommand (
>    UINT32                            TpmOutSize;
>    UINT16                            Data16;
>    UINT32                            Data32;
> +  UINT16                            RspTag;
> 
>    DEBUG_CODE (
>      UINTN  DebugSize;
> @@ -367,8 +368,9 @@ Tpm12TisTpmCommand (
>    // Check the reponse data header (tag,parasize and returncode )
>    //
>    CopyMem (&Data16, BufferOut, sizeof (UINT16));
> -  if (SwapBytes16 (Data16) != TPM_TAG_RSP_COMMAND) {
> -    DEBUG ((EFI_D_ERROR, "TPM12: TPM_ST_RSP error - %x\n", 
> TPM_TAG_RSP_COMMAND));
> +  RspTag = SwapBytes16 (Data16);
> +  if (RspTag != TPM_TAG_RSP_COMMAND && RspTag != TPM_TAG_RSP_AUTH1_COMMAND 
> && RspTag !=
> TPM_TAG_RSP_AUTH2_COMMAND) {
> +    DEBUG ((EFI_D_ERROR, "TPM12: Response tag error - current tag value is 
> %x\n", RspTag));
>      Status = EFI_UNSUPPORTED;
>      goto Exit;
>    }
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to