From nobody Mon Feb 9 06:34:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622619862; cv=none; d=zohomail.com; s=zohoarc; b=lxaHudySqupmGBQZaI7nvizYIGb2GKvYoUo9Lt1FaAuAQjndw9YR+0G5Uk3IJd384T1PJkqlGw1Q/uFXjUanK/hBlX8ReYuCW6QUlEdmfwsOB74sBBPzHRYrOYdnA+t5+1KgPiqH/33EY3I2AjbfNTcBcWTWqbnwKS4nVvXjNCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622619862; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h84uK3iOQ6O5Eu9OQNcEQUZOyQdeWGBEzjOdUzXmNQA=; b=SU7G7L7Lqn9H/EHoYYd4WUWqLcESRsQ6OtGNy4+rzPoZU72wlawzAokj+Qaiy+/bSSKJsZLh+bjSikAQGnMyhdnc9doI2tKXck1Swtgh9AZTHwMuwEj5sFpZ0Rug/aC/CpU+2Yq4VjAd99TvBjGl59wS4tkkhxaQvzgf+2IC/Ow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622619862577318.9460069802034; Wed, 2 Jun 2021 00:44:22 -0700 (PDT) Received: from localhost ([::1]:55756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loLY5-0002CT-Hl for importer@patchew.org; Wed, 02 Jun 2021 03:44:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loLQb-0000FA-8Q for qemu-devel@nongnu.org; Wed, 02 Jun 2021 03:36:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loLQS-0003p1-4y for qemu-devel@nongnu.org; Wed, 02 Jun 2021 03:36:35 -0400 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-419-Lr40raFFMvKtxfCz8n3IsA-1; Wed, 02 Jun 2021 03:36:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF70D8015F5; Wed, 2 Jun 2021 07:36:24 +0000 (UTC) Received: from thuth.com (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A7285C8A8; Wed, 2 Jun 2021 07:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622619387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h84uK3iOQ6O5Eu9OQNcEQUZOyQdeWGBEzjOdUzXmNQA=; b=PxS/BhgHDZ7DTrWHav14xMZirip2eciWwHdUwlthU7IHCzxPz9AdZQ2JUjj41Lz6wx4Z0y 00IZByyqkLeQvNCNhxTfl7trPs3RC8BbEbBUFhZ0NesWwjLGMOiQxahv1WLpda3gI8c0dl 5C4tyZdY9fQsJlrk2XGhTA+I8zoUZxU= X-MC-Unique: Lr40raFFMvKtxfCz8n3IsA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 08/17] crypto: bump min nettle to 3.4, dropping RHEL-7 support Date: Wed, 2 Jun 2021 09:35:57 +0200 Message-Id: <20210602073606.338994-9-thuth@redhat.com> In-Reply-To: <20210602073606.338994-1-thuth@redhat.com> References: <20210602073606.338994-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.371, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 It has been over two years since RHEL-8 was released, and thus per the platform build policy, we no longer need to support RHEL-7 as a build target. This lets us increment the minimum required nettle version and drop a lot of backwards compatibility code for 2.x series of nettle. Per repology, current shipping versions are: RHEL-8: 3.4.1 Debian Buster: 3.4.1 openSUSE Leap 15.2: 3.4.1 Ubuntu LTS 18.04: 3.4 Ubuntu LTS 20.04: 3.5.1 FreeBSD: 3.7.2 Fedora 33: 3.5.1 Fedora 34: 3.7.2 OpenBSD: 3.7.2 macOS HomeBrew: 3.7.2 Ubuntu LTS 18.04 has the oldest version and so 3.4 is the new minimum. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20210514120415.1368922-4-berrange@redhat.com> Reviewed-by: Thomas Huth Reviewed-by: Willian Rampazzo [thuth: rebased to use .gitlab-ci.d/buildtest.yml] Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 10 ---------- configure | 4 +--- crypto/cipher-nettle.c.inc | 31 ------------------------------- crypto/hash-nettle.c | 4 ---- crypto/hmac-nettle.c | 4 ---- 5 files changed, 1 insertion(+), 52 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 807040c1c7..a86c27fdbe 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -630,16 +630,6 @@ build-coroutine-sigaltstack: # # These jobs test old gcrypt and nettle from RHEL7 # which had some API differences. -crypto-old-nettle: - extends: .native_build_job_template - needs: - job: amd64-centos7-container - variables: - IMAGE: centos7 - TARGETS: x86_64-softmmu x86_64-linux-user - CONFIGURE_ARGS: --disable-gcrypt --enable-nettle - MAKE_CHECK_ARGS: check - crypto-old-gcrypt: extends: .native_build_job_template needs: diff --git a/configure b/configure index ae629a3127..fddda94c63 100755 --- a/configure +++ b/configure @@ -2871,10 +2871,9 @@ has_libgcrypt() { =20 if test "$nettle" !=3D "no"; then pass=3D"no" - if $pkg_config --exists "nettle >=3D 2.7.1"; then + if $pkg_config --exists "nettle >=3D 3.4"; then nettle_cflags=3D$($pkg_config --cflags nettle) nettle_libs=3D$($pkg_config --libs nettle) - nettle_version=3D$($pkg_config --modversion nettle) # Link test to make sure the given libraries work (e.g for static). write_c_skeleton if compile_prog "" "$nettle_libs" ; then @@ -5730,7 +5729,6 @@ if test "$gcrypt" =3D "yes" ; then fi if test "$nettle" =3D "yes" ; then echo "CONFIG_NETTLE=3Dy" >> $config_host_mak - echo "CONFIG_NETTLE_VERSION_MAJOR=3D${nettle_version%%.*}" >> $config_ho= st_mak echo "NETTLE_CFLAGS=3D$nettle_cflags" >> $config_host_mak echo "NETTLE_LIBS=3D$nettle_libs" >> $config_host_mak fi diff --git a/crypto/cipher-nettle.c.inc b/crypto/cipher-nettle.c.inc index cac771e4ff..490472656c 100644 --- a/crypto/cipher-nettle.c.inc +++ b/crypto/cipher-nettle.c.inc @@ -39,41 +39,10 @@ typedef void (*QCryptoCipherNettleFuncWrapper)(const vo= id *ctx, uint8_t *dst, const uint8_t *src); =20 -#if CONFIG_NETTLE_VERSION_MAJOR < 3 -typedef nettle_crypt_func * QCryptoCipherNettleFuncNative; -typedef void * cipher_ctx_t; -typedef unsigned cipher_length_t; -#define CONST_CTX - -#define cast5_set_key cast128_set_key - -#define aes128_ctx aes_ctx -#define aes192_ctx aes_ctx -#define aes256_ctx aes_ctx -#define aes128_set_encrypt_key(c, k) \ - aes_set_encrypt_key(c, 16, k) -#define aes192_set_encrypt_key(c, k) \ - aes_set_encrypt_key(c, 24, k) -#define aes256_set_encrypt_key(c, k) \ - aes_set_encrypt_key(c, 32, k) -#define aes128_set_decrypt_key(c, k) \ - aes_set_decrypt_key(c, 16, k) -#define aes192_set_decrypt_key(c, k) \ - aes_set_decrypt_key(c, 24, k) -#define aes256_set_decrypt_key(c, k) \ - aes_set_decrypt_key(c, 32, k) -#define aes128_encrypt aes_encrypt -#define aes192_encrypt aes_encrypt -#define aes256_encrypt aes_encrypt -#define aes128_decrypt aes_decrypt -#define aes192_decrypt aes_decrypt -#define aes256_decrypt aes_decrypt -#else typedef nettle_cipher_func * QCryptoCipherNettleFuncNative; typedef const void * cipher_ctx_t; typedef size_t cipher_length_t; #define CONST_CTX const -#endif =20 static inline bool qcrypto_length_check(size_t len, size_t blocksize, Error **errp) diff --git a/crypto/hash-nettle.c b/crypto/hash-nettle.c index 2a6ee7c7d5..5c8977fb80 100644 --- a/crypto/hash-nettle.c +++ b/crypto/hash-nettle.c @@ -26,11 +26,7 @@ #include #include =20 -#if CONFIG_NETTLE_VERSION_MAJOR < 3 -typedef unsigned int hash_length_t; -#else typedef size_t hash_length_t; -#endif =20 typedef void (*qcrypto_nettle_init)(void *ctx); typedef void (*qcrypto_nettle_write)(void *ctx, diff --git a/crypto/hmac-nettle.c b/crypto/hmac-nettle.c index 1152b741fd..da6b6fa014 100644 --- a/crypto/hmac-nettle.c +++ b/crypto/hmac-nettle.c @@ -18,11 +18,7 @@ #include "hmacpriv.h" #include =20 -#if CONFIG_NETTLE_VERSION_MAJOR < 3 -typedef unsigned int hmac_length_t; -#else typedef size_t hmac_length_t; -#endif =20 typedef void (*qcrypto_nettle_hmac_setkey)(void *ctx, hmac_length_t key_length, --=20 2.27.0