[edk2-devel] [PATCH v4] CryptoPkg/Pkcs7: Extend support for other OID types

2020-04-25 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2539

Microsoft signtool supports creation of attached P7's with any OID payload
via the "/p7co" parameter. It is necessary to check the data before get
the string.

Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Signed-off-by: Guomin Jiang 
---
 .../BaseCryptLib/Pk/CryptPkcs7VerifyBase.c| 65 ++-
 1 file changed, 64 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c 
b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
index 313f459b11..70d9880897 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
@@ -13,6 +13,65 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 
+/**
+  Check the contents of PKCS7 is not data.
+
+  It is copied from PKCS7_type_is_other() in pk7_doit.c.
+
+  @param P7 Pointer to the location which the PKCS7 is located at.
+
+  @return UINT8 The content type.
+**/
+static
+UINT8
+Pkcs7TypeIsOther (
+  PKCS7 *P7
+  )
+{
+  UINT8 Others = 1;
+  UINT8 Nid = (UINT8) OBJ_obj2nid (P7->type);
+
+  switch (Nid) {
+case NID_pkcs7_data:
+case NID_pkcs7_signed:
+case NID_pkcs7_enveloped:
+case NID_pkcs7_signedAndEnveloped:
+case NID_pkcs7_encrypted:
+  Others = 0;
+  break;
+default:
+  Others = 1;
+  }
+
+  return Others;
+}
+
+/**
+  Get the ASN.1 string for the PKCS7.
+
+  It is copied from PKCS7_get_octet_string() in pk7_doit.c.
+  @param P7 Pointer to the location which the PKCS7 is located at.
+
+  @return ASN1_OCTET_STRING ASN.1 string.
+**/
+static
+ASN1_OCTET_STRING*
+Pkcs7GetOctetString (
+  PKCS7 *P7
+  )
+{
+  if (PKCS7_type_is_data (P7)) {
+return P7->d.data;
+  }
+
+  if ((Pkcs7TypeIsOther(P7) == 1) && P7->d.other &&
+  (P7->d.other->type == V_ASN1_OCTET_STRING)) {
+return P7->d.other->value.octet_string;
+  }
+
+  return NULL;
+}
+
 /**
   Extracts the attached content from a PKCS#7 signed data if existed. The 
input signed
   data could be wrapped in a ContentInfo structure.
@@ -98,7 +157,11 @@ Pkcs7GetAttachedContent (
 //
 // Retrieve the attached content in PKCS7 signedData
 //
-OctStr = Pkcs7->d.sign->contents->d.data;
+OctStr = Pkcs7GetOctetString (Pkcs7->d.sign->contents);
+if (OctStr == NULL) {
+  goto _Exit;
+}
+
 if ((OctStr->length > 0) && (OctStr->data != NULL)) {
   *ContentSize = OctStr->length;
   *Content = AllocatePool (*ContentSize);
-- 
2.25.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58137): https://edk2.groups.io/g/devel/message/58137
Mute This Topic: https://groups.io/mt/73277356/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device

2020-04-25 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Wu, Hao A
> Sent: Sunday, April 26, 2020 1:10 PM
> To: Jiang, Guomin; devel@edk2.groups.io
> Cc: Wang, Jian J; Ni, Ray
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the
> description table after Reset Device
> 
> > -Original Message-
> > From: Jiang, Guomin
> > Sent: Saturday, April 25, 2020 9:36 AM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> > Subject: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table
> > after Reset Device
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2694
> >
> > When the USB fail and then Reset Device, it should rebuild description.
> >
> > Signed-off-by: Guomin Jiang 
> > Cc: Jian J Wang 
> > Cc: Hao A Wu 
> > Cc: Ray Ni 
> > ---
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > index 4b4915c019..9f2d2cc87f 100644
> > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > @@ -869,6 +869,11 @@ UsbIoPortReset (
> >
> >
> >DEBUG (( EFI_D_INFO, "UsbIoPortReset: device is now ADDRESSED
> > at %d\n", Dev->Address));
> >
> >
> >
> > +  //
> >
> > +  // The description will be invalid after reset, should rebuild it as 
> > well.
> >
> > +  //
> >
> > +  UsbBuildDescTable (Dev);
> 
> 
> Hello Guomin,
> 
> Thanks for the proposed patch.
> 
> Could you help to explain in more detail for the above fix with regard to the
> transfer ring not being set properly in the XHCI driver? Thanks.
> 
> Also, judging from the function description comments in UsbBuildDescTable():
> |>  /**
> |>Build the whole array of descriptors. This function must
> |>be called after UsbGetMaxPacketSize0 returns the max packet
> |>size correctly for endpoint 0.
> |>  ...
> |>  **/
> |>  EFI_STATUS
> |>  UsbBuildDescTable (
> |>IN USB_DEVICE   *UsbDev
> |>)
> 
> Does function UsbGetMaxPacketSize0() need to be called before
> UsbBuildDescTable() in the proposed fix?


