From nobody Tue May 14 22:31:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1621300797; cv=none; d=zohomail.com; s=zohoarc; b=IPtFAB+mt9FpYnm+Pla3aCw1zwSnSu3Giw/iThXMLqxhO8Q80ljT69c9ZCCUFK3SrwMiLLYXIMJkeirbaSBy0Ii5GiZwCsGiNLMVl9WybezmTU2Znnby/VNWXQXUl+0CSnS7aVgHhlMyiOh/ypJxrFIKJLPvZLCl3WfAf2bQoL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621300797; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=BvuZD5x3A8JzyapWLIZXOYRG/ZCNQNZGEFwH5sOpFUs=; b=ZMkfAAwNPJif96m6WN8oqqX2VJPNSDER+RSNHzLYJdd+PuxEZNIcaqbiz7vIYff/2JjUsLeeaaw56Y40s4duNq+Oe+pgWOL4aYUAmmAQlTFcyIH4RDKzeuAD+bDArD0h6E1JbFmMKU6W2t+D6pe2yIG7vyykvBaWhGpy5GS2yys= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1621300797646104.29258467903048; Mon, 17 May 2021 18:19:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-UmUTFaGONo-s0VCeoxdEgw-1; Mon, 17 May 2021 21:19:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA6D55B378; Tue, 18 May 2021 01:19:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E74C019C46; Tue, 18 May 2021 01:19:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B57C1180B463; Tue, 18 May 2021 01:19:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14I1JdrX015696 for ; Mon, 17 May 2021 21:19:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6091C200B672; Tue, 18 May 2021 01:19:39 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BDFA2084829 for ; Tue, 18 May 2021 01:19:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF2A880D180 for ; Tue, 18 May 2021 01:19:36 +0000 (UTC) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-mtwPJa3lM96XWMRE8iDWEg-1; Mon, 17 May 2021 21:19:34 -0400 Received: by mail-pf1-f174.google.com with SMTP id d16so6185852pfn.12 for ; Mon, 17 May 2021 18:19:34 -0700 (PDT) Received: from localhost ([103.138.53.28]) by smtp.gmail.com with ESMTPSA id y64sm10519579pfy.204.2021.05.17.18.19.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 18:19:32 -0700 (PDT) X-MC-Unique: UmUTFaGONo-s0VCeoxdEgw-1 X-MC-Unique: mtwPJa3lM96XWMRE8iDWEg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=BvuZD5x3A8JzyapWLIZXOYRG/ZCNQNZGEFwH5sOpFUs=; b=LwPYZ/Z4LHI+WylOEIvlK46FGiNT6kW2lUCLQOYfEzNr1/1gYI4pGbrZWtVWZepI6L knOFc0S0ePgdKj1GBHG8x/eH+EIePmpdHX0/qQbAbzp7/SQ3aH+B0BQFFL3LrTtHCxFu o9MJUCyrE1NEcXg3mxbRW3WeOVAPBvkzo5rvCmGmE/uD7cN1SnPedBocvrWN/cLUORA1 2ulI3GXftemEOICBizoE4LydI6R0HvPtXSj76Pj79EdMlxXsWD2kBPeb3TciBe+7uWi6 rQHTGu7IyUkClbrEE5U2qNFLNOc7g7DIrK6C0klAZ16t3bEjDV2BX2WcQEWGUfTyUZJu 55Lw== X-Gm-Message-State: AOAM5316zGPPLVKeyiOREVwf8n+qXkJkHio3dEQUrESolW+Amf+sR66/ h2WYOi2U9jPOhZuwEIkYhukYRYDvuKQZrDhjOPk= X-Google-Smtp-Source: ABdhPJxONtkJAvV4aEKBjm3OWAF+GDYAq7fYieWF2axkTZoKyg22HrzhDB9Sm9enoRMUXd8tCq8EGw== X-Received: by 2002:a65:62da:: with SMTP id m26mr2384164pgv.195.1621300773158; Mon, 17 May 2021 18:19:33 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH] tests: Replace deprecated ASN1 code Date: Tue, 18 May 2021 09:19:26 +0800 Message-Id: <20210518011926.82748-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This fixes compiler warnings when building with libtasn1 4.17.0. Signed-off-by: Luke Yue Reviewed-by: Michal Privoznik --- tests/pkix_asn1_tab.c | 2 +- tests/virnettlshelpers.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/pkix_asn1_tab.c b/tests/pkix_asn1_tab.c index 5d5ca3db5d..a28d5f20c3 100644 --- a/tests/pkix_asn1_tab.c +++ b/tests/pkix_asn1_tab.c @@ -5,7 +5,7 @@ #include #include =20 -const ASN1_ARRAY_TYPE pkix_asn1_tab[] =3D { +const asn1_static_node pkix_asn1_tab[] =3D { { "PKIX1", 536875024, NULL }, { NULL, 1073741836, NULL }, { "id-pkix", 1879048204, NULL }, diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c index ce38571b0a..905e633e60 100644 --- a/tests/virnettlshelpers.c +++ b/tests/virnettlshelpers.c @@ -37,8 +37,8 @@ VIR_LOG_INIT("tests.nettlshelpers"); * These store some static data that is needed when * encoding extensions in the x509 certs */ -ASN1_TYPE pkix_asn1; -extern const ASN1_ARRAY_TYPE pkix_asn1_tab[]; +asn1_node pkix_asn1; +extern const asn1_static_node pkix_asn1_tab[]; =20 /* * To avoid consuming random entropy to generate keys, @@ -107,7 +107,7 @@ void testTLSCleanup(const char *keyfile) /* * Turns an ASN1 object into a DER encoded byte array */ -static void testTLSDerEncode(ASN1_TYPE src, +static void testTLSDerEncode(asn1_node src, const char *src_name, gnutls_datum_t * res) { @@ -267,7 +267,7 @@ testTLSGenerateCert(struct testTLSCertReq *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", req->basicConstraintsIsCA ? "TRUE" : "= FALSE", 1); @@ -292,7 +292,7 @@ testTLSGenerateCert(struct testTLSCertReq *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; @@ -321,7 +321,7 @@ testTLSGenerateCert(struct testTLSCertReq *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) { --=20 2.31.1