aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls/tls_main.c
diff options
context:
space:
mode:
authorDave Watson <davejwatson@fb.com>2018-03-22 13:10:06 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-23 12:25:53 -0400
commitdbe425599ba05c7415f632e6f5f018453098eb69 (patch)
tree03d3502ccc58ba4e4adb8c3c16cd9dbfc70ea0c1 /net/tls/tls_main.c
parent69ca9293e8dd9323c6cde579e1855d6ce9489a46 (diff)
tls: Move cipher info to a separate struct
Separate tx crypto parameters to a separate cipher_context struct. The same parameters will be used for rx using the same struct. tls_advance_record_sn is modified to only take the cipher info. Signed-off-by: Dave Watson <davejwatson@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r--net/tls/tls_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index d824d548447e..c671560b832b 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -259,8 +259,8 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
259 } 259 }
260 } 260 }
261 261
262 kfree(ctx->rec_seq); 262 kfree(ctx->tx.rec_seq);
263 kfree(ctx->iv); 263 kfree(ctx->tx.iv);
264 264
265 if (ctx->tx_conf == TLS_SW_TX) 265 if (ctx->tx_conf == TLS_SW_TX)
266 tls_sw_free_tx_resources(sk); 266 tls_sw_free_tx_resources(sk);
@@ -319,9 +319,9 @@ static int do_tls_getsockopt_tx(struct sock *sk, char __user *optval,
319 } 319 }
320 lock_sock(sk); 320 lock_sock(sk);
321 memcpy(crypto_info_aes_gcm_128->iv, 321 memcpy(crypto_info_aes_gcm_128->iv,
322 ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE, 322 ctx->tx.iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE,
323 TLS_CIPHER_AES_GCM_128_IV_SIZE); 323 TLS_CIPHER_AES_GCM_128_IV_SIZE);
324 memcpy(crypto_info_aes_gcm_128->rec_seq, ctx->rec_seq, 324 memcpy(crypto_info_aes_gcm_128->rec_seq, ctx->tx.rec_seq,
325 TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE); 325 TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE);
326 release_sock(sk); 326 release_sock(sk);
327 if (copy_to_user(optval, 327 if (copy_to_user(optval,