Skip to content

Commit

Permalink
net/mlx5: Add const to the key pointer of encryption key creation
Browse files Browse the repository at this point in the history
Change key pointer to const void *, as there is no need to change the
key content. This is also to avoid modifying the key by mistake.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Jianbo Liu authored and Saeed Mahameed committed Jan 31, 2023
1 parent fe298bd commit 55f0d6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ int mlx5_ktls_create_key(struct mlx5_core_dev *mdev,
struct tls_crypto_info *crypto_info,
u32 *p_key_id)
{
const void *key;
u32 sz_bytes;
void *key;

switch (crypto_info->cipher_type) {
case TLS_CIPHER_AES_GCM_128: {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct mlx5_crypto_dek_priv {
};

int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes,
const void *key, u32 sz_bytes,
u32 key_type, u32 *p_key_id)
{
u32 in[MLX5_ST_SZ_DW(create_encryption_key_in)] = {};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum {
};

int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes,
const void *key, u32 sz_bytes,
u32 key_type, u32 *p_key_id);

void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
Expand Down

0 comments on commit 55f0d6d

Please sign in to comment.