public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Tian, Feng" <feng.tian@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Zhang, Chao B" <chao.b.zhang@intel.com>
Subject: Re: [PATCH V4 01/15] MdeModulePkg/Include: Add FmpAuthenticationLib header.
Date: Wed, 26 Oct 2016 00:50:43 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386B73CC@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <E92EE9817A31E24EB0585FDF735412F56483AF05@ORSMSX113.amr.corp.intel.com>

Hi Mike
Let me clarify:

The function is used to do the authentication for FMP capsule based upon   EFI_FIRMWARE_IMAGE_AUTHENTICATION.
This sentence is correct, because the capsule image input should be started by EFI_FIRMWARE_IMAGE_AUTHENTICATION.

LastAttemptStatus is the result of capsule process. The caller is expected convert the return Status to LastAttemptStatus.
It is recorded in ESRT entry and FMP.EFI_FIRMWARE_IMAGE_DESCRIPTOR in next boot.
Current consumer is SignedCapsulePkg\Library\EdkiiSystemCapsuleLib\ EdkiiSystemCapsuleLib.c, ExtractAuthenticatedImage() function.

I agree with you that it is confusing. I will add more sentence to describe. And I do not see any need to update function prototype. Do you think so?

The typo is fixed. Thanks.


From: Kinney, Michael D
Sent: Wednesday, October 26, 2016 7:54 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: RE: [PATCH V4 01/15] MdeModulePkg/Include: Add FmpAuthenticationLib header.

Jiewen,

I am confused by the description of this API.

I refers to the LastAttemptStatus field, but that field is not in
EFI_FIRMWARE_IMAGE_AUTHENTICATION structure.  Instead, it is in the
EFI_FIRMWARE_IMAGE_DESCRIPTOR structure.

Is the prototype to this function correct?

Can you also update the description to include which structure the
LastAttemptStatus field is in and how it is found from the input
parameters?

One typo noted inline below.

Thanks,

Mike


> -----Original Message-----
> From: Yao, Jiewen
> Sent: Saturday, October 22, 2016 7:20 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Tian, Feng <feng.tian@intel.com<mailto:feng.tian@intel.com>>; Zeng, Star <star.zeng@intel.com<mailto:star.zeng@intel.com>>; Kinney, Michael
> D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Gao, Liming <liming.gao@intel.com<mailto:liming.gao@intel.com>>; Zhang, Chao B
> <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Subject: [PATCH V4 01/15] MdeModulePkg/Include: Add FmpAuthenticationLib header.
>
> This library is used to authenticate a UEFI defined FMP Capsule.
>
> Cc: Feng Tian <feng.tian@intel.com<mailto:feng.tian@intel.com>>
> Cc: Star Zeng <star.zeng@intel.com<mailto:star.zeng@intel.com>>
> Cc: Michael D Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
> Cc: Liming Gao <liming.gao@intel.com<mailto:liming.gao@intel.com>>
> Cc: Chao Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> Reviewed-by: Liming Gao <liming.gao@intel.com<mailto:liming.gao@intel.com>>
> ---
>  MdeModulePkg/Include/Library/FmpAuthenticationLib.h | 57 ++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>
> diff --git a/MdeModulePkg/Include/Library/FmpAuthenticationLib.h
> b/MdeModulePkg/Include/Library/FmpAuthenticationLib.h
> new file mode 100644
> index 0000000..ed098d4
> --- /dev/null
> +++ b/MdeModulePkg/Include/Library/FmpAuthenticationLib.h
> @@ -0,0 +1,57 @@
> +/** @file
> +  FMP capsule authenitcation Library.
> +
> +Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD License
> +which accompanies this distribution.  The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +
> +#ifndef __FMP_AUTHENTICATION_LIB_H__
> +#define __FMP_AUTHENTICATION_LIB_H__
> +
> +#include <Protocol/FirmwareManagement.h>
> +
> +/**
> +  The fucntion is used to do the authentication for FMP capsule based upon

Typo.  Should be "The function is".

> +  EFI_FIRMWARE_IMAGE_AUTHENTICATION.
> +
> +  The caller may convert the RETURN_STATUS to ESRT/FMP LastAttemptStatus.
> +
> +  Caution: This function may receive untrusted input.
> +
> +  @param[in]  Image                   Points to an FMP authentication image, started
> from EFI_FIRMWARE_IMAGE_AUTHENTICATION.
> +  @param[in]  ImageSize               Size of the authentication image in bytes.
> +  @param[in]  PublicKeyData           The public key data used to validate the
> signature.
> +  @param[in]  PublicKeyDataLength     The length of the public key data.
> +
> +  @retval RETURN_SUCCESS            Authentication pass.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_SUCCESS.
> +  @retval RETURN_SECURITY_VIOLATION Authentication fail.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR.
> +  @retval RETURN_INVALID_PARAMETER  The image is in an invalid format.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
> +  @retval RETURN_UNSUPPORTED        No Authentication handler associated with
> CertType.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
> +  @retval RETURN_UNSUPPORTED        Image or ImageSize is invalid.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
> +  @retval RETURN_OUT_OF_RESOURCES   No Authentication handler associated with
> CertType.
> +                                    The LastAttemptStatus should be
> LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES.
> +**/
> +RETURN_STATUS
> +EFIAPI
> +AuthenticateFmpImage (
> +  IN EFI_FIRMWARE_IMAGE_AUTHENTICATION *Image,
> +  IN UINTN                             ImageSize,
> +  IN CONST UINT8                       *PublicKeyData,
> +  IN UINTN                             PublicKeyDataLength
> +  );
> +
> +#endif
> +
> --
> 2.7.4.windows.1


  reply	other threads:[~2016-10-26  0:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-23  2:20 [PATCH V4 00/15] Add capsule support lib and app Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 01/15] MdeModulePkg/Include: Add FmpAuthenticationLib header Jiewen Yao
2016-10-25 23:54   ` Kinney, Michael D
2016-10-26  0:50     ` Yao, Jiewen [this message]
2016-10-26  2:06       ` Kinney, Michael D
2016-10-23  2:20 ` [PATCH V4 02/15] MdeModulePkg/CapsuleLib: Add ProcessCapsules() API Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 03/15] MdeModulePkg/MdeModulePkg.dec: Add capsule related definition Jiewen Yao
2016-10-26  2:01   ` Kinney, Michael D
2016-10-26  2:27     ` Yao, Jiewen
2016-10-26  3:00       ` Kinney, Michael D
2016-10-26  4:45         ` Yao, Jiewen
2016-10-26  4:58           ` Yao, Jiewen
2016-10-23  2:20 ` [PATCH V4 04/15] MdeModulePkg/FmpAuthenticationLibNull: Add NULL instance FMP Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 05/15] MdeModulePkg/DxeCapsuleLibNull: Add ProcessCapsules() interface Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 06/15] MdeModulePkg/DxeCapsuleLibFmp: Add DxeCapsuleLibFmp instance Jiewen Yao
2016-10-27  0:09   ` Kinney, Michael D
2016-10-27  1:33     ` Yao, Jiewen
2016-10-23  2:20 ` [PATCH V4 07/15] MdeModulePkg/Esrt: Add ESRT_FW_TYPE_SYSTEMFIRMWARE check Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 08/15] MdeModulePkg/CapsuleApp: Add CapsuleApp application Jiewen Yao
2016-10-25 23:26   ` Kinney, Michael D
2016-10-26  0:42     ` Yao, Jiewen
2016-10-26  1:50       ` Yao, Jiewen
2016-10-26  2:05       ` Kinney, Michael D
2016-10-26  2:19         ` Yao, Jiewen
2016-10-27  0:13   ` Kinney, Michael D
2016-10-23  2:20 ` [PATCH V4 09/15] MdeModulePkg/UiApp: Show test key warning info in FrontPage Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 10/15] MdeModulePkg/MdeModulePkg.dsc: Add FMP related component Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 11/15] IntelFrameworkModulePkg/DxeCapsuleLib: Add ProcessCapsules() interface Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 12/15] SecurityPkg/SecurityPkg.dec: Add PcdPkcs7CertBuffer PCD Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 13/15] SecurityPkg/FmpAuthenticationLibPkcs7: Add PKCS7 instance for FMP Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 14/15] SecurityPkg/FmpAuthenticationLibRsa2048Sha256: Add RSA2048 instance Jiewen Yao
2016-10-23  2:20 ` [PATCH V4 15/15] SecurityPkg/SecurityPkg.dsc: Add FmpAuthenticationLib* Jiewen Yao

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=74D8A39837DF1E4DA445A8C0B3885C50386B73CC@shsmsx102.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