cryptodev-vhost-user: set the key length
authorGonglei <arei.gonglei@huawei.com>
Thu, 1 Mar 2018 13:46:31 +0000 (21:46 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Mar 2018 16:26:17 +0000 (18:26 +0200)
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
backends/cryptodev-vhost-user.c
include/sysemu/cryptodev-vhost-user.h

index 9cd06c4b9e7d0ac032ef7e5688c84764df054f99..862d4f25801e193c2cb45275a313ff78c1e8a576 100644 (file)
@@ -224,6 +224,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_CIPHER_KEY_LEN;
+    backend->conf.max_auth_key_len = VHOST_USER_MAX_AUTH_KEY_LEN;
 }
 
 static int64_t cryptodev_vhost_user_sym_create_session(
index 937217bc32488125965eb34ddcfe8f8c9c42e958..6debf53fc53b58f5bfb2ce8e18b73f3581116297 100644 (file)
@@ -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: