From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.9781.1642416779907676467 for ; Mon, 17 Jan 2022 02:53:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KAprO14t; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642416779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDMTezCh74jRTInrxLOERvOw2O5mPiYX0nYl9UspjMg=; b=KAprO14taG+1CjxE/+EpgrluU5CwQ2hUBQh0xHuCZjgthBvHaCe56tD1HTzcpsP8dRl1LV vQp04BRPrNlrkI1mmAIV4a+wQjdjZhkXtRnYy4qkHyE+OOOd+xPX9Z4ERJAWRbGcdSZNFU +LNadWWy43e7VXplTOX1i0OkDetrcsU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-488-LzIyiMc3Mby67lzx1lNsEA-1; Mon, 17 Jan 2022 05:52:56 -0500 X-MC-Unique: LzIyiMc3Mby67lzx1lNsEA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E77E96408E; Mon, 17 Jan 2022 10:52:54 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D328B2378D; Mon, 17 Jan 2022 10:52:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 66FA21800791; Mon, 17 Jan 2022 11:52:34 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Xiaoyu Lu , Pawel Polawski , Guomin Jiang , Jiewen Yao , Jian J Wang , Gerd Hoffmann Subject: [PATCH 8/8] CryptoPkg/UnitTest: fix DH testcase Date: Mon, 17 Jan 2022 11:52:34 +0100 Message-Id: <20220117105234.1981719-9-kraxel@redhat.com> In-Reply-To: <20220117105234.1981719-1-kraxel@redhat.com> References: <20220117105234.1981719-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 --- 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