diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2017-12-01 06:42:07 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-12-01 06:42:07 +0000 |
commit | 67b21a86fe10b0bec33c85f408be68812914874e (patch) | |
tree | 10f758d97257127dc3741035c4ba99737ba09805 /libwifi_system | |
parent | 45574b17b4443c13f70c7c62b2bcb0c0ef2969d4 (diff) | |
parent | bef8d2a2c61ce80062556502cac4af5f13f479e4 (diff) | |
download | frameworks_opt_net_wifi-67b21a86fe10b0bec33c85f408be68812914874e.tar.gz frameworks_opt_net_wifi-67b21a86fe10b0bec33c85f408be68812914874e.tar.bz2 frameworks_opt_net_wifi-67b21a86fe10b0bec33c85f408be68812914874e.zip |
wifi_supplicant: deprecate entropy.bin
am: bef8d2a2c6
Change-Id: I95fc824d2e5b8040b69dd4772ac29611a6d2436a
Diffstat (limited to 'libwifi_system')
-rw-r--r-- | libwifi_system/hostapd_manager.cpp | 4 | ||||
-rw-r--r-- | libwifi_system/supplicant_manager.cpp | 48 |
2 files changed, 0 insertions, 52 deletions
diff --git a/libwifi_system/hostapd_manager.cpp b/libwifi_system/hostapd_manager.cpp index 658eecdd8..8c7de320b 100644 --- a/libwifi_system/hostapd_manager.cpp +++ b/libwifi_system/hostapd_manager.cpp @@ -78,10 +78,6 @@ string GeneratePsk(const vector<uint8_t>& ssid, } // namespace bool HostapdManager::StartHostapd() { - if (!SupplicantManager::EnsureEntropyFileExists()) { - LOG(WARNING) << "Wi-Fi entropy file was not created"; - } - if (property_set("ctl.start", kHostapdServiceName) != 0) { LOG(ERROR) << "Failed to start SoftAP"; return false; diff --git a/libwifi_system/supplicant_manager.cpp b/libwifi_system/supplicant_manager.cpp index 28010ec8d..be0c33a8a 100644 --- a/libwifi_system/supplicant_manager.cpp +++ b/libwifi_system/supplicant_manager.cpp @@ -40,12 +40,6 @@ const char kP2pConfigFile[] = "/data/misc/wifi/p2p_supplicant.conf"; const char kSupplicantServiceName[] = "wpa_supplicant"; constexpr mode_t kConfigFileMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; -const char kWiFiEntropyFile[] = "/data/misc/wifi/entropy.bin"; - -const unsigned char kDummyKey[21] = {0x02, 0x11, 0xbe, 0x33, 0x43, 0x35, 0x68, - 0x47, 0x84, 0x99, 0xa9, 0x2b, 0x1c, 0xd3, - 0xee, 0xff, 0xf1, 0xe2, 0xf3, 0xf4, 0xf5}; - int ensure_config_file_exists(const char* config_file) { char buf[2048]; int srcfd, destfd; @@ -152,10 +146,6 @@ bool SupplicantManager::StartSupplicant() { */ (void)ensure_config_file_exists(kP2pConfigFile); - if (!EnsureEntropyFileExists()) { - LOG(ERROR) << "Wi-Fi entropy file was not created"; - } - /* * Get a reference to the status property, so we can distinguish * the case where it goes stopped => running => stopped (i.e., @@ -225,43 +215,5 @@ bool SupplicantManager::IsSupplicantRunning() { return false; // Failed to read service status from init. } -bool SupplicantManager::EnsureEntropyFileExists() { - int ret; - int destfd; - - ret = access(kWiFiEntropyFile, R_OK | W_OK); - if ((ret == 0) || (errno == EACCES)) { - if ((ret != 0) && - (chmod(kWiFiEntropyFile, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) != 0)) { - PLOG(ERROR) << "Cannot set RW to " << kWiFiEntropyFile; - return false; - } - return true; - } - destfd = TEMP_FAILURE_RETRY(open(kWiFiEntropyFile, O_CREAT | O_RDWR, 0660)); - if (destfd < 0) { - PLOG(ERROR) << "Cannot create " << kWiFiEntropyFile; - return false; - } - - if (TEMP_FAILURE_RETRY(write(destfd, kDummyKey, sizeof(kDummyKey))) != - sizeof(kDummyKey)) { - PLOG(ERROR) << "Error writing " << kWiFiEntropyFile; - close(destfd); - return false; - } - close(destfd); - - /* chmod is needed because open() didn't set permisions properly */ - if (chmod(kWiFiEntropyFile, 0660) < 0) { - PLOG(ERROR) << "Error changing permissions of " << kWiFiEntropyFile - << " to 0600 "; - unlink(kWiFiEntropyFile); - return false; - } - - return true; -} - } // namespace wifi_system } // namespace android |