Skip to content

Commit

Permalink
cryptodev-vhost-user: set the key length
Browse files Browse the repository at this point in the history
Signed-off-by: Gonglei <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
  • Loading branch information
gongleiarei authored and mstsirkin committed Mar 1, 2018
1 parent efbfeb8 commit 0a9b9be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backends/cryptodev-vhost-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions include/sysemu/cryptodev-vhost-user.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0a9b9be

Please sign in to comment.