From 1e8a0dd470f1fcf5f4f10251d59bf65000cc6d32 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 5 Jun 2020 23:50:32 +0200 Subject: [PATCH] Fix #14: Set WEP keys only if provided --- dom/wifi/hal/SupplicantStaNetwork.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dom/wifi/hal/SupplicantStaNetwork.cpp b/dom/wifi/hal/SupplicantStaNetwork.cpp index fbfb51b02b5ed..d0a1602072f59 100644 --- a/dom/wifi/hal/SupplicantStaNetwork.cpp +++ b/dom/wifi/hal/SupplicantStaNetwork.cpp @@ -115,11 +115,13 @@ Result_t SupplicantStaNetwork::SetConfiguration( } // wep key - std::array wepKeys = { - config.mWepKey0, config.mWepKey1, config.mWepKey2, config.mWepKey3}; - stateCode = SetWepKey(wepKeys, aConfig.mWepTxKeyIndex); - if (stateCode != SupplicantStatusCode::SUCCESS) { - return ConvertStatusToResult(stateCode); + if (!config.mWepKey0.empty()) { + std::array wepKeys = { + config.mWepKey0, config.mWepKey1, config.mWepKey2, config.mWepKey3}; + stateCode = SetWepKey(wepKeys, aConfig.mWepTxKeyIndex); + if (stateCode != SupplicantStatusCode::SUCCESS) { + return ConvertStatusToResult(stateCode); + } } // proto