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.129.124]) by mx.groups.io with SMTP id smtpd.web12.4669.1649416602677644268 for ; Fri, 08 Apr 2022 04:16:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RppkRoLa; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649416601; 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=IcW5eilLtXabNQYpryGcYyCyB+TQ9i/WsTY/MrveU1s=; b=RppkRoLa87iIAhOMK9AqLP4J8vSxTdy4fPM6+bc/epN04FDnlB1hG6bF/EwkQ5aiUDhCie polKSsBtTYMdWKWLcUc+WP3kRnLhcXZjtnWvRvkPMYVQewyl8yyUyl62aHHZ81SVXEAJ40 4+RSAJgAC5FaPdqgmNGfLz1vxXY5l+M= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-671-DxogCKRHMkKDZKxE7isNcA-1; Fri, 08 Apr 2022 07:16:37 -0400 X-MC-Unique: DxogCKRHMkKDZKxE7isNcA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D4261C0AEEC; Fri, 8 Apr 2022 11:16:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E0B8407DEC5; Fri, 8 Apr 2022 11:16:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D2E15180098D; Fri, 8 Apr 2022 13:16:22 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Jiewen Yao , Guomin Jiang , Jian J Wang , Xiaoyu Lu , Pawel Polawski , Gerd Hoffmann Subject: [PATCH v2 8/8] CryptoPkg/UnitTest: fix DH testcase Date: Fri, 8 Apr 2022 13:16:22 +0200 Message-Id: <20220408111622.3519517-9-kraxel@redhat.com> In-Reply-To: <20220408111622.3519517-1-kraxel@redhat.com> References: <20220408111622.3519517-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 --- 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