diff --git a/wpa_supplicant/hidl/sta_network.cpp b/wpa_supplicant/hidl/sta_network.cpp
index 3d92973..b58d85b 100644
--- a/wpa_supplicant/hidl/sta_network.cpp
+++ b/wpa_supplicant/hidl/sta_network.cpp
@@ -58,7 +58,7 @@
     static_cast<uint32_t>(ISupplicantStaNetwork::EapPhase2Method::AKA_PRIME) +
     1;
 constexpr char const *kEapPhase2MethodStrings[kEapPhase2MethodMax] = {
-    "NULL", "PAP", "MSCHAP", "MSCHAPV2", "GTC", "SIM", "AKA", "AKA'"};
+    "", "PAP", "MSCHAP", "MSCHAPV2", "GTC", "SIM", "AKA", "AKA'"};
 constexpr char kEapPhase2AuthPrefix[] = "auth=";
 constexpr char kEapPhase2AuthEapPrefix[] = "autheap=";
 constexpr char kNetworkEapSimGsmAuthResponse[] = "GSM-AUTH";
@@ -281,12 +281,12 @@
 	    &StaNetwork::setEapClientCertInternal, _hidl_cb, path);
 }
 
-Return<void> StaNetwork::setEapPrivateKey(
-    const hidl_string &path, setEapPrivateKey_cb _hidl_cb)
+Return<void> StaNetwork::setEapPrivateKeyId(
+    const hidl_string &id, setEapPrivateKeyId_cb _hidl_cb)
 {
 	return validateAndCall(
 	    this, SupplicantStatusCode::FAILURE_NETWORK_INVALID,
-	    &StaNetwork::setEapPrivateKeyInternal, _hidl_cb, path);
+	    &StaNetwork::setEapPrivateKeyIdInternal, _hidl_cb, id);
 }
 
 Return<void> StaNetwork::setEapSubjectMatch(
@@ -493,11 +493,11 @@
 	    &StaNetwork::getEapClientCertInternal, _hidl_cb);
 }
 
-Return<void> StaNetwork::getEapPrivateKey(getEapPrivateKey_cb _hidl_cb)
+Return<void> StaNetwork::getEapPrivateKeyId(getEapPrivateKeyId_cb _hidl_cb)
 {
 	return validateAndCall(
 	    this, SupplicantStatusCode::FAILURE_NETWORK_INVALID,
-	    &StaNetwork::getEapPrivateKeyInternal, _hidl_cb);
+	    &StaNetwork::getEapPrivateKeyIdInternal, _hidl_cb);
 }
 
 Return<void> StaNetwork::getEapSubjectMatch(getEapSubjectMatch_cb _hidl_cb)
@@ -918,7 +918,10 @@
 			"EAP method not set"};
 	}
 	std::string eap_phase2_str;
-	if (eap_method == ISupplicantStaNetwork::EapMethod::TTLS &&
+	if (method == ISupplicantStaNetwork::EapPhase2Method::NONE) {
+		eap_phase2_str = "";
+	} else if (
+	    eap_method == ISupplicantStaNetwork::EapMethod::TTLS &&
 	    method == ISupplicantStaNetwork::EapPhase2Method::GTC) {
 		eap_phase2_str = kEapPhase2AuthEapPrefix;
 	} else {
@@ -1004,12 +1007,11 @@
 	return {SupplicantStatusCode::SUCCESS, ""};
 }
 
-SupplicantStatus StaNetwork::setEapPrivateKeyInternal(const std::string &path)
+SupplicantStatus StaNetwork::setEapPrivateKeyIdInternal(const std::string &id)
 {
 	struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
 	if (setStringFieldAndResetState(
-		path.c_str(), &(wpa_ssid->eap.private_key),
-		"eap private_key")) {
+		id.c_str(), &(wpa_ssid->eap.key_id), "eap key_id")) {
 		return {SupplicantStatusCode::FAILURE_UNKNOWN, ""};
 	}
 	return {SupplicantStatusCode::SUCCESS, ""};
@@ -1326,14 +1328,14 @@
 		reinterpret_cast<char *>(wpa_ssid->eap.client_cert)};
 }
 
