mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-30 08:44:03 -05:00
WPS: Check sha256_vector() result in wps_build_oob_dev_pw()
This gets rid of a valgrind warning on uninitialized memory read in the wpas_ctrl_error test case where the result was used after the failed sha256_vector() call. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
2c3d95c7e0
commit
636a23881b
@ -413,7 +413,8 @@ int wps_build_oob_dev_pw(struct wpabuf *msg, u16 dev_pw_id,
|
|||||||
dev_pw_id);
|
dev_pw_id);
|
||||||
addr[0] = wpabuf_head(pubkey);
|
addr[0] = wpabuf_head(pubkey);
|
||||||
hash_len = wpabuf_len(pubkey);
|
hash_len = wpabuf_len(pubkey);
|
||||||
sha256_vector(1, addr, &hash_len, pubkey_hash);
|
if (sha256_vector(1, addr, &hash_len, pubkey_hash) < 0)
|
||||||
|
return -1;
|
||||||
#ifdef CONFIG_WPS_TESTING
|
#ifdef CONFIG_WPS_TESTING
|
||||||
if (wps_corrupt_pkhash) {
|
if (wps_corrupt_pkhash) {
|
||||||
wpa_hexdump(MSG_DEBUG, "WPS: Real Public Key Hash",
|
wpa_hexdump(MSG_DEBUG, "WPS: Real Public Key Hash",
|
||||||
|
Loading…
Reference in New Issue
Block a user