...
Code Block | ||
---|---|---|
| ||
make eapol_test |
Running ./eapol_test without parameters will display the command-line parameters.
Windows
Currently the The instructions for Windows depend on either using a Linux host (such as a virtual machine), or a container if you are using Docker or similar). The instructions following here are for virtual machine-based building.
...
installing the MinGW64 compiler on Windows. For the former, we recommend a recent version of Ubuntu Linux because it includes recent versions of the required tools. For the latter, the instructions were tested on Windows 7 Enterprise, but should continue to be accurate for Windows 10.
1. Cross-compile on Linux for Windows
Preparatory work
Install Ubuntu 20.
...
You should now have an eapol_test.exe
with around 6707168 around 6,707,168 bytes in size.
Copy this to a Windows box. Run it without parameters. It should display command-line parameters.
2. Build on Windows
Preparatory work
Download and install MinGW-W64 from https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
Run the installer, mingw-w64-install.exe. Because it is not signed, Windows will prompt you to confirm whether you wish to run this executable.
During the the installation, you will be prompted for the following:
- Version: 8.1.0 (default)
- Architecture: x86_64
- Threads: win32
- Exception: seh
Accept all other defaults.
Configuration
Create a batch file: C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\mingw64.bat
Code Block | ||
---|---|---|
| ||
@echo off
set PREFIX=x86_64-w64-mingw32
set CC=%PREFIX%-gcc.exe
set CXX=%PREFIX%-g++.exe
set CPP=%PREFIX%-c++.exe
set GCOV=%PREFIX%-gcov.exe
set MAKE=mingw32-make.exe
%* |
Save it.
Building the sources
Download eapol_test.c
and eapol_test.config
from https://github.com/janetuk/eapol_test. For the purposes of these instructions, we shall use C:\Users\Administrator\Desktop.
Download libtommath's source at https://github.com/libtom/libtommath/releases/download/v1.2.0/ltm-1.2.0.tar.xz
Download wpa_supplicant's source at https://w1.fi/releases/wpa_supplicant-2.9.tar.gz
Unpack the libtommath distribution. Note the directory you unpacked it to. You will need it later. For the purposes of these instructions, we shall use C:\Users\Administrator\Desktop\libtommath-1.2.0
Unpack the wpa_supplicant distribution. For the purposes of these instructions, we shall use C:\Users\Administrator\Desktop\wpa-2.9
Open a MinGW-W64 prompt by opening the menu, going to All Programs > MinGW-W64 project > x86_64-8.1.0-win32-seh-rt_v6-rev0 > Run terminal
Code Block | ||
---|---|---|
| ||
C:\> |
Change to the libtommath directory. Run the build command
Code Block | ||
---|---|---|
| ||
C:\> cd C:\Users\Administrator\Desktop\libtommath-1.2.0
C:\Users\Administrator\Desktop\libtommath-1.2.0> mingw64.bat %MAKE% |
This should build successfully and leave you with a library in the directory.
Copy eapol_test.config and eapol_test.c to the wpa_supplicant subdirectory.
Code Block | ||
---|---|---|
| ||
cd C:\Users\Administrator\Desktop
copy eapol_test.config wpa-2.9\wpa_supplicant\.config
copy eapol_test.c wpa-2.9\wpa_supplicant\eapol_test.c |
You will likely be prompted to overwrite eapol_test.c. Confirm by answering 'Y'.
Change to the wpa_supplicant subdirectory.
Code Block | ||
---|---|---|
| ||
C:\Users\Administrator\Desktop> cd wpa-2.9\wpa_supplicant |
Edit the .config file. Find the line ifndef CONFIG_INTERNAL_LIBTOMMATH
, change the line below it to the directory you built libtommath in:
Code Block | ||
---|---|---|
| ||
LTM_PATH=C:\Users\Administrator\Desktop\libtommath-1.2.0 |
Edit the Makefile and replace the CFLAGS= line near the top of the file with this:
Code Block | ||
---|---|---|
| ||
CFLAGS= -Wno-error=pointer-to-int-cast -MMD -O2 -g -w |
Run the build command
Code Block | ||
---|---|---|
| ||
mingw64.bat %MAKE% eapol_test |
You should now have an eapol_test.exe
around 6,424,514 bytes in size.
Run it without parameters. It should display command-line parameters.
Testing with eapol_test
Testing with eapol_test on Linux or Windows will ultimately yield the same results. The configuration files for use with the utility are identical on either platform. Here is a sample configuration file you can use.
Configuration file
Code Block | ||
---|---|---|
| ||
network={ phase1="tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=0 tls_disable_tlsv1_3=1 peapver=0" key_mgmt=WPA-EAP eap=PEAP identity="<username@realm>" anonymous_identity="@realm" password="<userpassword>" phase2="eapauth=MSCHAPV2" # ca_cert="<full path of the CA root certificate>" } |
...