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.web08.27909.1649676323180334548 for ; Mon, 11 Apr 2022 04:25:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YTvzDg5e; 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=1649676322; 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=olIwKOx/+iVqL4aR7Ae/tDDfrCr4mBKHvE3R+xG2HsA=; b=YTvzDg5e1TNownvgy02X/1O7OamWiWa5IvIf6jI9FrNsjnKq6/1sbM8w9DbCZced9nWFMr xVFoofWIA7L3z7zwByRcNrHkXQP0ccemmk0dmOkHS8OKye1mea15QIJjzJQTzW2f7iMk1S xxx4Y6GKcK8KabpebhcW5sCDgckYtpo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-426-DZnWOSYgOHKHWNLlf3-Ulw-1; Mon, 11 Apr 2022 07:25:17 -0400 X-MC-Unique: DZnWOSYgOHKHWNLlf3-Ulw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2A8E786B8A5; Mon, 11 Apr 2022 11:25:17 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF57F40E80E6; Mon, 11 Apr 2022 11:25:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7FF731800915; Mon, 11 Apr 2022 13:24:57 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Pawel Polawski , Jian J Wang , Xiaoyu Lu , Jiewen Yao , Guomin Jiang , Gerd Hoffmann , Jiewen Yao Subject: [PATCH v3 8/8] CryptoPkg/UnitTest: fix DH testcase Date: Mon, 11 Apr 2022 13:24:57 +0200 Message-Id: <20220411112457.506101-9-kraxel@redhat.com> In-Reply-To: <20220411112457.506101-1-kraxel@redhat.com> References: <20220411112457.506101-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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"; x-default=true 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 Reviewed-by: Jiewen Yao --- 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.35.1