-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hostapd does not support mbedtls #10303
Comments
My test branch may be far enough along for a test package to be made for hostapd-mini, wpad-mini, and wpa_supplicant-mini variants, but please note that my test branch has not yet been reviewed by others. I would like to get some feedback from the hostap mailing list when I am a little further along. Aside: wolfSSL is a solid, open-source library, though like all other software, can have bugs. (Hopefully) friendly competition in open source can help improve the quality of the open source offerings. My personal preference for a base TLS package is for mbed TLS when given a choice between mbed TLS and wolfSSL, though keep in mind that wolfSSL has TLSv1.3 and OCSP stapling support, while mbed TLS currently does not (TLSv1.3 support is currently being developed and is experimental in mbed TLS). |
Question: https://github.com/openwrt/openwrt/blob/master/package/libs/mbedtls/Makefile#L91 |
No what that line does is it filters out upstream's O2 or O3 setting and replaces it with Os. |
My development branch https://github.com/gstrauss/hostap/tree/mbedtls now contains a mostly functional hostapd and wpa_suppplicant using mbedtls, [Edit: not yet] including SAE and DPP. Almost all tests in the tests/hwsim test suite pass on a Debian 11 Bullseye VM in which I manually upgraded to mbedtls 2.28.1. (I have not yet tested with mbedtls 3.2.1, but expect any needed adjustments to be minor since I have written the code to be aware of both mbedtls 2.x and mbedtls 3.x APIs.) It should now be feasible to build test packages of hostapd-mini, hostapd-basic, and hostapd-full using mbedtls. I have created branch https://github.com/gstrauss/hostap/tree/mbedtls.0 as a checkpoint, since I plan to continue developing (and force-pushing any bug fixes to) https://github.com/gstrauss/hostap/tree/mbedtls Besides code review/audit by others and more testing, there is plenty more polishing to be done, as well as additional configuration options which might need to be added before this is ready for production. That said, the current state of my development branch proves mbedtls is a viable TLS option for hostapd and wpa_supplicant. I'll be at a conference and away for the next few days, but plan to post to the hostapd mailing list early next week, if not sooner. In the meantime, may I request some assistance from others in identifying feature gaps that should be implemented for OpenWRT use of mbedtls with hostapd and wpa_supplicant? Thank you! |
Maybe it worth to send a letter in answer to the [PATCH] Add support for mbedtls crypto library for STA mode so that other interested developers can join |
@stokito did you read what I posted above?
|
To follow this ticket |
@Neustradamus in the future, please click the "Subscribe" button in the right sidebar to avoid adding useless noise in a comment. |
status: further testing shows more work is needed to get EAP-PWD, EAP-TEAP, SAE, DPP and others working. I previously wrote:
and
I am going to defer posting to the hostap mailing list until next week, as I try to get more things working in tests/hwsim test suite. |
Posted to hostap mailing list: http://lists.infradead.org/pipermail/hostap/2022-September/040794.html |
Almost 2 months ago (above #10303 (comment)) I posted the following request but I have received zero feedback:
|
@gstrauss unfortunate. I think most of the core developers talk on the openwrt-devel mailing list. |
@neheb since you raised this issue "hostapd does not support mbedtls" (at my request), would you please post to the openwrt-devel mailing list to raise this issue? mbedtls already is a core piece of openwrt as mbedtls provides TLS for numerous applications. mbedtls in openwrt should be better maintained, at least similar to openssl, where patches on the stable branch are incorporated on a periodic basis, where the period to pick up patch releases is measured in weeks, not months or years. My development patches for hostap to be able to use mbedtls currently require at least mbedtls 2.27.0 (released 6 Jul 2021) Latest release on the mbedtls 2.x series is mbedtls 2.28.1 (released 11 Jul 2022) https://github.com/Mbed-TLS/mbedtls/releases
|
IMO the best way to move forward is to actually create something actionable for folks interested in development, so this would be pull request or patch series, which would incorporate needed hostapd/mbedtls changes, so anyone interested with helping/testing can easily join the effort. This process should very well expose the missing bits as well. |
@ynezz: I have patches at https://github.com/gstrauss/hostap/tree/mbedtls. Are you suggesting creating a patch set and submitting patches to openwrt? That is trivially done with some git commands, but then what? hostap is created in multiple flavors for openwrt. If you are asking for something trivial for others to more easily test, then I ask for more detailed guidance from openwrt packagers about the best way to go about this. You see, I have spent hundreds of hours of professional development time and have provided patches in a canonical form: a git repository. For anyone interested in development who has the skills for development, a git repository is sufficient. I think you are aiming at something different, which why I am asking for further assistance in packaging to make it easier for the target audience you have in mind. Thanks. |
I think what he means is, people look at PRs, pull, and then test. So far, there is no such PR. I can create such a thing if desired. |
If I can get some assistance with openwrt-specific packaging to create an mbedtls "flavor" of hostap for openwrt, I'll be happy to take that starting point and add hostap patches from my development branch. |
Awesome, that would be a proper way for moving forward, thank you! So I'm closing this this as this is not a bug (this is a bug tracker) and I hope, that it's now clear what needs to be done. So lets move any further discussion about this topic into appropriate channels, like that future PR, mailing list or forum. |
I think, that @neheb has a lot of experience in this area, so he is likely the best candidate for that, |
I can imagine that and I'm very thankful for your effort. Few years ago we've estimated the development time needed for 6-12 months, so thats why we went with wolfSSL which was already available.
As in any FOSS project, it's not about lack of interest, but rather lack of time. I hope, that we're now on a good track to move this forward. |
...and good project management and communication, which has now been dead-ended by you closing this issue when there is no currently-established PR for reference for the next steps. Therefore, I'll continue posting here. I have rebased my patches onto a branch: https://github.com/gstrauss/hostap/tree/openwrt-hostap-vers That should make it easier to produce patches files for openwrt using a command like |
Current WIP: neheb@459aa77 Doesn't quite work:
Missing something obvious probably... |
The Makefile contains references such as: |
@neheb your Config.in has a |
figured it out. Next issue I see is:
I see CONFIG_TLS_WOLFSSL. No idea where it's getting set. config WPA_WOLFSSL is unused. Seems like a leftover. edit: Latest commit is at the top of https://github.com/neheb/openwrt/tree/mangix edit2: copy/paste error of course. Next error:
|
NEED_DES=y might need to be set in the Makefile. |
Didn't help. CONFIG_DES is definitely being passed. |
Try |
here's the full log. https://gist.github.com/neheb/d8c4bf0ca9bff4ad4ca327acc9bda6da I see it there. edit: no DES in mbedtls would explain it. |
I think you might be able to work around it by setting |
Added PR: #10727 Let's see how this goes... |
FYI: https://github.com/openwrt/openwrt/blob/master/package/libs/mbedtls/patches/200-config.patch#L23 disables quite a few curves in mbedtls. Some of these might end up being needed for wider support in hostap. I am not sure at first glance if any are required. |
I assume that's an exercise in size optimization. I don't think there's any hurry. |
@neheb: Thank you for putting together and submitting the PR. It would probably have taken me much longer to work through the openwrt packaging and build issues for the complex hostap package. |
Yeah that's the first time I touch it. It needs serious refactoring. If I had to guess, there was only openssl and internal originally. Then wolfssl was added without refactoring the Makefile. The PR doesn't really fix anything. |
Which necessitates the use of buggy wolfSSL by default
@gstrauss has a WIP branch: https://github.com/gstrauss/hostap/tree/mbedtls
I think this should be researched.
The text was updated successfully, but these errors were encountered: