summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Watson <davejwatson@fb.com>2018-03-22 18:10:15 +0100
committerDavid S. Miller <davem@davemloft.net>2018-03-23 17:25:54 +0100
commitf4a8e43f1f0abc0e93ed5ee132288ee4142afde1 (patch)
tree8dcb9a6a772faf599d2445ce1d36bea6a06cc130 /include
parenttls: Move cipher info to a separate struct (diff)
downloadlinux-f4a8e43f1f0abc0e93ed5ee132288ee4142afde1.tar.xz
linux-f4a8e43f1f0abc0e93ed5ee132288ee4142afde1.zip
tls: Pass error code explicitly to tls_err_abort
Pass EBADMSG explicitly to tls_err_abort. Receive path will pass additional codes - EMSGSIZE if framing is larger than max TLS record size, EINVAL if TLS version mismatch. Signed-off-by: Dave Watson <davejwatson@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/tls.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/tls.h b/include/net/tls.h
index 019e52db1817..6b44875a78e5 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -174,9 +174,9 @@ static inline bool tls_is_pending_open_record(struct tls_context *tls_ctx)
return tls_ctx->pending_open_record_frags;
}
-static inline void tls_err_abort(struct sock *sk)
+static inline void tls_err_abort(struct sock *sk, int err)
{
- sk->sk_err = EBADMSG;
+ sk->sk_err = err;
sk->sk_error_report(sk);
}
@@ -197,7 +197,7 @@ static inline void tls_advance_record_sn(struct sock *sk,
struct cipher_context *ctx)
{
if (tls_bigint_increment(ctx->rec_seq, ctx->rec_seq_size))
- tls_err_abort(sk);
+ tls_err_abort(sk, EBADMSG);
tls_bigint_increment(ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE,
ctx->iv_size);
}