diff options
author | Dave Watson <davejwatson@fb.com> | 2018-03-22 13:10:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-23 12:25:53 -0400 |
commit | dbe425599ba05c7415f632e6f5f018453098eb69 (patch) | |
tree | 03d3502ccc58ba4e4adb8c3c16cd9dbfc70ea0c1 /net/tls/tls_main.c | |
parent | 69ca9293e8dd9323c6cde579e1855d6ce9489a46 (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.c | 8 |
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, |