Exactly. Thanks for catching this. 
Will send the new patch later.

Best Regards & Thanks,
LONG, Qin

> -----Original Message-----
> From: Zhang, Chao B
> Sent: Tuesday, August 25, 2015 8:17 PM
> To: Long, Qin; [email protected]
> Subject: RE: [patch] SecurityPkg: Fix one returned status code issue in
> P7Verify Protocol.
> 
> Qin:
>   In this case, Should AttachedData be freed before return UNSUPPORTED
> 
> 
> 
> 
> 
> Thanks & Best regards
> Chao Zhang
> 
> -----Original Message-----
> From: Long, Qin
> Sent: Tuesday, August 25, 2015 4:53 PM
> To: Zhang, Chao B; [email protected]
> Subject: [patch] SecurityPkg: Fix one returned status code issue in P7Verify
> Protocol.
> 
> VerifyBuffer() in PKCS7 Verify Protocol should return EFI_UNSUPPORTED
> when signed data is embedded in SignedData but InData is not NULL.
> This patch is to comply with the spec definition.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qin Long <[email protected]>
> ---
>  SecurityPkg/Pkcs7Verify/Pkcs7VerifyDxe/Pkcs7VerifyDxe.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/SecurityPkg/Pkcs7Verify/Pkcs7VerifyDxe/Pkcs7VerifyDxe.c
> b/SecurityPkg/Pkcs7Verify/Pkcs7VerifyDxe/Pkcs7VerifyDxe.c
> index 13c9138..8bf1f1f 100644
> --- a/SecurityPkg/Pkcs7Verify/Pkcs7VerifyDxe/Pkcs7VerifyDxe.c
> +++ b/SecurityPkg/Pkcs7Verify/Pkcs7VerifyDxe/Pkcs7VerifyDxe.c
> @@ -833,6 +833,12 @@ VerifyBuffer (
>      return EFI_UNSUPPORTED;
>    }
>    if (AttachedData != NULL) {
> +    if (InData != NULL) {
> +      //
> +      // Signed data embedded in SignedData but InData is not NULL
> +      //
> +      return EFI_UNSUPPORTED;
> +    }
>      //
>      // PKCS7-formatted signedData with attached content; Use the
> embedded
>      // content for verification
> --
> 1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to