From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=137.65.250.26; helo=prv3-mh.provo.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from prv3-mh.provo.novell.com (prv3-mh.provo.novell.com [137.65.250.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 26809202E6180 for ; Mon, 16 Oct 2017 19:06:36 -0700 (PDT) Received: from GaryWorkstation (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Mon, 16 Oct 2017 20:10:04 -0600 Date: Tue, 17 Oct 2017 10:10:00 +0800 From: Gary Lin To: "Zhang, Chao B" Cc: edk2-devel@lists.01.org, qin.long@intel.com Message-ID: <20171017021000.jen67cir7wrqpxfj@GaryWorkstation> References: <20171016140829.59124-1-chao.b.zhang@intel.com> MIME-Version: 1.0 In-Reply-To: <20171016140829.59124-1-chao.b.zhang@intel.com> User-Agent: NeoMutt/20170912 (1.9.0) Subject: Re: [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 02:06:37 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 16, 2017 at 10:08:29PM +0800, Zhang, Chao B wrote: > Fix GCC build error > > Cc: Long Qin > Cc: Gary Lin > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Chao Zhang > --- > 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 >