diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-06-03 15:17:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-04 14:33:50 -0700 |
commit | fb0f886fa265f265ad126fc7cd7e8ec51e2f770f (patch) | |
tree | 6d529355add3ad7deebf4b1cebe9dd559ee88d83 /include/net/tls.h | |
parent | f0aaa2c975617da78b80feebc87e74dba9ec1f53 (diff) | |
download | lwn-fb0f886fa265f265ad126fc7cd7e8ec51e2f770f.tar.gz lwn-fb0f886fa265f265ad126fc7cd7e8ec51e2f770f.zip |
net/tls: don't pass version to tls_advance_record_sn()
All callers pass prot->version as the last parameter
of tls_advance_record_sn(), yet tls_advance_record_sn()
itself needs a pointer to prot. Pass prot from callers.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index a463a6074e5d..0a0072636009 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -446,19 +446,15 @@ static inline struct tls_context *tls_get_ctx(const struct sock *sk) } static inline void tls_advance_record_sn(struct sock *sk, - struct cipher_context *ctx, - int version) + struct tls_prot_info *prot, + struct cipher_context *ctx) { - struct tls_context *tls_ctx = tls_get_ctx(sk); - struct tls_prot_info *prot = &tls_ctx->prot_info; - if (tls_bigint_increment(ctx->rec_seq, prot->rec_seq_size)) tls_err_abort(sk, EBADMSG); - if (version != TLS_1_3_VERSION) { + if (prot->version != TLS_1_3_VERSION) tls_bigint_increment(ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE, prot->iv_size); - } } static inline void tls_fill_prepend(struct tls_context *ctx, |