* [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
@ 2017-10-16 14:08 Zhang, Chao B
2017-10-17 2:10 ` Gary Lin
0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Chao B @ 2017-10-16 14:08 UTC (permalink / raw)
To: edk2-devel; +Cc: qin.long, glin, Chao Zhang
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);
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
2017-10-16 14:08 [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error Zhang, Chao B
@ 2017-10-17 2:10 ` Gary Lin
2017-10-17 8:53 ` Long, Qin
0 siblings, 1 reply; 4+ messages in thread
From: Gary Lin @ 2017-10-17 2:10 UTC (permalink / raw)
To: Zhang, Chao B; +Cc: edk2-devel, qin.long
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
2017-10-17 2:10 ` Gary Lin
@ 2017-10-17 8:53 ` Long, Qin
2017-10-17 14:16 ` Ard Biesheuvel
0 siblings, 1 reply; 4+ messages in thread
From: Long, Qin @ 2017-10-17 8:53 UTC (permalink / raw)
To: Gary Lin, Zhang, Chao B; +Cc: edk2-devel@lists.01.org
Agree. It's better to use CHAR8 directly.
From: Gary Lin [mailto:glin@suse.com]
Sent: Tuesday, October 17, 2017 10:10 AM
To: Zhang, Chao B <chao.b.zhang@intel.com>
Cc: edk2-devel@lists.01.org; Long, Qin <qin.long@intel.com>
Subject: Re: [edk2] [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
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<mailto:qin.long@intel.com>>
> Cc: Gary Lin <glin@suse.com<mailto:glin@suse.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chao Zhang <chao.b.zhang@intel.com<mailto: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<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
2017-10-17 8:53 ` Long, Qin
@ 2017-10-17 14:16 ` Ard Biesheuvel
0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-10-17 14:16 UTC (permalink / raw)
To: Long, Qin; +Cc: Gary Lin, Zhang, Chao B, edk2-devel@lists.01.org
On 17 October 2017 at 09:53, Long, Qin <qin.long@intel.com> wrote:
> Agree. It's better to use CHAR8 directly.
>
Could we get this fixed please? The GCC build has been broken for two days now.
>
> From: Gary Lin [mailto:glin@suse.com]
> Sent: Tuesday, October 17, 2017 10:10 AM
> To: Zhang, Chao B <chao.b.zhang@intel.com>
> Cc: edk2-devel@lists.01.org; Long, Qin <qin.long@intel.com>
> Subject: Re: [edk2] [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error
>
> 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<mailto:qin.long@intel.com>>
>> Cc: Gary Lin <glin@suse.com<mailto:glin@suse.com>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Chao Zhang <chao.b.zhang@intel.com<mailto: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<mailto: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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-17 14:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 14:08 [PATCH] SecurityPkg:AuthVariableLib:Fix GCC build error Zhang, Chao B
2017-10-17 2:10 ` Gary Lin
2017-10-17 8:53 ` Long, Qin
2017-10-17 14:16 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox