From nobody Wed Nov 5 05:04:16 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532450845962927.4144261592409; Tue, 24 Jul 2018 09:47:25 -0700 (PDT) Received: from localhost ([::1]:41535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fi0T6-0004GK-Vm for importer@patchew.org; Tue, 24 Jul 2018 12:47:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fi0Qg-0002y2-Cw for qemu-devel@nongnu.org; Tue, 24 Jul 2018 12:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fi0Qf-00040b-3R for qemu-devel@nongnu.org; Tue, 24 Jul 2018 12:44:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33936 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fi0Qe-00040N-UF for qemu-devel@nongnu.org; Tue, 24 Jul 2018 12:44:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76CE3401EF09; Tue, 24 Jul 2018 16:44:52 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB62F2156898; Tue, 24 Jul 2018 16:44:51 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 24 Jul 2018 17:44:45 +0100 Message-Id: <20180724164448.7606-2-berrange@redhat.com> In-Reply-To: <20180724164448.7606-1-berrange@redhat.com> References: <20180724164448.7606-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Jul 2018 16:44:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Jul 2018 16:44:52 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'berrange@redhat.com' RCPT:'' 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: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/4] tests: call qcrypto_init instead of gnutls_global_init 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-Type: text/plain; charset="utf-8" Calling qcrypto_init ensures that all relevant initialization is done. In particular this honours the debugging settings and thread settings. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrang=C3=A9 --- include/crypto/init.h | 2 ++ tests/crypto-tls-x509-helpers.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/crypto/init.h b/include/crypto/init.h index 04c1edf770..f79c02266b 100644 --- a/include/crypto/init.h +++ b/include/crypto/init.h @@ -21,6 +21,8 @@ #ifndef QCRYPTO_INIT_H #define QCRYPTO_INIT_H =20 +#include "qapi/error.h" + int qcrypto_init(Error **errp); =20 #endif /* QCRYPTO_INIT_H */ diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helper= s.c index 173d4e28fb..9b669c2a4b 100644 --- a/tests/crypto-tls-x509-helpers.c +++ b/tests/crypto-tls-x509-helpers.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" =20 #include "crypto-tls-x509-helpers.h" +#include "crypto/init.h" #include "qemu/sockets.h" =20 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT @@ -95,7 +96,7 @@ static gnutls_x509_privkey_t test_tls_load_key(void) =20 void test_tls_init(const char *keyfile) { - gnutls_global_init(); + qcrypto_init(&error_abort); =20 if (asn1_array2tree(pkix_asn1_tab, &pkix_asn1, NULL) !=3D ASN1_SUCCESS= ) { abort(); --=20 2.17.1