public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Li, Yi1" <yi1.li@intel.com>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	 "Hou, Wenxing" <wenxing.hou@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	 Pedro Falcato <pedro.falcato@gmail.com>
Subject: Re: [edk2-devel] CryptoPkg host test broken due to smoketest for RDRAND
Date: Fri, 14 Jun 2024 09:51:48 +0200	[thread overview]
Message-ID: <CAMj1kXEuw2jtqgDYrF7arZcQDS8O4AjavTSVEUZ9E23SoPQGhA@mail.gmail.com> (raw)
In-Reply-To: <SJ1PR11MB6227FEB6F483A522A30D062AC5C22@SJ1PR11MB6227.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

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 <yi1.li@intel.com> wrote:

> Yes, we can create a host test specific lib if no better ways.
>
>
>
> Regards,
>
> Yi
>
>
>
> *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@intel.com>; Pedro Falcato <pedro.falcato@gmail.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>
> *Subject:* RE: CryptoPkg host test broken due to smoketest for RDRAND
>
>
>
> Can we use a host test specific RngLib?
>
>
>
>
>
>
>
> *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>; Kinney, Michael D <michael.d.kinney@intel.com>;
> Pedro Falcato <pedro.falcato@gmail.com>; 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 called
> in host test, so ```mRdRandSupported``` is not enabled.
>
> Then the Crypto API calls ```GetRandomNumber*``` will fail.
>
> GetRandomNumber64 (
>
>   OUT     UINT64  *Rand
>
>   )
>
> {
>
>   ……
>
>   if (!ArchIsRngSupported ()) {
>
>     return FALSE;
>
>   }
>
>
>
> Is there a way to let unit test host to call the constructors correctly?
>
>
>
> Regards,
>
> Yi
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 7250 bytes --]

  reply	other threads:[~2024-06-14  7:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  7:07 [edk2-devel] CryptoPkg host test broken due to smoketest for RDRAND Li, Yi
2024-06-14  7:19 ` Yao, Jiewen
2024-06-14  7:24   ` Li, Yi
2024-06-14  7:51     ` Ard Biesheuvel [this message]
2024-06-14 14:20       ` Li, Yi
2024-06-14 10:41 ` Gerd Hoffmann
2024-06-14 13:32   ` Li, Yi
2024-06-14 16:09     ` Yao, Jiewen
2024-06-14 16:13       ` Ard Biesheuvel
2024-06-14 16:45         ` Yao, Jiewen
2024-06-14 17:16           ` Ard Biesheuvel
2024-06-15  4:54             ` Li, Yi
2024-06-15  4:57               ` Michael D Kinney
2024-06-15  5:18                 ` Li, Yi
2024-06-15  3:11           ` Li, Yi

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=CAMj1kXEuw2jtqgDYrF7arZcQDS8O4AjavTSVEUZ9E23SoPQGhA@mail.gmail.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