Skip to content

Commit

Permalink
tls: get salt using crypto_info_salt in tls_enc_skb
Browse files Browse the repository at this point in the history
I skipped this conversion in my previous series.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sabrina Dubroca authored and David S. Miller committed Oct 13, 2023
1 parent 895359b commit 3bab3ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/tls/tls_device_fallback.c
Original file line number Diff line number Diff line change
@@ -340,10 +340,7 @@ static struct sk_buff *tls_enc_skb(struct tls_context *tls_ctx,

switch (tls_ctx->crypto_send.info.cipher_type) {
case TLS_CIPHER_AES_GCM_128:
salt = tls_ctx->crypto_send.aes_gcm_128.salt;
break;
case TLS_CIPHER_AES_GCM_256:
salt = tls_ctx->crypto_send.aes_gcm_256.salt;
break;
default:
goto free_req;
@@ -356,6 +353,7 @@ static struct sk_buff *tls_enc_skb(struct tls_context *tls_ctx,
goto free_req;

iv = buf;
salt = crypto_info_salt(&tls_ctx->crypto_send.info, cipher_desc);
memcpy(iv, salt, cipher_desc->salt);
aad = buf + cipher_desc->salt + cipher_desc->iv;
dummy_buf = aad + TLS_AAD_SPACE_SIZE;

0 comments on commit 3bab3ee

Please sign in to comment.