-std::pair<SupplicantStatus, std::string> StaNetwork::getEapPrivateKeyInternal()
+std::pair<SupplicantStatus, std::string>
+StaNetwork::getEapPrivateKeyIdInternal()
 {
 	struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
-	if (!wpa_ssid->eap.private_key) {
+	if (!wpa_ssid->eap.key_id) {
 		return {{SupplicantStatusCode::FAILURE_UNKNOWN, ""}, {}};
 	}
-	return {{SupplicantStatusCode::SUCCESS, ""},
-		reinterpret_cast<char *>(wpa_ssid->eap.private_key)};
+	return {{SupplicantStatusCode::SUCCESS, ""}, wpa_ssid->eap.key_id};
 }
 
 std::pair<SupplicantStatus, std::string>
diff --git a/wpa_supplicant/hidl/sta_network.h b/wpa_supplicant/hidl/sta_network.h
index c0df028..c3b1a89 100644
--- a/wpa_supplicant/hidl/sta_network.h
+++ b/wpa_supplicant/hidl/sta_network.h
@@ -104,8 +104,8 @@
 	    const hidl_string& path, setEapCAPath_cb _hidl_cb) override;
 	Return<void> setEapClientCert(
 	    const hidl_string& path, setEapClientCert_cb _hidl_cb) override;
-	Return<void> setEapPrivateKey(
-	    const hidl_string& path, setEapPrivateKey_cb _hidl_cb) override;
+	Return<void> setEapPrivateKeyId(
+	    const hidl_string& id, setEapPrivateKeyId_cb _hidl_cb) override;
 	Return<void> setEapSubjectMatch(
 	    const hidl_string& match, setEapSubjectMatch_cb _hidl_cb) override;
 	Return<void> setEapAltSubjectMatch(
@@ -147,7 +147,8 @@
 	Return<void> getEapCACert(getEapCACert_cb _hidl_cb) override;
 	Return<void> getEapCAPath(getEapCAPath_cb _hidl_cb) override;
 	Return<void> getEapClientCert(getEapClientCert_cb _hidl_cb) override;
-	Return<void> getEapPrivateKey(getEapPrivateKey_cb _hidl_cb) override;
+	Return<void> getEapPrivateKeyId(
+	    getEapPrivateKeyId_cb _hidl_cb) override;
 	Return<void> getEapSubjectMatch(
 	    getEapSubjectMatch_cb _hidl_cb) override;
 	Return<void> getEapAltSubjectMatch(
@@ -216,7 +217,7 @@
 	SupplicantStatus setEapCACertInternal(const std::string& path);
 	SupplicantStatus setEapCAPathInternal(const std::string& path);
 	SupplicantStatus setEapClientCertInternal(const std::string& path);
-	SupplicantStatus setEapPrivateKeyInternal(const std::string& path);
+	SupplicantStatus setEapPrivateKeyIdInternal(const std::string& id);
 	SupplicantStatus setEapSubjectMatchInternal(const std::string& match);
 	SupplicantStatus setEapAltSubjectMatchInternal(
 	    const std::string& match);
@@ -253,7 +254,7 @@
 	std::pair<SupplicantStatus, std::string> getEapCACertInternal();
 	std::pair<SupplicantStatus, std::string> getEapCAPathInternal();
 	std::pair<SupplicantStatus, std::string> getEapClientCertInternal();
-	std::pair<SupplicantStatus, std::string> getEapPrivateKeyInternal();
+	std::pair<SupplicantStatus, std::string> getEapPrivateKeyIdInternal();
 	std::pair<SupplicantStatus, std::string> getEapSubjectMatchInternal();
 	std::pair<SupplicantStatus, std::string>
 	getEapAltSubjectMatchInternal();
