When doing a PEAP/TTLS authentication, if the Phase2 passphrase is
not provided, connman crashes due to a NULL pointer.
This patch fixes the crash.
Fixes BMC #6841
* The Client private key file
* The Client private key file password
*/
+ if (passphrase == NULL) {
+ connman_error("Error in PEAP/TTLS authentication: "
+ "a phase2 passphrase must be defined\n");
+ return -EINVAL;
+ }
+
ca_cert = connman_network_get_string(network, "WiFi.CACertFile");
if (ca_cert == NULL) {
connman_error("Error in PEAP/TTLS authentication: "