public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Gary Lin <glin@suse.com>
To: "Zhang, Chao B" <chao.b.zhang@intel.com>
Cc: edk2-devel@lists.01.org, qin.long@intel.com
Subject: Re: [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
Date: Tue, 17 Oct 2017 10:10:00 +0800	[thread overview]
Message-ID: <20171017021000.jen67cir7wrqpxfj@GaryWorkstation> (raw)
In-Reply-To: <20171016140829.59124-1-chao.b.zhang@intel.com>

On Mon, Oct 16, 2017 at 10:08:29PM +0800, Zhang, Chao B wrote:
> Fix GCC build error
> 
> Cc: Long Qin <qin.long@intel.com>
> Cc: Gary Lin <glin@suse.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
> ---
>  SecurityPkg/Library/AuthVariableLib/AuthService.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c
> index 7188ff6..1e7872a 100644
> --- a/SecurityPkg/Library/AuthVariableLib/AuthService.c
> +++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c
> @@ -1564,7 +1564,7 @@ CalculatePrivAuthVarSignChainSHA256Digest(
>    //
>    // Get SignerCert CommonName
>    //
> -  Status = X509GetCommonName(SignerCert, SignerCertSize, CertCommonName, &CertCommonNameSize);
> +  Status = X509GetCommonName(SignerCert, SignerCertSize, (CHAR8 *)CertCommonName, &CertCommonNameSize);
Hi Chao Zhang,

Although casting also silences the warning, why not declare
CertCommonName as CHAR8 directly? The only signedness check happens
in X509GetCommonName(). Sha256Update() requests "VOID *" so the
signedness doesn't matter. Besides, AsciiStrLen() also requests
CHAR8, so declaring CertCommonName as CHAR8 can remove the casting
altogether. What do you think?

Gary Lin

>    if (EFI_ERROR(Status)) {
>      DEBUG((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __FUNCTION__, Status));
>      return EFI_ABORTED;
> -- 
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 


  reply	other threads:[~2017-10-17  2:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 14:08 [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error Zhang, Chao B
2017-10-17  2:10 ` Gary Lin [this message]
2017-10-17  8:53   ` Long, Qin
2017-10-17 14:16     ` Ard Biesheuvel

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=20171017021000.jen67cir7wrqpxfj@GaryWorkstation \
    --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