One more thing, could you help to add the information for what tests have been
done for the proposed patch as well?

Thanks in advance.


> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > +
> >
> >//
> >
> >// Reset the current active configure, after this device
> >
> >// is in CONFIGURED state.
> >
> > --
> > 2.25.1.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58136): https://edk2.groups.io/g/devel/message/58136
Mute This Topic: https://groups.io/mt/73255478/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device

2020-04-25 Thread Wu, Hao A
> -Original Message-
> From: Jiang, Guomin
> Sent: Saturday, April 25, 2020 9:36 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> Subject: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table
> after Reset Device
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2694
> 
> When the USB fail and then Reset Device, it should rebuild description.
> 
> Signed-off-by: Guomin Jiang 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> ---
>  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> index 4b4915c019..9f2d2cc87f 100644
> --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> @@ -869,6 +869,11 @@ UsbIoPortReset (
> 
> 
>DEBUG (( EFI_D_INFO, "UsbIoPortReset: device is now ADDRESSED
> at %d\n", Dev->Address));
> 
> 
> 
> +  //
> 
> +  // The description will be invalid after reset, should rebuild it as well.
> 
> +  //
> 
> +  UsbBuildDescTable (Dev);


Hello Guomin,

Thanks for the proposed patch.

Could you help to explain in more detail for the above fix with regard to the
transfer ring not being set properly in the XHCI driver? Thanks.

Also, judging from the function description comments in UsbBuildDescTable():
|>  /**
|>Build the whole array of descriptors. This function must
|>be called after UsbGetMaxPacketSize0 returns the max packet
|>size correctly for endpoint 0.
|>  ...
|>  **/
|>  EFI_STATUS
|>  UsbBuildDescTable (
|>IN USB_DEVICE   *UsbDev
|>)

Does function UsbGetMaxPacketSize0() need to be called before
UsbBuildDescTable() in the proposed fix?

Best Regards,
Hao Wu


> 
> +
> 
>//
> 
>// Reset the current active configure, after this device
> 
>// is in CONFIGURED state.
> 
> --
> 2.25.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58135): https://edk2.groups.io/g/devel/message/58135
Mute This Topic: https://groups.io/mt/73255478/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 0/2] UefiCpuPkg/MpInitLib: Fix ASSERT in AP procedure

2020-04-25 Thread Ni, Ray
Send to correct mail address: devel@edk2.groups.io

> -Original Message-
> From: Ni, Ray
> Sent: Sunday, April 26, 2020 11:46 AM
> To: Dong, Eric ; devel@edk2.groups.io
> Cc: Laszlo Ersek ; Kumar, Chandana C 
> 
> Subject: RE: [PATCH v3 0/2] UefiCpuPkg/MpInitLib: Fix ASSERT in AP procedure
> 
> Reviewed-by: Ray Ni 
> 
> > -Original Message-
> > From: Dong, Eric 
> > Sent: Friday, April 24, 2020 4:47 PM
> > To: devel@edk2.groups.io
> > Cc: Ni, Ray ; Laszlo Ersek ; Kumar,
> > Chandana C 
> > Subject: [PATCH v3 0/2] UefiCpuPkg/MpInitLib: Fix ASSERT in AP procedure
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2683
> >
> >
> >
> > This patch serial used to fix an ASSERT issue. Because AP can't find
> >
> > the CpuMpData through IDT, it raised the ASSERT.
> >
> >
> >
> > V3:
> >
> > 1. Remove invalid save Volatile Registers process. Refine restore
> >
> >Volatile Registers process.
> >
> >
> >
> > V2:
> >
> > 1. Enhance code comments.
> >
> > 2. Enhance code to remove CpuMpData->ApLoopMode == ApInHltLoop
> > check.
> >
> >
> >
> > Cc: Ray Ni 
> >
> > Cc: Laszlo Ersek 
> >
> > Cc: Chandana Kumar 
> >
> >
> >
> > Eric Dong (2):
> >   UefiCpuPkg/MpInitLib: Restore IDT context for APs.
> >   UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI.
> >
> >  UefiCpuPkg/Library/MpInitLib/MpLib.c | 47 
> >  1 file changed, 34 insertions(+), 13 deletions(-)
> >
> > --
> > 2.23.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58134): https://edk2.groups.io/g/devel/message/58134
Mute This Topic: https://groups.io/mt/73237633/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] FW: Discussion: Basetools a separate repo

2020-04-25 Thread Purma, Kondal R
> Can you please explain the effects of the "pip install -e in more detail?

"Pip install -e" basically editable mode feature, means it installs setuptools 
in development mode. We can install any prjects in editable mode and also 
supports local or  from git or svn supported mode.

Pip also supports pinned version numbers (which can protect bugs or 
incompatibilities) and Hash-checking mode. 

I think for long term we are moving right direction .

Thanks,
Kondal.
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Laszlo Ersek
Sent: Friday, April 24, 2020 2:28 AM
To: Matthew Carlson ; devel@edk2.groups.io
Subject: Re: [edk2-devel] FW: Discussion: Basetools a separate repo

On 04/22/20 21:30, macarl via [] wrote:
> I think you've got it. The version of basetools will be carried via a 
> pip-requirements file.
> 
> Where would "pip install -r pip-requirements.txt" *fetch* the required 
> basetools version from?
> I believe that it has a cache internal to pip. But if you want to fetch a 
> basetools that hasn't been fetched before, yes, it would require a network 
> download. Alternatively, if you're without internet access, you can check it 
> out locally and use the pip install -e.
> 
> Can you please explain the effects of the "pip install -e in more detail?
> So I'm a little murky on how it works but I believe that it creates symlinks 
> or some other mechanism to repoint the global python module (global meaning 
> your pip install or virtualenv). This is something that works automatically. 
> The setup.py in the root of the repo takes care of this since it's used also 
> to package the pip module. You can do pip install -e., and it just works 
> (tm). Any basetools commit you check out (once it is in it's own repo, going 
> back a given basetools commit two years ago is unfortunately not as easy) 
> will work with pip install -e with not setup or configuration on your part as 
> a developer. I use this whenever I work on the pytools and it works quite 
> well. It will also show up in the BuildToolsReport and pip freeze as being 
> locally installed and it will tell you the git commit it is currently at.
> 
> I agree- I think we're trending towards very very frequent releases for 
> basetools to provide high granularity. But that is pending community feedback 
> and the decision of the tools maintainer. It is certainly trivial to automate 
> the release pipeline in such a way that a release with every commit that 
> passes CI is easy and mostly automatic for the maintainers.

Thank you. All of the above sounds nice.

I'm carefully optimistic about these changes, and am not opposing them at this 
point. I hope I can find the time to test these features once they are being 
proposed in code form.

Regarding the frequent (automatic) release tagging for the separate basetools 
repo -- that too sounds great; I just think it will need manual work on the 
edk2 side, i.e. to keep "pip-requirements.txt"
bumped. While that work sounds quite "menial", I much hope that it can be 
integrated into the basetools development requirements -- "whenever you get 
something into basetools, and the system tags a new release automatically, be 
sure to post a patch to edk2 for advancing it to the new basetools release".

Thanks!
Laszlo





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58133): https://edk2.groups.io/g/devel/message/58133
Mute This Topic: https://groups.io/mt/73069134/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v1 3/9] MdeModulePkg: Define the VariablePolicyHelperLib

2020-04-25 Thread Guomin Jiang
Add comment inline.

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> Kubacki
> Sent: Saturday, April 11, 2020 2:38 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A ;
> Gao, Liming 
> Subject: [edk2-devel] [PATCH v1 3/9] MdeModulePkg: Define the
> VariablePolicyHelperLib
> 
> From: Bret Barkelew 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2522
> 
> VariablePolicy is an updated interface to replace VarLock and
> VarCheckProtocol.
> 
> Add the VariablePolicyHelperLib library, containing several functions to help
> with the repetitive process of creating a correctly structured and packed
> VariablePolicy entry.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Liming Gao 
> Signed-off-by: Bret Barkelew 
> Signed-off-by: Michael Kubacki 
> ---
>  MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> | 396 
>  MdeModulePkg/Include/Library/VariablePolicyHelperLib.h   | 
> 164
> 
>  MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
> |  36 ++
> MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.uni
> |  12 +
>  MdeModulePkg/MdeModulePkg.dec|   
> 5 +
>  MdeModulePkg/MdeModulePkg.dsc|   
> 2 +
>  6 files changed, 615 insertions(+)
> 
> diff --git
> a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
> new file mode 100644
> index ..7cf58b6cb31c
> --- /dev/null
> +++
> b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperL
> +++ ib.c
> @@ -0,0 +1,396 @@
> +/** @file -- VariablePolicyHelperLib.c
> +This library contains helper functions for marshalling and registering
> +new policies with the VariablePolicy infrastructure.
> +
> +This library is currently written against VariablePolicy revision 0x0001.
> +
> +Copyright (c) Microsoft Corporation.
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +/**
> +  This internal helper function populates the header structure,
> +  all common fields, and takes care of fix-ups.
> +
> +  NOTE: Only use this internally. Assumes correctly-sized buffers.
> +
> +  @param[out] EntPtr  Pointer to the buffer to be populated.
> +  @param[in]  Namespace   Pointer to an EFI_GUID for the target variable
> namespace that this policy will protect.
> +  @param[in]  MinSize MinSize for the VariablePolicy.
> +  @param[in]  MaxSize MaxSize for the VariablePolicy.
> +  @param[in]  AttributesMustHaveAttributesMustHave for the
> VariablePolicy.
> +  @param[in]  AttributesCantHaveAttributesCantHave for the
> VariablePolicy.
> +  @param[in]  LockPolicyTypeLockPolicyType for the VariablePolicy.
> +
> +**/
> +STATIC
> +VOID
> +PopulateCommonData (
> +  OUT VARIABLE_POLICY_ENTRY   *EntPtr,
> +  IN CONST  EFI_GUID  *Namespace,
> +  INUINT32MinSize,
> +  INUINT32MaxSize,
> +  INUINT32AttributesMustHave,
> +  INUINT32AttributesCantHave,
> +  INUINT8 LockPolicyType
> +  )
> +{
> +  EntPtr->Version = VARIABLE_POLICY_ENTRY_REVISION;
> +  CopyGuid( >Namespace, Namespace );
> +  EntPtr->MinSize = MinSize;
> +  EntPtr->MaxSize = MaxSize;
> +  EntPtr->AttributesMustHave  = AttributesMustHave;
> +  EntPtr->AttributesCantHave  = AttributesCantHave;
> +  EntPtr->LockPolicyType  = LockPolicyType;
> +
> +  // NOTE: As a heler, fix up MaxSize for compatibility with the old model.
> +  if (EntPtr->MaxSize == 0) {
> +EntPtr->MaxSize = VARIABLE_POLICY_NO_MAX_SIZE;  }
> +
> +  return;
> +}
> +
> +
> +/**
> +  This helper function will allocate and populate a new VariablePolicy
> +  structure for a policy that does not contain any sub-structures (such
> +as
> +  VARIABLE_LOCK_ON_VAR_STATE_POLICY).
> +
> +  NOTE: Caller will need to free structure once finished.
> +
> +  @param[in]  Namespace   Pointer to an EFI_GUID for the target variable
> namespace that this policy will protect.
> +  @param[in]  Name[Optional] If provided, a pointer to the CHAR16
> array for the target variable name.
> +  Otherwise, will create a policy that targets an 
> entire
> namespace.
> +  @param[in]  MinSize MinSize for the VariablePolicy.
> +  @param[in]  MaxSize MaxSize for the VariablePolicy.
> +  @param[in]  AttributesMustHaveAttributesMustHave for the
> VariablePolicy.
> +  @param[in]  AttributesCantHaveAttributesCantHave for the
> VariablePolicy.
> +  @param[in]  LockPolicyTypeLockPolicyType for the VariablePolicy.
> +  @param[out] NewEntryIf successful, will be set to a pointer to the
> allocated buffer containing the
> +  

[edk2-devel] Upcoming Event: TianoCore Design Meeting - APAC/NAMO - Fri, 05/01/2020 9:30am-10:30am #cal-reminder

2020-04-25 Thread devel@edk2.groups.io Calendar
*Reminder:* TianoCore Design Meeting - APAC/NAMO

*When:* Friday, 1 May 2020, 9:30am to 10:30am, (GMT+08:00) Asia/Chongqing

*Where:* https://zoom.us/j/299494771

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=783420 )

*Organizer:* Ray Ni ray...@intel.com ( 
ray...@intel.com?subject=Re:%20Event:%20TianoCore%20Design%20Meeting%20-%20APAC%2FNAMO
 )

*Description:*

For more info, see here: https://www.tianocore.org/design-meeting/

-
Join Zoom Meeting
-

https://zoom.us/j/299494771

Meeting ID: 299 494 771

One tap mobile

+16699009128,,299494771# US (San Jose)

+13462487799,,299494771# US (Houston)

Dial by your location

​ +1 669 900 9128 US (San Jose)

​ +1 346 248 7799 US (Houston)

​ +1 301 715 8592 US

​ +1 312 626 6799 US (Chicago)

​ +1 646 558 8656 US (New York)

​ +1 253 215 8782 US

Meeting ID: 299 494 771

Find your local number: https://zoom.us/u/ajd9Bs4kZ

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58131): https://edk2.groups.io/g/devel/message/58131
Mute This Topic: https://groups.io/mt/73274753/21656
Mute #cal-reminder: https://groups.io/mk?hashtag=cal-reminder=3846945
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] NetworkPkg/IScsiDxe: Enhance the check for array boundary

2020-04-25 Thread Siyuan, Fu
Reviewed-by: Siyuan Fu 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Zhang,
> Shenglei
> Sent: 2020年4月24日 17:14
> To: devel@edk2.groups.io
> Cc: Maciej Rabeda ; Wu, Jiaxin
> ; Fu, Siyuan 
> Subject: [edk2-devel] [PATCH] NetworkPkg/IScsiDxe: Enhance the check for
> array boundary
> 
> Array 'TargetUrl' of size 255 may use index value(s) 255 and 256.
> So enhance the boundary check to ensure the index is valid.
> 
> Cc: Maciej Rabeda 
> Cc: Jiaxin Wu 
> Cc: Siyuan Fu 
> Signed-off-by: Shenglei Zhang 
> ---
>  NetworkPkg/IScsiDxe/IScsiDhcp.c  | 2 +-
>  NetworkPkg/IScsiDxe/IScsiDhcp6.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> index 7ce9bf575012..afa8a86cd419 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> @@ -122,7 +122,7 @@ IScsiDhcpExtractRootPath (
>//
>if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) {
>  ConfigNvData->DnsMode = TRUE;
> -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) {
> +if ((Field->Len + 2) > sizeof (ConfigNvData->TargetUrl)) {
>return EFI_INVALID_PARAMETER;
>  }
>  CopyMem (>TargetUrl, Field->Str, Field->Len);
> diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> index 86a872adeccc..691650b7334f 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> @@ -161,7 +161,7 @@ IScsiDhcp6ExtractRootPath (
>// Server name is expressed as domain name, just save it.
>//
>if (ConfigNvData->DnsMode) {
> -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) {
> +if ((Field->Len + 2) > sizeof (ConfigNvData->TargetUrl)) {
>return EFI_INVALID_PARAMETER;
>  }
>  CopyMem (>TargetUrl, Field->Str, Field->Len);
> --
> 2.18.0.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58130): https://edk2.groups.io/g/devel/message/58130
Mute This Topic: https://groups.io/mt/73237833/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 7/7] CryptoPkg/Crypto.h: Update the version of Crypto Driver

2020-04-25 Thread Yao, Jiewen
Why not remove the deprecated functions ?

Thank you
Yao Jiewen

> -Original Message-
> From: Fu, Siyuan 
> Sent: Saturday, April 25, 2020 5:45 PM
> To: Gao, Zhichao ; devel@edk2.groups.io
> Cc: Wang, Jian J ; Lu, XiaoyuX ;
> Kinney, Michael D ; Yao, Jiewen
> ; Laszlo Ersek 
> Subject: RE: [PATCH V2 7/7] CryptoPkg/Crypto.h: Update the version of Crypto
> Driver
> 
> Hi, Zhichao
> 
> This patch set doesn't add or remove any field in EDK II Crypto Protocol, but 
> just
> change some API implementation to return false or unsupport, right? If so I
> don't think the Crypto Version need to be increased.
> 
> Best Regards
> Siyuan
> 
> > -Original Message-
> > From: Gao, Zhichao 
> > Sent: 2020年4月23日 16:46
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J ; Lu, XiaoyuX
> > ; Fu, Siyuan ; Kinney, Michael
> > D ; Yao, Jiewen ;
> > Laszlo Ersek 
> > Subject: [PATCH V2 7/7] CryptoPkg/Crypto.h: Update the version of Crypto
> > Driver
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1898
> >
> > Update the Crypto Version to 7:
> > 1. Retire below deprecated functions:
> > MD4, ARC4, TDES, AES ECB MODE, HMAC MD5, HMAC SHA1
> >
> > Cc: Jian J Wang 
> > Cc: Xiaoyu Lu 
> > Cc: Siyuan Fu 
> > Cc: Michael D Kinney 
> > Cc: Jiewen Yao 
> > Cc: Laszlo Ersek 
> > Signed-off-by: Zhichao Gao 
> > ---
> >  CryptoPkg/Private/Protocol/Crypto.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/CryptoPkg/Private/Protocol/Crypto.h
> > b/CryptoPkg/Private/Protocol/Crypto.h
> > index 40c387e002..667ca1ef07 100644
> > --- a/CryptoPkg/Private/Protocol/Crypto.h
> > +++ b/CryptoPkg/Private/Protocol/Crypto.h
> > @@ -20,7 +20,7 @@
> >  /// the EDK II Crypto Protocol is extended, this version define must be
> >  /// increased.
> >  ///
> > -#define EDKII_CRYPTO_VERSION 6
> > +#define EDKII_CRYPTO_VERSION 7
> >
> >  ///
> >  /// EDK II Crypto Protocol forward declaration
> > --
> > 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58129): https://edk2.groups.io/g/devel/message/58129
Mute This Topic: https://groups.io/mt/73214653/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v5 03/12] OvmfPkg/MptScsiDxe: Report name of driver

2020-04-25 Thread Nikita Leshenko



> On 24 Apr 2020, at 21:02, Carsey, Jaben  wrote:
> 
> I don't remember reviewing this previously (not recently at least), maybe the 
> RB should be CC?
The version that you reviewed was submitted more than a year ago, indeed
a long time ago: https://edk2.groups.io/g/devel/message/36232

> 
> One comment inline below.
> 
>> -Original Message-
>> From: devel@edk2.groups.io  On Behalf Of Nikita
>> Leshenko
>> Sent: Friday, April 24, 2020 10:59 AM
>> To: devel@edk2.groups.io
>> Cc: Nikita Leshenko ;
>> liran.a...@oracle.com; aaron.yo...@oracle.com; Justen, Jordan L
>> ; Laszlo Ersek ; Ard
>> Biesheuvel ; Carsey, Jaben
>> 
>> Subject: [edk2-devel] [PATCH v5 03/12] OvmfPkg/MptScsiDxe: Report name
>> of driver
>> 
>> [...]
>> +EFI_STATUS
>> +EFIAPI
>> +MptScsiGetDeviceName (
>> +  IN  EFI_COMPONENT_NAME_PROTOCOL *This,
>> +  IN  EFI_HANDLE  DeviceHandle,
>> +  IN  EFI_HANDLE  ChildHandle,
>> +  IN  CHAR8   *Language,
>> +  OUT CHAR16  **ControllerName
>> +  )
>> +{
>> +  return EFI_UNSUPPORTED;
>> +}
>> +
>> +STATIC
>> +EFI_COMPONENT_NAME_PROTOCOL mComponentName = {
>> +  ,
>> +  ,
>> +  "eng" // SupportedLanguages, ISO 639-2 language codes };
>> +
>> +STATIC
>> +EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = {
>> +  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)
>> ,
>> +  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)
>> ,
>> +  "en" // SupportedLanguages, RFC 4646 language codes };
> 
> I think that the }; needs to be outside of the comment for both of these 
> structures.
I don't know why your copy of the mail doesn't have a newline, but that wasn't
my intention. (And my copy of the mail seems to have it, strange...)

The patch looks like intended on the mailing list archive and of Github:
Here is this patch on the mailing list archive:
https://www.mail-archive.com/devel@edk2.groups.io/msg18861.html
And here is this patch on Github:
https://github.com/nikital/edk2/commit/41855cc48125321fce3323473379edcf098c3c01

Thanks,
Nikita


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58128): https://edk2.groups.io/g/devel/message/58128
Mute This Topic: https://groups.io/mt/73247263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 7/7] CryptoPkg/Crypto.h: Update the version of Crypto Driver

2020-04-25 Thread Siyuan, Fu
Hi, Zhichao

This patch set doesn't add or remove any field in EDK II Crypto Protocol, but 
just change some API implementation to return false or unsupport, right? If so 
I don't think the Crypto Version need to be increased.

Best Regards
Siyuan 

> -Original Message-
> From: Gao, Zhichao 
> Sent: 2020年4月23日 16:46
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Lu, XiaoyuX
> ; Fu, Siyuan ; Kinney, Michael
> D ; Yao, Jiewen ;
> Laszlo Ersek 
> Subject: [PATCH V2 7/7] CryptoPkg/Crypto.h: Update the version of Crypto
> Driver
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1898
> 
> Update the Crypto Version to 7:
> 1. Retire below deprecated functions:
> MD4, ARC4, TDES, AES ECB MODE, HMAC MD5, HMAC SHA1
> 
> Cc: Jian J Wang 
> Cc: Xiaoyu Lu 
> Cc: Siyuan Fu 
> Cc: Michael D Kinney 
> Cc: Jiewen Yao 
> Cc: Laszlo Ersek 
> Signed-off-by: Zhichao Gao 
> ---
>  CryptoPkg/Private/Protocol/Crypto.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Private/Protocol/Crypto.h
> b/CryptoPkg/Private/Protocol/Crypto.h
> index 40c387e002..667ca1ef07 100644
> --- a/CryptoPkg/Private/Protocol/Crypto.h
> +++ b/CryptoPkg/Private/Protocol/Crypto.h
> @@ -20,7 +20,7 @@
>  /// the EDK II Crypto Protocol is extended, this version define must be
>  /// increased.
>  ///
> -#define EDKII_CRYPTO_VERSION 6
> +#define EDKII_CRYPTO_VERSION 7
> 
>  ///
>  /// EDK II Crypto Protocol forward declaration
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58127): https://edk2.groups.io/g/devel/message/58127
Mute This Topic: https://groups.io/mt/73214653/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-