From nobody Fri Oct 24 22:00:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519923581484198.9372045319078; Thu, 1 Mar 2018 08:59:41 -0800 (PST) Received: from localhost ([::1]:58151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erRYS-0000jM-FT for importer@patchew.org; Thu, 01 Mar 2018 11:59:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erRLN-0006KK-A6 for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:46:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erRLM-00015N-BY for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:46:09 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57144 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erRLM-00014Q-2s for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:46:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82BC187ABA; Thu, 1 Mar 2018 16:46:07 +0000 (UTC) Received: from redhat.com (ovpn-123-220.rdu2.redhat.com [10.10.123.220]) by smtp.corp.redhat.com (Postfix) with SMTP id 5A7DD2026E04; Thu, 1 Mar 2018 16:46:07 +0000 (UTC) Date: Thu, 1 Mar 2018 18:46:07 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1519922735-29054-14-git-send-email-mst@redhat.com> References: <1519922735-29054-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1519922735-29054-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 01 Mar 2018 16:46:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 01 Mar 2018 16:46:07 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 13/13] cryptodev-vhost-user: set the key length X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Gonglei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gonglei Signed-off-by: Gonglei Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/sysemu/cryptodev-vhost-user.h | 3 +++ backends/cryptodev-vhost-user.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/sysemu/cryptodev-vhost-user.h b/include/sysemu/cryptod= ev-vhost-user.h index 937217b..6debf53 100644 --- a/include/sysemu/cryptodev-vhost-user.h +++ b/include/sysemu/cryptodev-vhost-user.h @@ -23,6 +23,9 @@ #ifndef CRYPTODEV_VHOST_USER_H #define CRYPTODEV_VHOST_USER_H =20 +#define VHOST_USER_MAX_AUTH_KEY_LEN 512 +#define VHOST_USER_MAX_CIPHER_KEY_LEN 64 + =20 /** * cryptodev_vhost_user_get_vhost: diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index 9cd06c4..862d4f2 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -224,6 +224,10 @@ static void cryptodev_vhost_user_init( 1u << VIRTIO_CRYPTO_SERVICE_MAC; backend->conf.cipher_algo_l =3D 1u << VIRTIO_CRYPTO_CIPHER_AES_CBC; backend->conf.hash_algo =3D 1u << VIRTIO_CRYPTO_HASH_SHA1; + + backend->conf.max_size =3D UINT64_MAX; + backend->conf.max_cipher_key_len =3D VHOST_USER_MAX_CIPHER_KEY_LEN; + backend->conf.max_auth_key_len =3D VHOST_USER_MAX_AUTH_KEY_LEN; } =20 static int64_t cryptodev_vhost_user_sym_create_session( --=20 MST