eap_proxy: Confirm eap_proxy initialization before reading SIM info
[mech_eap.git] / src / eapol_supp / eapol_supp_sm.c
index 03ec2cb..d34df7c 100644 (file)
@@ -2051,3 +2051,15 @@ int eapol_sm_failed(struct eapol_sm *sm)
                return 0;
        return !sm->eapSuccess && sm->eapFail;
 }
+
+
+int eapol_sm_get_eap_proxy_imsi(struct eapol_sm *sm, char *imsi, size_t *len)
+{
+#ifdef CONFIG_EAP_PROXY
+       if (sm->eap_proxy == NULL)
+               return -1;
+       return eap_proxy_get_imsi(imsi, len);
+#else /* CONFIG_EAP_PROXY */
+       return -1;
+#endif /* CONFIG_EAP_PROXY */
+}