From nobody Wed Dec 17 04:18:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152638585061475.82570770205393; Tue, 15 May 2018 05:04:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73050424E0; Tue, 15 May 2018 12:04:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 342C530BE003; Tue, 15 May 2018 12:04:08 +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 DE86B14B1B; Tue, 15 May 2018 12:04:07 +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 w4FC3wwn024780 for ; Tue, 15 May 2018 08:03:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB96A2026DFD; Tue, 15 May 2018 12:03:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 684432024CAB for ; Tue, 15 May 2018 12:03:58 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 15 May 2018 14:03:50 +0200 Message-Id: <2da517511f1ab4683fd38e55572d43ada81aab9b.1526385621.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] Deprecate GNUTLS_GCRYPT 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 15 May 2018 12:04:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Now that we assume GnuTLS >=3D 3.0, we can ditch gcrypt support. Introduced by . Signed-off-by: J=C3=A1n Tomko --- config-post.h | 2 -- m4/virt-gnutls.m4 | 29 ------------------- src/libvirt.c | 83 ---------------------------------------------------= ---- 3 files changed, 114 deletions(-) diff --git a/config-post.h b/config-post.h index f7eba0d7ca..063e30fa37 100644 --- a/config-post.h +++ b/config-post.h @@ -36,7 +36,6 @@ # undef WITH_DEVMAPPER # undef WITH_DTRACE_PROBES # undef WITH_GNUTLS -# undef WITH_GNUTLS_GCRYPT # undef WITH_LIBSSH # undef WITH_MACVTAP # undef WITH_NUMACTL @@ -62,7 +61,6 @@ # undef WITH_DEVMAPPER # undef WITH_DTRACE_PROBES # undef WITH_GNUTLS -# undef WITH_GNUTLS_GCRYPT # undef WITH_LIBSSH # undef WITH_MACVTAP # undef WITH_NUMACTL diff --git a/m4/virt-gnutls.m4 b/m4/virt-gnutls.m4 index 13399ac766..35792c060f 100644 --- a/m4/virt-gnutls.m4 +++ b/m4/virt-gnutls.m4 @@ -29,35 +29,6 @@ AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[ dnl and also use nettle, because it's >=3D 3.0 =20 if test "$with_gnutls" =3D "yes" ; then - dnl Double probe: gnutls >=3D 2.12 had a configure option for gcrypt a= nd - dnl gnutls >=3D 3.0 uses only nettle. Our goal is to avoid gcrypt if = we - dnl can prove gnutls uses nettle, but it is a safe fallback to use gcr= ypt - dnl if we can't prove anything. - - GNUTLS_GCRYPT=3D - if $PKG_CONFIG --exists 'gnutls >=3D 3.0'; then - GNUTLS_GCRYPT=3D"no" - else - GNUTLS_GCRYPT=3D"probe" - fi - - if test "$GNUTLS_GCRYPT" =3D "probe"; then - case $($PKG_CONFIG --libs --static gnutls) in - *gcrypt*) GNUTLS_GCRYPT=3Dyes ;; - *nettle*) GNUTLS_GCRYPT=3Dno ;; - *) GNUTLS_GCRYPT=3Dunknown ;; - esac - fi - - if test "$GNUTLS_GCRYPT" =3D "yes" || test "$GNUTLS_GCRYPT" =3D "unkno= wn"; then - GNUTLS_LIBS=3D"$GNUTLS_LIBS -lgcrypt" - dnl We're not using gcrypt deprecated features so define - dnl GCRYPT_NO_DEPRECATED to avoid deprecated warnings - GNUTLS_CFLAGS=3D"$GNUTLS_CFLAGS -DGCRYPT_NO_DEPRECATED" - AC_DEFINE_UNQUOTED([WITH_GNUTLS_GCRYPT], 1, - [set to 1 if it is known or assumed that GNUTLS u= ses gcrypt]) - fi - OLD_CFLAGS=3D"$CFLAGS" OLD_LIBS=3D"$LIBS" CFLAGS=3D"$CFLAGS $GNUTLS_CFLAGS" diff --git a/src/libvirt.c b/src/libvirt.c index 0a81cbfb99..ffb002f4e1 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -54,9 +54,6 @@ #include "configmake.h" #include "virconf.h" #if WITH_GNUTLS -# if WITH_GNUTLS_GCRYPT -# include -# endif # include "rpc/virnettlscontext.h" #endif #include "vircommand.h" @@ -243,70 +240,6 @@ virWinsockInit(void) #endif =20 =20 -#ifdef WITH_GNUTLS_GCRYPT -static int -virTLSMutexInit(void **priv) -{ - virMutexPtr lock =3D NULL; - - if (VIR_ALLOC_QUIET(lock) < 0) - return ENOMEM; - - if (virMutexInit(lock) < 0) { - VIR_FREE(lock); - return errno; - } - - *priv =3D lock; - return 0; -} - - -static int -virTLSMutexDestroy(void **priv) -{ - virMutexPtr lock =3D *priv; - virMutexDestroy(lock); - VIR_FREE(lock); - return 0; -} - - -static int -virTLSMutexLock(void **priv) -{ - virMutexPtr lock =3D *priv; - virMutexLock(lock); - return 0; -} - - -static int -virTLSMutexUnlock(void **priv) -{ - virMutexPtr lock =3D *priv; - virMutexUnlock(lock); - return 0; -} - - -static struct gcry_thread_cbs virTLSThreadImpl =3D { - /* GCRY_THREAD_OPTION_VERSION was added in gcrypt 1.4.2 */ -# ifdef GCRY_THREAD_OPTION_VERSION - (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)), -# else - GCRY_THREAD_OPTION_PTHREAD, -# endif - NULL, - virTLSMutexInit, - virTLSMutexDestroy, - virTLSMutexLock, - virTLSMutexUnlock, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; -#endif /* WITH_GNUTLS_GCRYPT */ - - static bool virGlobalError; static virOnceControl virGlobalOnce =3D VIR_ONCE_CONTROL_INITIALIZER; =20 @@ -330,22 +263,6 @@ virGlobalInit(void) } #endif =20 -#ifdef WITH_GNUTLS_GCRYPT - /* - * This sequence of API calls it copied exactly from - * gnutls 2.12.23 source lib/gcrypt/init.c, with - * exception that GCRYCTL_ENABLE_QUICK_RANDOM, is - * dropped - */ - if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) =3D=3D 0) { - gcry_control(GCRYCTL_SET_THREAD_CBS, &virTLSThreadImpl); - gcry_check_version(NULL); - - gcry_control(GCRYCTL_DISABLE_SECMEM, NULL, 0); - gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0); - } -#endif - virLogSetFromEnv(); =20 #ifdef WITH_GNUTLS --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list