From nobody Sun May 5 05:14:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504603963612157.6985961054653; Tue, 5 Sep 2017 02:32:43 -0700 (PDT) Received: from localhost ([::1]:57707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpADq-0001OM-Dn for importer@patchew.org; Tue, 05 Sep 2017 05:32:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpAAc-00076i-9z for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpAAX-0007Bi-38 for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpAAW-0007At-QN for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:17 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDE595F795; Tue, 5 Sep 2017 09:29:15 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6712A64B6; Tue, 5 Sep 2017 09:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DDE595F795 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=berrange@redhat.com From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 5 Sep 2017 10:29:09 +0100 Message-Id: <20170905092910.8946-2-berrange@redhat.com> In-Reply-To: <20170905092910.8946-1-berrange@redhat.com> References: <20170905092910.8946-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 05 Sep 2017 09:29:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v1 1/2] tests: fix incorrect size_t format in benchmark-crypto X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 $ make check-speed tests/benchmark-crypto-hash.c: In function 'test_hash_speed': tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument = of type 'long int', but argument 2 has type 'size_t' [-Werror=3Dformat=3D] g_print("Testing chunk_size %ld bytes ", chunk_size); ^ tests/benchmark-crypto-hash.c: In function 'main': tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument = of type 'long unsigned int', but argument 4 has type 'size_t' [-Werror=3Dfo= rmat=3D] snprintf(name, sizeof(name), "/crypto/hash/speed-%lu", i); ^ cc1: all warnings being treated as errors rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed make: *** [tests/benchmark-crypto-hash.o] Error 1 Reviewed-by: Longpeng(Mike) Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrange --- tests/benchmark-crypto-cipher.c | 4 ++-- tests/benchmark-crypto-hash.c | 4 ++-- tests/benchmark-crypto-hmac.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-ciphe= r.c index c6a40929e4..cf98443468 100644 --- a/tests/benchmark-crypto-cipher.c +++ b/tests/benchmark-crypto-cipher.c @@ -59,7 +59,7 @@ static void test_cipher_speed(const void *opaque) total /=3D 1024 * 1024; /* to MB */ =20 g_print("cbc(aes128): "); - g_print("Testing chunk_size %ld bytes ", chunk_size); + g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); g_print("%.2f MB/sec\n", total / g_test_timer_last()); =20 @@ -80,7 +80,7 @@ int main(int argc, char **argv) =20 for (i =3D 512; i <=3D (64 * 1204); i *=3D 2) { memset(name, 0 , sizeof(name)); - snprintf(name, sizeof(name), "/crypto/cipher/speed-%lu", i); + snprintf(name, sizeof(name), "/crypto/cipher/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_cipher_speed); } =20 diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c index 6769d2a11b..122bfb6b85 100644 --- a/tests/benchmark-crypto-hash.c +++ b/tests/benchmark-crypto-hash.c @@ -41,7 +41,7 @@ static void test_hash_speed(const void *opaque) =20 total /=3D 1024 * 1024; /* to MB */ g_print("sha256: "); - g_print("Testing chunk_size %ld bytes ", chunk_size); + g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); g_print("%.2f MB/sec\n", total / g_test_timer_last()); =20 @@ -59,7 +59,7 @@ int main(int argc, char **argv) =20 for (i =3D 512; i <=3D (64 * 1204); i *=3D 2) { memset(name, 0 , sizeof(name)); - snprintf(name, sizeof(name), "/crypto/hash/speed-%lu", i); + snprintf(name, sizeof(name), "/crypto/hash/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_hash_speed); } =20 diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c index 72408be987..c30250df3e 100644 --- a/tests/benchmark-crypto-hmac.c +++ b/tests/benchmark-crypto-hmac.c @@ -56,7 +56,7 @@ static void test_hmac_speed(const void *opaque) total /=3D 1024 * 1024; /* to MB */ =20 g_print("hmac(sha256): "); - g_print("Testing chunk_size %ld bytes ", chunk_size); + g_print("Testing chunk_size %zu bytes ", chunk_size); g_print("done: %.2f MB in %.2f secs: ", total, g_test_timer_last()); g_print("%.2f MB/sec\n", total / g_test_timer_last()); =20 @@ -74,7 +74,7 @@ int main(int argc, char **argv) =20 for (i =3D 512; i <=3D (64 * 1204); i *=3D 2) { memset(name, 0 , sizeof(name)); - snprintf(name, sizeof(name), "/crypto/hmac/speed-%lu", i); + snprintf(name, sizeof(name), "/crypto/hmac/speed-%zu", i); g_test_add_data_func(name, (void *)i, test_hmac_speed); } =20 --=20 2.13.5 From nobody Sun May 5 05:14:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15046041422981012.9101769299926; Tue, 5 Sep 2017 02:35:42 -0700 (PDT) Received: from localhost ([::1]:57725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpAGi-0003pT-SV for importer@patchew.org; Tue, 05 Sep 2017 05:35:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpAAc-00076t-K8 for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpAAY-0007CM-0h for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpAAX-0007Bw-RM for qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:29:17 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED8EFC0587DB; Tue, 5 Sep 2017 09:29:16 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A72B6F7F4; Tue, 5 Sep 2017 09:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ED8EFC0587DB Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=berrange@redhat.com From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 5 Sep 2017 10:29:10 +0100 Message-Id: <20170905092910.8946-3-berrange@redhat.com> In-Reply-To: <20170905092910.8946-1-berrange@redhat.com> References: <20170905092910.8946-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 05 Sep 2017 09:29:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v1 2/2] crypto: fix test cert generation to not use SHA1 algorithm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" GNUTLS 3.6.0 marked SHA1 as untrusted for certificates. Unfortunately the gnutls_x509_crt_sign() method we are using to create certificates in the test suite is fixed to always use SHA1. We must switch to a different method and explicitly ask for SHA256. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange --- tests/crypto-tls-x509-helpers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helper= s.c index 64073d3bd3..173d4e28fb 100644 --- a/tests/crypto-tls-x509-helpers.c +++ b/tests/crypto-tls-x509-helpers.c @@ -406,7 +406,8 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req, * If no 'ca' is set then we are self signing * the cert. This is done for the root CA certs */ - err =3D gnutls_x509_crt_sign(crt, ca ? ca : crt, privkey); + err =3D gnutls_x509_crt_sign2(crt, ca ? ca : crt, privkey, + GNUTLS_DIG_SHA256, 0); if (err < 0) { g_critical("Failed to sign certificate %s", gnutls_strerror(err)); --=20 2.13.5