aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-05-16 18:06:44 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-16 18:06:44 (GMT)
commit636a23881bafb18b28465793a03d058103138cd8 (patch)
tree3fe2c9a6f38273bac01c677d38aadeb12bcafc18 /src/wps
parent2c3d95c7e050b99bec303026369ebaafc5aab5f2 (diff)
downloadhostap-636a23881bafb18b28465793a03d058103138cd8.zip
hostap-636a23881bafb18b28465793a03d058103138cd8.tar.gz
hostap-636a23881bafb18b28465793a03d058103138cd8.tar.bz2
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>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps_attr_build.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wps/wps_attr_build.c b/src/wps/wps_attr_build.c
index 2efc27e..770f5e9 100644
--- a/src/wps/wps_attr_build.c
+++ b/src/wps/wps_attr_build.c
@@ -413,7 +413,8 @@ int wps_build_oob_dev_pw(struct wpabuf *msg, u16 dev_pw_id,
dev_pw_id);
addr[0] = wpabuf_head(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
if (wps_corrupt_pkhash) {
wpa_hexdump(MSG_DEBUG, "WPS: Real Public Key Hash",