Skip to content

Commit

Permalink
Fix mozilla#14: Set WEP keys only if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre committed Jun 5, 2020
1 parent b220dac commit 1e8a0dd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dom/wifi/hal/SupplicantStaNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ Result_t SupplicantStaNetwork::SetConfiguration(
}

// wep key
std::array<std::string, max_wep_key_num> 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<std::string, max_wep_key_num> wepKeys = {
config.mWepKey0, config.mWepKey1, config.mWepKey2, config.mWepKey3};
stateCode = SetWepKey(wepKeys, aConfig.mWepTxKeyIndex);
if (stateCode != SupplicantStatusCode::SUCCESS) {
return ConvertStatusToResult(stateCode);
}
}

// proto
Expand Down

0 comments on commit 1e8a0dd

Please sign in to comment.