summaryrefslogtreecommitdiff
path: root/net/handshake
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2023-09-21 09:08:07 -0400
committerJakub Kicinski <kuba@kernel.org>2023-10-02 12:34:21 -0700
commit160f404495aa9282cac99b518d1b379e31ef1bdd (patch)
tree8345d80ca281195662936c75ae1c85fabbc6ede0 /net/handshake
parenta6b07a51b161ba1ad3d81919955fe77b697f9d48 (diff)
handshake: Fix sign of key_serial_t fields
key_serial_t fields are signed integers. Use nla_get/put_s32 for those to avoid implicit signed conversion in the netlink protocol. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/169530167716.8905.645746457741372879.stgit@oracle-102.nfsv4bat.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/handshake')
-rw-r--r--net/handshake/tlshd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/handshake/tlshd.c b/net/handshake/tlshd.c
index 7ac80201aa1f..d697f68c598c 100644
--- a/net/handshake/tlshd.c
+++ b/net/handshake/tlshd.c
@@ -173,9 +173,9 @@ static int tls_handshake_put_certificate(struct sk_buff *msg,
if (!entry_attr)
return -EMSGSIZE;
- if (nla_put_u32(msg, HANDSHAKE_A_X509_CERT,
+ if (nla_put_s32(msg, HANDSHAKE_A_X509_CERT,
treq->th_certificate) ||
- nla_put_u32(msg, HANDSHAKE_A_X509_PRIVKEY,
+ nla_put_s32(msg, HANDSHAKE_A_X509_PRIVKEY,
treq->th_privkey)) {
nla_nest_cancel(msg, entry_attr);
return -EMSGSIZE;