From nobody Tue May 21 08:05:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1611854791; cv=none; d=zohomail.com; s=zohoarc; b=a9O13rNqWH/+D4n6Xipb9Ga+f7AGMY+KX92b1xEhYlJOkX5QEpeab99nd1oSoeEO4VfaLkfGxAdllVfZQxu9WFdbbx0gX4w2F+lW+O5pMvYoWkAfslDv3en1w8kcjkcSIEpKIdC4VaDq0RdkH6qf4cGYh2cmf09lRTdVyVKETck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611854791; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=QkcR23O0OMuqqyWNb5hl7S0+yJ1+pcl3/vQOp6y6xhc=; b=VV/D13DDlFp4gZTPm+tnL7yd8WNX2Pz+rsmCFssJzqkSNqlTpY5V8n6kmMrvF5BwNJnd8aD8h9Cg1va87nqbgqoAkhFWYcRgTuVXCicOU74CO1yeo66rJEmj9/ovg09ramhckrUtk/5XU2OmzhCXuhhV2X/bHFrxEwNHM3uJGtU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611854791427266.9007037301261; Thu, 28 Jan 2021 09:26:31 -0800 (PST) Received: from localhost ([::1]:55956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5B3u-00029o-3P for importer@patchew.org; Thu, 28 Jan 2021 12:26:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5Az7-0006My-Du for qemu-devel@nongnu.org; Thu, 28 Jan 2021 12:21:33 -0500 Received: from p5b1511bf.dip0.t-ipconnect.de ([91.21.17.191]:51064 helo=mini.fritz.box) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5Az4-0000Z0-Sz for qemu-devel@nongnu.org; Thu, 28 Jan 2021 12:21:33 -0500 Received: by mini.fritz.box (Postfix, from userid 502) id EFF8392CA8D; Thu, 28 Jan 2021 18:15:26 +0100 (CET) From: Stefan Weil To: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PATCH] tests: Replace deprecated ASN1 code Date: Thu, 28 Jan 2021 18:15:23 +0100 Message-Id: <20210128171523.45921-1-sw@weilnetz.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.21.17.191; envelope-from=stefan@mini.fritz.box; helo=mini.fritz.box X-Spam_score_int: 21 X-Spam_score: 2.1 X-Spam_bar: ++ X-Spam_report: (2.1 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, KHOP_HELO_FCRDNS=0.399, NO_DNS_FOR_FROM=0.001, RCVD_IN_PBL=3.335, RCVD_IN_SORBS_DUL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Weil , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This fixes several compiler warnings on MacOS with Homebrew. Signed-off-by: Stefan Weil --- tests/crypto-tls-x509-helpers.c | 10 +++++----- tests/crypto-tls-x509-helpers.h | 2 +- tests/pkix_asn1_tab.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helper= s.c index 01b3daf358..97658592a2 100644 --- a/tests/crypto-tls-x509-helpers.c +++ b/tests/crypto-tls-x509-helpers.c @@ -30,7 +30,7 @@ * This stores some static data that is needed when * encoding extensions in the x509 certs */ -ASN1_TYPE pkix_asn1; +asn1_node pkix_asn1; =20 /* * To avoid consuming random entropy to generate keys, @@ -139,7 +139,7 @@ void test_tls_cleanup(const char *keyfile) /* * Turns an ASN1 object into a DER encoded byte array */ -static void test_tls_der_encode(ASN1_TYPE src, +static void test_tls_der_encode(asn1_node src, const char *src_name, gnutls_datum_t *res) { @@ -317,7 +317,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req, * the 'critical' field which we want control over */ if (req->basicConstraintsEnable) { - ASN1_TYPE ext =3D ASN1_TYPE_EMPTY; + asn1_node ext =3D NULL; =20 asn1_create_element(pkix_asn1, "PKIX1.BasicConstraints", &ext); asn1_write_value(ext, "cA", @@ -344,7 +344,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req, * to be 'critical' */ if (req->keyUsageEnable) { - ASN1_TYPE ext =3D ASN1_TYPE_EMPTY; + asn1_node ext =3D NULL; char str[2]; =20 str[0] =3D req->keyUsageValue & 0xff; @@ -374,7 +374,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req, * set this the hard way building up ASN1 data ourselves */ if (req->keyPurposeEnable) { - ASN1_TYPE ext =3D ASN1_TYPE_EMPTY; + asn1_node ext =3D NULL; =20 asn1_create_element(pkix_asn1, "PKIX1.ExtKeyUsageSyntax", &ext); if (req->keyPurposeOID1) { diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helper= s.h index 08efba4e19..8fcd7785ab 100644 --- a/tests/crypto-tls-x509-helpers.h +++ b/tests/crypto-tls-x509-helpers.h @@ -125,7 +125,7 @@ void test_tls_cleanup(const char *keyfile); }; \ test_tls_generate_cert(&varname, NULL) =20 -extern const ASN1_ARRAY_TYPE pkix_asn1_tab[]; +extern const asn1_static_node pkix_asn1_tab[]; =20 #endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */ =20 diff --git a/tests/pkix_asn1_tab.c b/tests/pkix_asn1_tab.c index f15fc515cb..4aaf736d3f 100644 --- a/tests/pkix_asn1_tab.c +++ b/tests/pkix_asn1_tab.c @@ -8,7 +8,7 @@ =20 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT =20 -const ASN1_ARRAY_TYPE pkix_asn1_tab[] =3D { +const asn1_static_node pkix_asn1_tab[] =3D { {"PKIX1", 536875024, 0}, {0, 1073741836, 0}, {"id-ce", 1879048204, 0}, --=20 2.24.3 (Apple Git-128)