From nobody Tue Sep 9 19:11:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1752766272; cv=none; d=zohomail.com; s=zohoarc; b=FGKCdzK1YL45dvvbjDDS1ANwGqqIqU2+7RvL6mDUTaQ4bSysNVym03ukgzzPm3Y2sEcOniKmfBruksX53PyqG3HoSFdH5GIk7ytlr3hs8opVu4fOwwBj3aesFOVEZVFeAwQQULXO7d+1LUhRszfRcIxUxD8RORzuqSx2TQ4lF9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752766272; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=rjDH3SMB4I0jvOekt/QFMoJmxKjJpfyv6WUf5LTQTM8=; b=Pl3xejaXchH5Puy3Uq4t5H96FjwsdVGvQfrF/fTyb/i06QKxSpjVb5vdnYm2dbyez4ZIcgHI4NYGa4xHlmd3rCIjjWi6TJ3wxWeL8mU7KMoxqEoRjH4IkWWZyPw/1Birp4Nm91PFDGWu65YMYLClAh87C5N/2InOZWNtCKytUZM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 175276627211886.05366000602476; Thu, 17 Jul 2025 08:31:12 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 28E43121C; Thu, 17 Jul 2025 11:31:11 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A7DFB15C7; Thu, 17 Jul 2025 11:28:50 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3777A1490; Thu, 17 Jul 2025 11:28:46 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id F161B1490 for ; Thu, 17 Jul 2025 11:28:27 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-Q3oEaF2VOAO4YOjoweHegA-1; Thu, 17 Jul 2025 11:28:26 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF79218009BE for ; Thu, 17 Jul 2025 15:28:21 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 055DE1800359 for ; Thu, 17 Jul 2025 15:28:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752766107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16NMPYRHx7q+UfziqiLs6zsoY+k/CK7h4J7eGVdVjRk=; b=c1EWXTTF1QcxNRJO8HPWR+nXxBUrLygtCGulDT62iQDcNSLRD8ni9fmKi3u4WsHB1Hpk2u BdsRyK6ojSzTLWb9ncRBgMvSRpFvH5bysFrXJpZUWP84/ehZ6FYMruf2gnnoNCKJ8ToSbm OUEzG3zi2cCZiLyxTFhju/cI5Kidky4= X-MC-Unique: Q3oEaF2VOAO4YOjoweHegA-1 X-Mimecast-MFC-AGG-ID: Q3oEaF2VOAO4YOjoweHegA_1752766105 To: devel@lists.libvirt.org Subject: [PATCH 7/7] Remove unused 'virNetTLSCertLoadFromFile' Date: Thu, 17 Jul 2025 17:28:10 +0200 Message-ID: <436bca9e91ded9377dae6f5e5e18489fd4c3fef8.1752766013.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QtIyXKmejRJoScnqem_2LP0jMirRzc6pyKc_SZXbkfQ_1752766105 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SGIZSM2ZCQFXLW3AOWW3PGG4KICPE6T3 X-Message-ID-Hash: SGIZSM2ZCQFXLW3AOWW3PGG4KICPE6T3 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1752766273201116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa We now always load a list of certificates rather than only the first one so this function is not used any more. Signed-off-by: Peter Krempa --- src/rpc/virnettlscert.c | 41 ----------------------------------------- src/rpc/virnettlscert.h | 3 --- 2 files changed, 44 deletions(-) diff --git a/src/rpc/virnettlscert.c b/src/rpc/virnettlscert.c index 2724f55bbe..5e036a4f2b 100644 --- a/src/rpc/virnettlscert.c +++ b/src/rpc/virnettlscert.c @@ -367,47 +367,6 @@ static int virNetTLSCertCheckPair(gnutls_x509_crt_t ce= rt, } -gnutls_x509_crt_t virNetTLSCertLoadFromFile(const char *certFile, - bool isServer) -{ - gnutls_datum_t data; - gnutls_x509_crt_t cert =3D NULL; - g_autofree char *buf =3D NULL; - int ret =3D -1; - - VIR_DEBUG("isServer %d certFile %s", - isServer, certFile); - - if (gnutls_x509_crt_init(&cert) < 0) { - virReportError(VIR_ERR_SYSTEM_ERROR, "%s", - _("Unable to initialize certificate")); - goto cleanup; - } - - if (virFileReadAll(certFile, (1<<16), &buf) < 0) - goto cleanup; - - data.data =3D (unsigned char *)buf; - data.size =3D strlen(buf); - - if (gnutls_x509_crt_import(cert, &data, GNUTLS_X509_FMT_PEM) < 0) { - virReportError(VIR_ERR_SYSTEM_ERROR, isServer ? - _("Unable to import server certificate %1$s") : - _("Unable to import client certificate %1$s"), - certFile); - goto cleanup; - } - - ret =3D 0; - - cleanup: - if (ret !=3D 0) { - g_clear_pointer(&cert, gnutls_x509_crt_deinit); - } - return cert; -} - - int virNetTLSCertLoadListFromFile(const char *certFile, gnutls_x509_crt_t *certs, unsigned int certMax, diff --git a/src/rpc/virnettlscert.h b/src/rpc/virnettlscert.h index a2f591d172..aa0fe16a91 100644 --- a/src/rpc/virnettlscert.h +++ b/src/rpc/virnettlscert.h @@ -38,9 +38,6 @@ char *virNetTLSCertValidate(gnutls_x509_crt_t cert, const char *hostname, const char *const *x509dnACL); -gnutls_x509_crt_t virNetTLSCertLoadFromFile(const char *certFile, - bool isServer); - int virNetTLSCertLoadListFromFile(const char *certFile, gnutls_x509_crt_t *certs, unsigned int certMax, --=20 2.50.0