From: Jay Zhou <jianjay.zhou@huawei.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, pbonzini@redhat.com, weidong.huang@huawei.com,
stefanha@redhat.com, jianjay.zhou@huawei.com,
pasic@linux.vnet.ibm.com, longpeng2@huawei.com,
xin.zeng@intel.com, roy.fan.zhang@intel.com,
arei.gonglei@huawei.com
Subject: [Qemu-devel] [PATCH v2 4/4] cryptodev-vhost-user: set the key length
Date: Sat, 30 Dec 2017 16:52:13 +0800 [thread overview]
Message-ID: <1514623933-25568-5-git-send-email-jianjay.zhou@huawei.com> (raw)
In-Reply-To: <1514623933-25568-1-git-send-email-jianjay.zhou@huawei.com>
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
backends/cryptodev-vhost-user.c | 4 ++++
include/sysemu/cryptodev-vhost-user.h | 3 +++
2 files changed, 7 insertions(+)
diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c
index 061c0e5..c7a9848 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -226,6 +226,10 @@ static void cryptodev_vhost_user_init(
1u << VIRTIO_CRYPTO_SERVICE_MAC;
backend->conf.cipher_algo_l = 1u << VIRTIO_CRYPTO_CIPHER_AES_CBC;
backend->conf.hash_algo = 1u << VIRTIO_CRYPTO_HASH_SHA1;
+
+ backend->conf.max_size = UINT64_MAX;
+ backend->conf.max_cipher_key_len = VHOST_USER_MAX_AUTH_KEY_LEN;
+ backend->conf.max_auth_key_len = VHOST_USER_MAX_AUTH_KEY_LEN;
}
static int64_t cryptodev_vhost_user_sym_create_session(
diff --git a/include/sysemu/cryptodev-vhost-user.h b/include/sysemu/cryptodev-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
+#define VHOST_USER_MAX_AUTH_KEY_LEN 512
+#define VHOST_USER_MAX_CIPHER_KEY_LEN 64
+
/**
* cryptodev_vhost_user_get_vhost:
--
1.8.3.1
prev parent reply other threads:[~2017-12-30 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-30 8:52 [Qemu-devel] [PATCH v2 0/4] cryptodev: add vhost support Jay Zhou
2017-12-30 8:52 ` [Qemu-devel] [PATCH v2 1/4] cryptodev: add vhost-user as a new cryptodev backend Jay Zhou
2017-12-30 8:52 ` [Qemu-devel] [PATCH v2 2/4] cryptodev: add vhost support Jay Zhou
2017-12-30 8:52 ` [Qemu-devel] [PATCH v2 3/4] cryptodev-vhost-user: add crypto session handler Jay Zhou
2018-01-16 4:24 ` Michael S. Tsirkin
2018-01-16 12:43 ` Zhoujian (jay)
2017-12-30 8:52 ` Jay Zhou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1514623933-25568-5-git-send-email-jianjay.zhou@huawei.com \
--to=jianjay.zhou@huawei.com \
--cc=arei.gonglei@huawei.com \
--cc=longpeng2@huawei.com \
--cc=mst@redhat.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=roy.fan.zhang@intel.com \
--cc=stefanha@redhat.com \
--cc=weidong.huang@huawei.com \
--cc=xin.zeng@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).