Commit 160f4044 authored by Chuck Lever's avatar Chuck Lever Committed by Jakub Kicinski

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: default avatarChuck Lever <chuck.lever@oracle.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/169530167716.8905.645746457741372879.stgit@oracle-102.nfsv4bat.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a6b07a51
...@@ -34,10 +34,10 @@ attribute-sets: ...@@ -34,10 +34,10 @@ attribute-sets:
attributes: attributes:
- -
name: cert name: cert
type: u32 type: s32
- -
name: privkey name: privkey
type: u32 type: s32
- -
name: accept name: accept
attributes: attributes:
......
...@@ -173,9 +173,9 @@ static int tls_handshake_put_certificate(struct sk_buff *msg, ...@@ -173,9 +173,9 @@ static int tls_handshake_put_certificate(struct sk_buff *msg,
if (!entry_attr) if (!entry_attr)
return -EMSGSIZE; return -EMSGSIZE;
if (nla_put_u32(msg, HANDSHAKE_A_X509_CERT, if (nla_put_s32(msg, HANDSHAKE_A_X509_CERT,
treq->th_certificate) || treq->th_certificate) ||
nla_put_u32(msg, HANDSHAKE_A_X509_PRIVKEY, nla_put_s32(msg, HANDSHAKE_A_X509_PRIVKEY,
treq->th_privkey)) { treq->th_privkey)) {
nla_nest_cancel(msg, entry_attr); nla_nest_cancel(msg, entry_attr);
return -EMSGSIZE; return -EMSGSIZE;
......
...@@ -28,8 +28,8 @@ struct handshake_x509 { ...@@ -28,8 +28,8 @@ struct handshake_x509 {
__u32 privkey:1; __u32 privkey:1;
} _present; } _present;
__u32 cert; __s32 cert;
__u32 privkey; __s32 privkey;
}; };
/* ============== HANDSHAKE_CMD_ACCEPT ============== */ /* ============== HANDSHAKE_CMD_ACCEPT ============== */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment