public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>,
	Pawel Polawski <ppolawsk@redhat.com>,
	Guomin Jiang <guomin.jiang@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH 8/8] CryptoPkg/UnitTest: fix DH testcase
Date: Mon, 17 Jan 2022 11:52:34 +0100	[thread overview]
Message-ID: <20220117105234.1981719-9-kraxel@redhat.com> (raw)
In-Reply-To: <20220117105234.1981719-1-kraxel@redhat.com>

openssl 3.0 wants at least 512 bytes, otherwise it throws an error:

error:0280007E:Diffie-Hellman routines::modulus too small

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
index 5cfe8d70535b..29e892a1514c 100644
--- a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
+++ b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c
@@ -53,7 +53,7 @@ TestVerifyDhGenerateKey (
   UNIT_TEST_CONTEXT  Context
   )
 {
-  UINT8    Prime[64];
+  UINT8    Prime[512];
   UINT8    PublicKey1[64];
   UINTN    PublicKey1Length;
   UINT8    PublicKey2[64];
@@ -72,10 +72,10 @@ TestVerifyDhGenerateKey (
   Key1Length       = sizeof (Key1);
   Key2Length       = sizeof (Key2);
 
-  Status = DhGenerateParameter (mDh1, 2, 64, Prime);
+  Status = DhGenerateParameter (mDh1, 2, sizeof (Prime), Prime);
   UT_ASSERT_TRUE (Status);
 
-  Status = DhSetParameter (mDh2, 2, 64, Prime);
+  Status = DhSetParameter (mDh2, 2, sizeof (Prime), Prime);
   UT_ASSERT_TRUE (Status);
 
   Status = DhGenerateKey (mDh1, PublicKey1, &PublicKey1Length);
-- 
2.34.1


      parent reply	other threads:[~2022-01-17 10:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 10:52 [PATCH 0/8] CryptoPkg updates for openssl 3.0 Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 1/8] CryptoPkg/CrtLibSupport: add fcntl.h Gerd Hoffmann
2022-01-17 11:07   ` Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 2/8] CryptoPkg/CrtLibSupport: add strstr() Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 3/8] CryptoPkg/CrtLibSupport: add INT_MIN Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 4/8] CryptoPkg/CrtLibSupport: add UINT_MAX Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 5/8] CryptoPkg/CrtLibSupport: add MODULESDIR Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 6/8] CryptoPkg/CrtLibSupport: add off_t Gerd Hoffmann
2022-01-17 10:52 ` [PATCH 7/8] CryptoPkg/CrtLibSupport: fix strcpy Gerd Hoffmann
2022-01-17 10:52 ` Gerd Hoffmann [this message]

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=20220117105234.1981719-9-kraxel@redhat.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