public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg
@ 2020-10-01 23:15 Sami Mujawar
  2020-10-02  8:19 ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Sami Mujawar @ 2020-10-01 23:15 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, thomas.abraham,
	Matteo.Carlini, Ben.Adderson, nd

The commit at "b5701a4c7a0f CryptoPkg: OpensslLib: Use RngLib to
generate entropy in rand_pool" updated CryptoPkg\OpenSSL to no
longer depend on TimerLib and instead use RngLib. This is done so
that platforms can choose the desired entropy source. However, this
change breaks the builds for platforms under Platform/ARM.

To fix this, update ArmVExpress.dsc.inc to use a TimerLib based
implementation of RngLib.

Note: The TimerLib based implementation of RngLib replicates past
behavior when used with OpenSSL. However, this should not be used
in production as a real source of entropy.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/1441_fix_platform_arm_build_break_v1

 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index bde3437b56d71be9259b18bc0501976695639c62..6f4621393a9713705e360a1c9ad019a6ad93a0a4 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2019, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2020, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -138,6 +138,7 @@ [LibraryClasses.common]
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg
  2020-10-01 23:15 [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg Sami Mujawar
@ 2020-10-02  8:19 ` Ard Biesheuvel
  2020-10-02 14:12   ` [edk2-devel] " Thomas Abraham
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2020-10-02  8:19 UTC (permalink / raw)
  To: Sami Mujawar, devel
  Cc: leif, thomas.abraham, Matteo.Carlini, Ben.Adderson, nd

On 10/2/20 1:15 AM, Sami Mujawar wrote:
> The commit at "b5701a4c7a0f CryptoPkg: OpensslLib: Use RngLib to
> generate entropy in rand_pool" updated CryptoPkg\OpenSSL to no
> longer depend on TimerLib and instead use RngLib. This is done so
> that platforms can choose the desired entropy source. However, this
> change breaks the builds for platforms under Platform/ARM.
> 
> To fix this, update ArmVExpress.dsc.inc to use a TimerLib based
> implementation of RngLib.
> 
> Note: The TimerLib based implementation of RngLib replicates past
> behavior when used with OpenSSL. However, this should not be used
> in production as a real source of entropy.
> 
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>


> ---
> 
> The changes can be seen at:
> https://github.com/samimujawar/edk2-platforms/tree/1441_fix_platform_arm_build_break_v1
> 
>   Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> index bde3437b56d71be9259b18bc0501976695639c62..6f4621393a9713705e360a1c9ad019a6ad93a0a4 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> @@ -1,5 +1,5 @@
>   #
> -#  Copyright (c) 2011-2019, ARM Limited. All rights reserved.
> +#  Copyright (c) 2011-2020, Arm Limited. All rights reserved.
>   #
>   #  SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
> @@ -138,6 +138,7 @@ [LibraryClasses.common]
>     BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
>     IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
>     OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
>     VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
>   
>     CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg
  2020-10-02  8:19 ` Ard Biesheuvel
@ 2020-10-02 14:12   ` Thomas Abraham
  2020-10-04 16:44     ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Abraham @ 2020-10-02 14:12 UTC (permalink / raw)
  To: devel, Ard Biesheuvel
  Cc: Sami Mujawar, Leif Lindholm, Matteo.Carlini, Ben.Adderson, nd

On Fri, Oct 2, 2020 at 1:49 PM Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
>
> On 10/2/20 1:15 AM, Sami Mujawar wrote:
> > The commit at "b5701a4c7a0f CryptoPkg: OpensslLib: Use RngLib to
> > generate entropy in rand_pool" updated CryptoPkg\OpenSSL to no
> > longer depend on TimerLib and instead use RngLib. This is done so
> > that platforms can choose the desired entropy source. However, this
> > change breaks the builds for platforms under Platform/ARM.
> >
> > To fix this, update ArmVExpress.dsc.inc to use a TimerLib based
> > implementation of RngLib.
> >
> > Note: The TimerLib based implementation of RngLib replicates past
> > behavior when used with OpenSSL. However, this should not be used
> > in production as a real source of entropy.
> >
> > Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>

Tested for SGI/RD platforms and it resolves the build issue.

Tested-by: Thomas Abraham <thomas.abraham@arm.com>

>
>
> > ---
> >
> > The changes can be seen at:
> > https://github.com/samimujawar/edk2-platforms/tree/1441_fix_platform_arm_build_break_v1
> >
> >   Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> > index bde3437b56d71be9259b18bc0501976695639c62..6f4621393a9713705e360a1c9ad019a6ad93a0a4 100644
> > --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> > +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> > @@ -1,5 +1,5 @@
> >   #
> > -#  Copyright (c) 2011-2019, ARM Limited. All rights reserved.
> > +#  Copyright (c) 2011-2020, Arm Limited. All rights reserved.
> >   #
> >   #  SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #
> > @@ -138,6 +138,7 @@ [LibraryClasses.common]
> >     BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> >     IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> >     OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> > +  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
> >     VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> >
> >     CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> >
>
>
>
> 
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg
  2020-10-02 14:12   ` [edk2-devel] " Thomas Abraham
@ 2020-10-04 16:44     ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2020-10-04 16:44 UTC (permalink / raw)
  To: Thomas Abraham, devel
  Cc: Sami Mujawar, Leif Lindholm, Matteo.Carlini, Ben.Adderson, nd

On 10/2/20 4:12 PM, Thomas Abraham wrote:
> On Fri, Oct 2, 2020 at 1:49 PM Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
>>
>> On 10/2/20 1:15 AM, Sami Mujawar wrote:
>>> The commit at "b5701a4c7a0f CryptoPkg: OpensslLib: Use RngLib to
>>> generate entropy in rand_pool" updated CryptoPkg\OpenSSL to no
>>> longer depend on TimerLib and instead use RngLib. This is done so
>>> that platforms can choose the desired entropy source. However, this
>>> change breaks the builds for platforms under Platform/ARM.
>>>
>>> To fix this, update ArmVExpress.dsc.inc to use a TimerLib based
>>> implementation of RngLib.
>>>
>>> Note: The TimerLib based implementation of RngLib replicates past
>>> behavior when used with OpenSSL. However, this should not be used
>>> in production as a real source of entropy.
>>>
>>> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
>>
>> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
> 
> Tested for SGI/RD platforms and it resolves the build issue.
> 
> Tested-by: Thomas Abraham <thomas.abraham@arm.com>
> 

Pushed as 96a98e4d3255..fc49849a8ebc

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-04 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-01 23:15 [PATCH edk2-platforms v1 1/1] Platform/ARM: TimerLib based RngLib for CryptoPkg Sami Mujawar
2020-10-02  8:19 ` Ard Biesheuvel
2020-10-02 14:12   ` [edk2-devel] " Thomas Abraham
2020-10-04 16:44     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox