Commit 11fe50fe authored by Santtu Lakkala's avatar Santtu Lakkala

[gsupplicant] Add flags to force PEAP version. Contributes to: JB#44692

parent af78e989
......@@ -137,9 +137,11 @@ typedef enum gsupplicant_eap_method {
GSUPPLICANT_EAP_METHOD_PWD = (0x00040000)
} GSUPPLICANT_EAP_METHOD;
typedef enum gsupplicant_auth_fags {
typedef enum gsupplicant_auth_flags {
GSUPPLICANT_AUTH_DEFAULT = (0x00000000),
GSUPPLICANT_AUTH_PHASE2_AUTHEAP = (0x00000001)
GSUPPLICANT_AUTH_PHASE2_AUTHEAP = (0x00000001),
GSUPPLICANT_AUTH_PHASE1_PEAPV0 = (0x00000002), /* Since 1.0.12 */
GSUPPLICANT_AUTH_PHASE1_PEAPV1 = (0x00000004) /* Since 1.0.12 */
} GSUPPLICANT_AUTH_FLAGS;
typedef enum gsupplicant_op_mode {
......
......@@ -434,6 +434,22 @@ gsupplicant_interface_add_network_args_security_peap(
const GSupplicantNetworkParams* np,
GHashTable* blobs)
{
if (np->eap == GSUPPLICANT_EAP_METHOD_PEAP) {
switch (np->auth_flags &
(GSUPPLICANT_AUTH_PHASE1_PEAPV0 |
GSUPPLICANT_AUTH_PHASE1_PEAPV1)) {
case GSUPPLICANT_AUTH_PHASE1_PEAPV0:
gsupplicant_dict_add_string(builder, "phase1", "peapver=0");
break;
case GSUPPLICANT_AUTH_PHASE1_PEAPV1:
gsupplicant_dict_add_string(builder, "phase1", "peapver=1");
break;
default:
GWARN("Trying to force PEAPv0 and v1, ignoring");
case 0:
break;
}
}
/*
* Multiple protocols in phase2 should be allowed,
* e.g "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment