Home | History | Annotate | Download | only in wifi

Lines Matching refs:passphrase

70 const char WiFiService::kStoragePassphrase[] = "Passphrase";
262 bool WiFiService::SetPassphrase(const string& passphrase, Error* error) {
264 ValidateWEPPassphrase(passphrase, error);
268 ValidateWPAPassphrase(passphrase, error);
274 LOG(ERROR) << "Passphrase could not be set: " << error->message();
278 return SetPassphraseInternal(passphrase, Service::kReasonPropertyUpdate);
282 const string& passphrase,
284 if (passphrase_ == passphrase) {
291 passphrase_ = passphrase;
381 string passphrase;
382 if (storage->GetCryptedString(id, kStoragePassphrase, &passphrase)) {
383 if (SetPassphraseInternal(passphrase, Service::kReasonCredentialsLoaded)) {
384 SLOG(this, 3) << "Loaded passphrase in WiFiService::Load.";
920 passphrase,
922 ParseWEPPassphrase(passphrase, nullptr, nullptr, error);
926 void WiFiService::ValidateWPAPassphrase(const std::string& passphrase,
928 unsigned int length = passphrase.length();
931 if (base::HexStringToBytes(passphrase, &passphrase_bytes)) {
946 void WiFiService::ParseWEPPassphrase(const string& passphrase,
950 unsigned int length = passphrase.length();
959 password_text = passphrase;
963 if (CheckWEPKeyIndex(passphrase, error)) {
964 base::StringToInt(passphrase.substr(0, 1), &key_index_local);
965 password_text = passphrase.substr(2);
970 if (CheckWEPIsHex(passphrase, error)) {
972 password_text = passphrase;
978 if (CheckWEPKeyIndex(passphrase, error) &&
979 CheckWEPIsHex(passphrase.substr(2), error)) {
980 base::StringToInt(passphrase.substr(0, 1), &key_index_local);
981 password_text = passphrase.substr(2);
983 } else if (CheckWEPPrefix(passphrase, error) &&
984 CheckWEPIsHex(passphrase.substr(2), error)) {
986 password_text = passphrase.substr(2);
992 if (CheckWEPKeyIndex(passphrase, error) &&
993 CheckWEPPrefix(passphrase.substr(2), error) &&
994 CheckWEPIsHex(passphrase.substr(4), error)) {
995 base::StringToInt(passphrase.substr(0, 1), &key_index_local);
996 password_text = passphrase.substr(4);
1020 bool WiFiService::CheckWEPIsHex(const string& passphrase, Error* error) {
1022 if (base::HexStringToBytes(passphrase, &passphrase_bytes)) {
1031 bool WiFiService::CheckWEPKeyIndex(const string& passphrase, Error* error) {
1033 if (base::StartsWith(passphrase, "0:", kCaseInsensitive) ||
1034 base::StartsWith(passphrase, "1:", kCaseInsensitive) ||
1035 base::StartsWith(passphrase, "2:", kCaseInsensitive) ||
1036 base::StartsWith(passphrase, "3:", kCaseInsensitive)) {
1045 bool WiFiService::CheckWEPPrefix(const string& passphrase, Error* error) {
1046 if (base::StartsWith(passphrase, "0x",