From e53bd179921692993adad0dbe98dac95fe51e94a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 23 May 2019 16:47:22 -0500 Subject: [PATCH] owe: Fix endianness issues Using mmpdu_associate_response structure members marked __le requires the relevant endianness conversion. --- src/owe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/owe.c b/src/owe.c index a8e66da2..daaf1f30 100644 --- a/src/owe.c +++ b/src/owe.c @@ -256,7 +256,8 @@ static int owe_rx_associate(struct auth_proto *ap, const uint8_t *frame, body = mmpdu_body(mpdu); - if (body->status_code == MMPDU_STATUS_CODE_UNSUPP_FINITE_CYCLIC_GROUP) { + if (L_LE16_TO_CPU(body->status_code) == + MMPDU_STATUS_CODE_UNSUPP_FINITE_CYCLIC_GROUP) { if (!owe_retry(owe)) goto owe_bad_status; @@ -326,7 +327,7 @@ invalid_ies: return MMPDU_STATUS_CODE_INVALID_ELEMENT; owe_bad_status: - return (int)body->status_code; + return L_LE16_TO_CPU(body->status_code); } struct auth_proto *owe_sm_new(struct handshake_state *hs,