aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-08-24 20:59:44 (GMT)
committerJouni Malinen <j@w1.fi>2017-08-24 20:59:44 (GMT)
commitc2d4f2eb5dba0b5c5a8c5805823084da958a9b52 (patch)
tree6982b7f06bcb6712ab5528cd74345b22224e8e57 /src
parentbbb42bf091a69a554b374906c892a9581337a08d (diff)
downloadhostap-c2d4f2eb5dba0b5c5a8c5805823084da958a9b52.zip
hostap-c2d4f2eb5dba0b5c5a8c5805823084da958a9b52.tar.gz
hostap-c2d4f2eb5dba0b5c5a8c5805823084da958a9b52.tar.bz2
DPP: Derive PMKID using SHA256() for all curves
This was previously defined inconsistently (H() vs. SHA256()), but it is now clarified in the draft tech spec to use SHA256(), so update implementation to do that. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/dpp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/common/dpp.c b/src/common/dpp.c
index 5ef700b..33db676 100644
--- a/src/common/dpp.c
+++ b/src/common/dpp.c
@@ -4541,7 +4541,7 @@ static int dpp_derive_pmkid(const struct dpp_curve_params *curve,
int ret = -1, res;
const u8 *addr[2];
size_t len[2];
- u8 hash[DPP_MAX_HASH_LEN];
+ u8 hash[SHA256_MAC_LEN];
/* PMKID = Truncate-128(H(min(NK.x, PK.x) | max(NK.x, PK.x))) */
nkx = dpp_get_pubkey_point(own_key, 0);
@@ -4558,15 +4558,12 @@ static int dpp_derive_pmkid(const struct dpp_curve_params *curve,
addr[0] = wpabuf_head(pkx);
addr[1] = wpabuf_head(nkx);
}
- wpa_printf(MSG_DEBUG, "DPP: PMKID H=SHA%u",
- (unsigned int) curve->hash_len * 8);
wpa_hexdump(MSG_DEBUG, "DPP: PMKID hash payload 1", addr[0], len[0]);
wpa_hexdump(MSG_DEBUG, "DPP: PMKID hash payload 2", addr[1], len[1]);
- res = dpp_hash_vector(curve, 2, addr, len, hash);
+ res = sha256_vector(2, addr, len, hash);
if (res < 0)
goto fail;
- wpa_hexdump(MSG_DEBUG, "DPP: PMKID hash output",
- hash, curve->hash_len);
+ wpa_hexdump(MSG_DEBUG, "DPP: PMKID hash output", hash, SHA256_MAC_LEN);
os_memcpy(pmkid, hash, PMKID_LEN);
wpa_hexdump(MSG_DEBUG, "DPP: PMKID", pmkid, PMKID_LEN);
ret = 0;