Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gsupplicant] Add flags to force PEAP version. Contributes to: JB#44692
  • Loading branch information
inzanity committed May 24, 2019
1 parent af78e98 commit 11fe50f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/gsupplicant_types.h
Expand Up @@ -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 {
Expand Down
16 changes: 16 additions & 0 deletions src/gsupplicant_interface.c
Expand Up @@ -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
Expand Down

0 comments on commit 11fe50f

Please sign in to comment.