mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 09:39:25 +01:00
dpp,dpp-util: cast size_t for constant arguments to va_arg
There were a few places in dpp/dpp-util which passed a single byte but was being read in with va_arg(va, size_t). On some architectures this was causing failures presumably from the compiler using an integer type smaller than size_t. As we do elsewhere, cast to size_t to force the compiler to pass a properly sized iteger to va_arg.
This commit is contained in:
parent
df46776046
commit
19693f587f
@ -571,7 +571,8 @@ bool dpp_derive_r_auth(const void *i_nonce, const void *r_nonce,
|
||||
* R-auth = H(I-nonce | R-nonce | PI.x | PR.x | [ BI.x | ] BR.x | 0)
|
||||
*/
|
||||
return dpp_hash(type, r_auth, 6, i_nonce, nonce_len, r_nonce, nonce_len,
|
||||
pix, keys_len, prx, keys_len, brx, keys_len, &zero, 1);
|
||||
pix, keys_len, prx, keys_len, brx, keys_len,
|
||||
&zero, (size_t) 1);
|
||||
}
|
||||
|
||||
bool dpp_derive_i_auth(const void *r_nonce, const void *i_nonce,
|
||||
@ -596,7 +597,8 @@ bool dpp_derive_i_auth(const void *r_nonce, const void *i_nonce,
|
||||
* I-auth = H(R-nonce | I-nonce | PR.x | PI.x | BR.x | [ BI.x | ] 1)
|
||||
*/
|
||||
return dpp_hash(type, i_auth, 6, r_nonce, nonce_len, i_nonce, nonce_len,
|
||||
prx, keys_len, pix, keys_len, brx, keys_len, &one, 1);
|
||||
prx, keys_len, pix, keys_len, brx, keys_len,
|
||||
&one, (size_t) 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
10
src/dpp.c
10
src/dpp.c
@ -511,7 +511,7 @@ static void send_config_result(struct dpp_sm *dpp, const uint8_t *to)
|
||||
|
||||
ptr += dpp_append_wrapped_data(hdr + 26, 6, attrs, 0, ptr,
|
||||
sizeof(attrs), dpp->ke, dpp->key_len, 2,
|
||||
DPP_ATTR_STATUS, 1, &zero,
|
||||
DPP_ATTR_STATUS, (size_t) 1, &zero,
|
||||
DPP_ATTR_ENROLLEE_NONCE, dpp->nonce_len, dpp->e_nonce);
|
||||
|
||||
iov[1].iov_base = attrs;
|
||||
@ -1146,7 +1146,7 @@ static void send_authenticate_response(struct dpp_sm *dpp)
|
||||
ptr, sizeof(attrs), dpp->k2, dpp->key_len, 4,
|
||||
DPP_ATTR_RESPONDER_NONCE, dpp->nonce_len, dpp->r_nonce,
|
||||
DPP_ATTR_INITIATOR_NONCE, dpp->nonce_len, dpp->i_nonce,
|
||||
DPP_ATTR_RESPONDER_CAPABILITIES, 1, &dpp->role,
|
||||
DPP_ATTR_RESPONDER_CAPABILITIES, (size_t) 1, &dpp->role,
|
||||
DPP_ATTR_WRAPPED_DATA, wrapped2_len, wrapped2);
|
||||
|
||||
iov[1].iov_base = attrs;
|
||||
@ -1313,7 +1313,8 @@ static void dpp_auth_request_failed(struct dpp_sm *dpp,
|
||||
ptr += dpp_append_wrapped_data(hdr + 26, 6, attrs, ptr - attrs,
|
||||
ptr, sizeof(attrs) - (ptr - attrs), k1, dpp->key_len, 2,
|
||||
DPP_ATTR_INITIATOR_NONCE, dpp->nonce_len, dpp->i_nonce,
|
||||
DPP_ATTR_RESPONDER_CAPABILITIES, 1, &dpp->role);
|
||||
DPP_ATTR_RESPONDER_CAPABILITIES,
|
||||
(size_t) 1, &dpp->role);
|
||||
|
||||
iov[1].iov_base = attrs;
|
||||
iov[1].iov_len = ptr - attrs;
|
||||
@ -1404,7 +1405,8 @@ static bool dpp_send_authenticate_request(struct dpp_sm *dpp)
|
||||
ptr += dpp_append_wrapped_data(hdr + 26, 6, attrs, ptr - attrs,
|
||||
ptr, sizeof(attrs), dpp->k1, dpp->key_len, 2,
|
||||
DPP_ATTR_INITIATOR_NONCE, dpp->nonce_len, dpp->i_nonce,
|
||||
DPP_ATTR_INITIATOR_CAPABILITIES, 1, &dpp->role);
|
||||
DPP_ATTR_INITIATOR_CAPABILITIES,
|
||||
(size_t) 1, &dpp->role);
|
||||
|
||||
iov[1].iov_base = attrs;
|
||||
iov[1].iov_len = ptr - attrs;
|
||||
|
Loading…
Reference in New Issue
Block a user