public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Long, Qin" <qin.long@intel.com>
To: "Yao, Jiewen" <jiewen.yao@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zhang, Chao B" <chao.b.zhang@intel.com>
Subject: Re: [PATCH 1/2] SecurityPkg/FmpAuthLib: Add PublicKeyDataLength check
Date: Thu, 22 Dec 2016 05:14:48 +0000	[thread overview]
Message-ID: <BF2CCE9263284D428840004653A28B6E53F4E2BD@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1482382829-12168-2-git-send-email-jiewen.yao@intel.com>

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


> -----Original Message-----
> From: Yao, Jiewen
> Sent: Thursday, December 22, 2016 1:00 PM
> To: edk2-devel@lists.01.org
> Cc: Zhang, Chao B; Long, Qin
> Subject: [PATCH 1/2] SecurityPkg/FmpAuthLib: Add PublicKeyDataLength
> check
> 
> Add PublicKeyDataLength check to be multiple SHA256_DIGEST_SIZE to avoid
> caller make mistake, or platform mis-configuration.
> 
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Qin Long <qin.long@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
> 
> SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticatio
> nLibRsa2048Sha256.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git
> a/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticat
> ionLibRsa2048Sha256.c
> b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticat
> ionLibRsa2048Sha256.c
> index d113d58..4b2556c 100644
> ---
> a/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticat
> ionLibRsa2048Sha256.c
> +++
> b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthentic
> +++ ationLibRsa2048Sha256.c
> @@ -306,6 +306,11 @@ AuthenticateFmpImage (
>      return RETURN_UNSUPPORTED;
>    }
> 
> +  if ((PublicKeyDataLength % SHA256_DIGEST_SIZE) != 0) {
> +    DEBUG ((DEBUG_ERROR, "PublicKeyDataLength is not multiple SHA256
> size\n"));
> +    return RETURN_UNSUPPORTED;
> +  }
> +
>    if (ImageSize < sizeof(EFI_FIRMWARE_IMAGE_AUTHENTICATION)) {
>      DEBUG((DEBUG_ERROR, "AuthenticateFmpImage - ImageSize too
> small\n"));
>      return RETURN_INVALID_PARAMETER;
> --
> 2.7.4.windows.1



  reply	other threads:[~2016-12-22  5:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22  5:00 [PATCH 0/2] Add check for PublicKeyDataLength Jiewen Yao
2016-12-22  5:00 ` [PATCH 1/2] SecurityPkg/FmpAuthLib: Add PublicKeyDataLength check Jiewen Yao
2016-12-22  5:14   ` Long, Qin [this message]
2016-12-22  5:00 ` [PATCH 2/2] SignedCapsulePkg/SystemCapsuleLib: Add ASSERT check for PCD Jiewen Yao
2016-12-22  5:15   ` Long, Qin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF2CCE9263284D428840004653A28B6E53F4E2BD@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox