Build a EAP library from hostapd source code - #381
Merged
Conversation
Use an early-return to exit early when `BUILD_ONLY_DOCS` is true.
Add CMake build configuration to compile an EAP library from the hostapd v2.10 soure code. In future commits, edgesec's RADIUS server will use this EAP (https://en.wikipedia.org/wiki/Extensible_Authentication_Protocol) library for more complex WiFi authentication. By default, hostapd's EAP files are for internal use only. We adapted the `eap_example/` project in the `hostap` Git repo for how to make an independent EAP library, see https://w1.fi/cgit/hostap/tree/eap_example/Makefile?h=hostap_2_10 Co-authored-by: Alois Klink <alois@nquiringminds.com>
Add some basic tests to confirm whether the EAP library from hostapd works. These tests are adapted from the `eap_example/` folder in the hostapd Git source repository, see https://w1.fi/cgit/hostap/tree/eap_example?h=hostap_2_10 Co-authored-by: Alois Klink <alois@nquiringminds.com>
Builds the EAP library as part of the "linux" preset, so that it is automatically tested in continuous integration by GitHub Actions.
Contributor
Author
|
I've made this in a separate comment, since it was too big for the original comment.
|
Codecov Report
@@ Coverage Diff @@
## main #381 +/- ##
==========================================
+ Coverage 51.77% 52.31% +0.53%
==========================================
Files 139 142 +3
Lines 19317 19651 +334
==========================================
+ Hits 10001 10280 +279
- Misses 9316 9371 +55
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
mereacre
self-requested a review
January 10, 2023 10:28
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libeap is an implementation of the EAP state machine (https://en.wikipedia.org/wiki/Extensible_Authentication_Protocol) from the hostapd project. In this PR, libeap doesn't do anything useful, but in future PRs, edgesec's RADIUS server will use this EAP (https://en.wikipedia.org/wiki/Extensible_Authentication_Protocol) library for more complex WiFi authentication.
This PR was adapted from PR #376.
By default, hostapd's EAP files are for internal use only.
We adapted the
eap_example/project in v2.10 of thehostapGit repo for how to make an independent EAP library, see https://w1.fi/cgit/hostap/tree/eap_example/Makefile?h=hostap_2_10This PR also adds some basic tests to confirm whether the EAP library from hostapd works.
These tests are also adapted from the
eap_example/folder in the hostapd Git source repository, see https://w1.fi/cgit/hostap/tree/eap_example?h=hostap_2_10Differences to PR #376
BUILD_HOSTAPD_EAP_LIBto make it clearer that it comes from HOSTAPD.OpenSSL::Cryptoin EAP code, it seems like it's not needed (maybe it's auto-linking to my OS's OpenSSL library?Important: This was causing race conditions in the previous code, as the
libeapbuild was overwriting thehostapdbuild, because they both used the same SOURCE_DIR, and sinceBUILD_IN_SOURCEwas set toTRUE, they also had the same BINARY_DIR (build dir).lib/hostapd.config.in. The only thing we add (compared tomaster) is a custom config option calledCONFIG_LIBEAP_INSTALL_DIR, which we can use to control theCONFIG_LIBEAP_INSTALL_DIR..makfile instead of a.mak.infile by moving all configuration into the.config.infile. This means our IDE can understand the Makefile better.Smaller and simpler Makefile
Less modifications needed to Makefile from upstream source.
git diff --no-index -w ~/Documents/hostap/eap_example/Makefile lib/libeap.makeap_example/folder, so I've also made sure not to compile them. THE FOLLOWING ARE NOT COMPILED:EAP_SERVER_SIMEAP_SERVER_AKAEAP_SERVER_AKA_PRIMEEAP_SERVER_FASTEAP_SERVER_IKEV2EAP_SERVER_TNC