From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::232; helo=mail-io0-x232.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C5FDC21F38821 for ; Tue, 17 Oct 2017 07:12:29 -0700 (PDT) Received: by mail-io0-x232.google.com with SMTP id n137so2423546iod.6 for ; Tue, 17 Oct 2017 07:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v6VfF2p2oIgx7SFvRvPp9gqm5HPvBHsvQxsRTkjra5I=; b=gdJpXW5fKiZgMYmoZvMa7DYOFsv6tLuzNobNmJrgc+IBjsfLcBhlv2Z2QPrqASqm/t dTGLIeWeNY5X4WVl8afrk7+JcIIOh/AgwMQuJd/0Ww3/VnkPg0gEtQMCPBLg0FEdMi8c JyvD5BPSriP1kWtTOFgm/HrlxvyuG61AF2ylI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v6VfF2p2oIgx7SFvRvPp9gqm5HPvBHsvQxsRTkjra5I=; b=iEGs9Fztuew+csqn1ouqZQE80WhzYYaeaj/FCufQFEJWZMCarPE2TePax/qlArI3+Z L7vWi78aVBMYb33BXgAV5wyiwcNilR+G/61b9WkQSRaF1j4OX9Zdjsy3O1IXPqVKHkST YTKnm66Ooj9WYjCVWgGT826M4BFXtI8vnP06KnlDt4cPPJezfi3UVyhzcvRy0ZJmNEzS Sw0oHyO5MWffCY9Xe2T5iVxub+Iir2yy1TUeQmVk8ea5cIgHxokAE4oASpS2V7w7i6CZ gp5LOlw4RWkAtKU36DywOz4oL77Aoa2pJCwruDYeaM9ltMgtu89adUv+o8bC32vUzf3W LY4g== X-Gm-Message-State: AMCzsaVguNrGlA4r/ozI+mXANd2Z9kbelGogxjPZ05zPlyWQ8HBI6gEs OBH3QLXcmNRkVJPK1Ixd+M34+v2fDO42R8oMHMJRsw== X-Google-Smtp-Source: ABhQp+QBGSB4iCCXOiVX9LIA1HNy97azE+w/2a6t73Hw8q5W2DwdUc0FPAXNpFDY4THnP8UGkstq+erGRvh2raT32D0= X-Received: by 10.107.133.91 with SMTP id h88mr16659775iod.52.1508249764937; Tue, 17 Oct 2017 07:16:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Tue, 17 Oct 2017 07:16:04 -0700 (PDT) In-Reply-To: References: <20171016140829.59124-1-chao.b.zhang@intel.com> <20171017021000.jen67cir7wrqpxfj@GaryWorkstation> From: Ard Biesheuvel Date: Tue, 17 Oct 2017 15:16:04 +0100 Message-ID: To: "Long, Qin" Cc: Gary Lin , "Zhang, Chao B" , "edk2-devel@lists.01.org" 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 14:12:30 -0000 Content-Type: text/plain; charset="UTF-8" On 17 October 2017 at 09:53, Long, Qin 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 > Cc: edk2-devel@lists.01.org; Long, Qin > 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 > >> 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 >> > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel