From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3CD82AC0D95 for ; Fri, 14 Jun 2024 07:52:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/RDbowdJVcyoJEzjlN0Zbj90FE8Tp4dzeYtrZBg0UOY=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1718351524; v=1; b=VQNLLXA3uzFRrKprq/v2jEZXzYEuf9RSGkGmh1MKM+CX2mbd8ql2pRoO3LKUMQ/+1qaJYdMT 8HvB9774pa4Snedlx90QpoyXz+YYkozHHjHVFMgokuVSegF7rbpAPqvHpmSSmWa+FSfzhwqbhQE i20qSFSJ3VfHaTV7l2RWcn05xbNsc78559V+UGgqFBExE9Rd5bd+PyclZcmxFt5/XZICvwxUcZO BeoXVoVpw/znVptS1LY5iXlm8yy1RSFEDhMiYYjy1U0yND3+4jCvuiPLTwF0oHV7NgB8JzdNpT1 9qFTNCeU8Ltn/5GwBbuhbpb/UwMQsHm8kA2is3I8MI++Q== X-Received: by 127.0.0.2 with SMTP id vOJpYY7687511xEbVXKhlOuW; Fri, 14 Jun 2024 00:52:02 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.6251.1718351522187176728 for ; Fri, 14 Jun 2024 00:52:02 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A11DA61E63 for ; Fri, 14 Jun 2024 07:52:01 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BAD3C2BD10 for ; Fri, 14 Jun 2024 07:52:01 +0000 (UTC) X-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52bc274f438so2262192e87.0 for ; Fri, 14 Jun 2024 00:52:01 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUUNt7tCWlTFhX4/2O9f+VM3kW41GJC102Sa8Mg6JpcwLusyCXBNV+3pEEoj/bz9XdlCjNfMfyc2G+zClaOEO1nueqiAw== X-Gm-Message-State: OX2BCwCJIJY29mWYY6mY7cD1x7686176AA= X-Google-Smtp-Source: AGHT+IFZDh13B6sJiRS9b54nmIqVLDmrj/5BNtQw7pgJY/Hf4QCb6iQwWb918DYCj6av/kwZ1imb7XaI8z21uNS1UmA= X-Received: by 2002:a05:6512:1055:b0:52c:8316:d0c9 with SMTP id 2adb3069b0e04-52ca6d1e31emr1579763e87.0.1718351519817; Fri, 14 Jun 2024 00:51:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ard Biesheuvel" Date: Fri, 14 Jun 2024 09:51:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] CryptoPkg host test broken due to smoketest for RDRAND To: "Li, Yi1" Cc: "Yao, Jiewen" , "devel@edk2.groups.io" , "Hou, Wenxing" , "Kinney, Michael D" , Pedro Falcato Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 14 Jun 2024 00:52:02 -0700 Resent-From: ardb@kernel.org Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: multipart/alternative; boundary="000000000000f0357c061ad4e376" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=VQNLLXA3; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --000000000000f0357c061ad4e376 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable For crypto unit tests, it is generally better to use a pseudo-random RNG, with a known (but not constant) seed, so that potential failures can be diagnosed more easily. E.g., the seed could be logged in the test output. On Fri, 14 Jun 2024 at 09:24, Li, Yi1 wrote: > Yes, we can create a host test specific lib if no better ways. > > > > Regards, > > Yi > > > > *From:* Yao, Jiewen > *Sent:* Friday, June 14, 2024 3:20 PM > *To:* Li, Yi1 ; devel@edk2.groups.io > *Cc:* Hou, Wenxing ; Kinney, Michael D < > michael.d.kinney@intel.com>; Pedro Falcato ; Ard > Biesheuvel > *Subject:* RE: CryptoPkg host test broken due to smoketest for RDRAND > > > > Can we use a host test specific RngLib? > > > > > > > > *From:* Li, Yi1 > *Sent:* Friday, June 14, 2024 3:08 PM > *To:* devel@edk2.groups.io > *Cc:* Hou, Wenxing ; Yao, Jiewen < > jiewen.yao@intel.com>; Kinney, Michael D ; > Pedro Falcato ; Ard Biesheuvel < > ardb+tianocore@kernel.org> > *Subject:* CryptoPkg host test broken due to smoketest for RDRAND > > > > All crypto host tests which consumed randlib broken due to: > > https://github.com/tianocore/edk2/pull/5714 > > Not sure why this issue not reported by CI when merge this PR. > > > > The reason is that the ```BaseRngLibConstructor``` of rnglib is not calle= d > in host test, so ```mRdRandSupported``` is not enabled. > > Then the Crypto API calls ```GetRandomNumber*``` will fail. > > GetRandomNumber64 ( > > OUT UINT64 *Rand > > ) > > { > > =E2=80=A6=E2=80=A6 > > if (!ArchIsRngSupported ()) { > > return FALSE; > > } > > > > Is there a way to let unit test host to call the constructors correctly? > > > > Regards, > > Yi > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119570): https://edk2.groups.io/g/devel/message/119570 Mute This Topic: https://groups.io/mt/106666288/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --000000000000f0357c061ad4e376 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
For crypto unit tests, it is generally better to use = a pseudo-random RNG, with a known (but not constant) seed, so that potentia= l failures can be diagnosed more easily. E.g., the seed could be logged in = the test output.


On Fri, 14 Jun 2024 at 09:24, Li, Yi1 <yi1.li@intel.com> wrote:
=

Yes, we can create a = host test specific lib if no better ways.

=C2=A0<= /span>

Regards,

Yi

=C2=A0<= /span>

From: Yao, Jiewen <jiewen.yao@intel.com>
Sent: Friday, June 14, 2024 3:20 PM
To: Li, Yi1 <yi1.li@intel.com>; devel@edk2.groups.io
Cc: Hou, Wenxing <wenxing.hou@intel.com>; Kinney, Michael D <michael.d.kinney@inte= l.com>; Pedro Falcato <pedro.falcato@gmail.com>; Ard Biesheuvel <ardb+tianocore= @kernel.org>
Subject: RE: CryptoPkg host test broken due to smoketest for RDRAND<= u>

=C2=A0

Can we use a host tes= t specific RngLib?

=C2=A0<= /span>

=C2=A0<= /span>

=C2=A0<= /span>

From: Li, Yi1 <yi1.li@intel.com>
Sent: Friday, June 14, 2024 3:08 PM
To: devel@= edk2.groups.io
Cc: Hou, Wenxing <wenxing.hou@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Kin= ney, Michael D <michael.d.kinney@intel.com>; Pedro Falcato <pedro.falcato@gmail.com>; Ard Biesheuvel <ardb+tianocore@kernel.org&= gt;
Subject: CryptoPkg host test broken due to smoketest for RDRAND

=C2=A0

All crypto host tests= which consumed randlib broken due to:

https://github.com/tia= nocore/edk2/pull/5714

Not sure why this iss= ue not reported =C2=A0by CI when merge this PR.

=C2=A0<= /span>

The reason is that th= e ```BaseRngLibConstructor``` of rnglib is not called in host test, so ```m= RdRandSupported``` is not enabled.

Then the Crypto API c= alls ```GetRandomNumber*``` will fail.

GetRandomNumber64 (

=C2=A0 OUT=C2=A0=C2= =A0=C2=A0=C2=A0 UINT64=C2=A0 *Rand

=C2=A0 )

{

=C2=A0 =E2=80=A6=E2= =80=A6

=C2=A0 if (!ArchIsRng= Supported ()) {

=C2=A0=C2=A0=C2=A0 re= turn FALSE;

=C2=A0 }

=C2=A0<= /span>

Is there a way to let= unit test host to call the constructors correctly?

=C2=A0<= /span>

Regards,

Yi

=C2=A0

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#119570) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--000000000000f0357c061ad4e376--