diff options
author | Ilya Lesokhin <ilyal@mellanox.com> | 2017-11-13 10:22:47 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-14 16:26:34 +0900 |
commit | 213ef6e7c9c063c482d77f12cc438872628d48ec (patch) | |
tree | feccd86cabb68644e4cdbf011c46ff0def88f9a7 /net | |
parent | ff45d820a2df163957ad8ab459b6eb6976144c18 (diff) | |
download | linux-213ef6e7c9c063c482d77f12cc438872628d48ec.tar.bz2 |
tls: Move tls_make_aad to header to allow sharing
move tls_make_aad as it is going to be reused
by the device offload code and rx path.
Remove unused recv parameter.
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/tls/tls_sw.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index fcd92a9c2d06..73d19210dd49 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -39,22 +39,6 @@ #include <net/tls.h> -static inline void tls_make_aad(int recv, - char *buf, - size_t size, - char *record_sequence, - int record_sequence_size, - unsigned char record_type) -{ - memcpy(buf, record_sequence, record_sequence_size); - - buf[8] = record_type; - buf[9] = TLS_1_2_VERSION_MAJOR; - buf[10] = TLS_1_2_VERSION_MINOR; - buf[11] = size >> 8; - buf[12] = size & 0xFF; -} - static void trim_sg(struct sock *sk, struct scatterlist *sg, int *sg_num_elem, unsigned int *sg_size, int target_size) { @@ -249,7 +233,7 @@ static int tls_push_record(struct sock *sk, int flags, sg_mark_end(ctx->sg_plaintext_data + ctx->sg_plaintext_num_elem - 1); sg_mark_end(ctx->sg_encrypted_data + ctx->sg_encrypted_num_elem - 1); - tls_make_aad(0, ctx->aad_space, ctx->sg_plaintext_size, + tls_make_aad(ctx->aad_space, ctx->sg_plaintext_size, tls_ctx->rec_seq, tls_ctx->rec_seq_size, record_type); |