EAP peer implementation from wpa_supplicant as a library

Jouni Malinen j at w1.fi
Sat Dec 8 12:48:44 EST 2007

On Wed, Oct 17, 2007 at 08:53:00AM +0200, Stjepan Gros wrote:

> This is a good question. I was planning to raise similar question also,
> but due to the lack of time wasn't able to do so. So, I'll do that now.

Sorry about this taking a while, but I finally had chance to take a
closer look at this thread..

> We use supplicant part as a library in IKEv2 protocol implementation.
> More specifically, version 0.4.7. Makefiles that produce dynamic
> libraries can be found in the contrib/ subdirectory of the ikev2
> (ikev2.sourceforge.net) source as well as README file that details how
> to build libraries.

To be more exact, you are using EAP peer functionality, not the IEEE
802.1X/EAPOL supplicant, from wpa_supplicant.

> The exact content of the Makefiles was trial and error process. But
> eventually, it worked. The main problem are some auxiliary functions,
> e.g. logging, that are mixed with other functions and so are not easily
> replaceable with ikev2's equivalents. This is necessary in order to
> better integrate the supplicant code into ikev2 implementation.

Even though there are still quite many areas that can be improved, this
should be much better in the current wpa_supplicant 0.6.x code base. The
logging functions that you may want to replace are in their own file
(src/utils/wpa_debug.c) and you can link in other files without having
to replace some of the common helper functions.

In addition, I just added a simple example program that shows how to
interact with the EAP peer and EAP server code. The Makefile for this
program shows how to build a library with EAP functionality and the
example program is linked against that library. I would expect this to
be quite close to the needs of your IKEv2 implementation.

The example code is available from my Git repository at http://w1.fi/ in
a new top level directory, eap_example. This makes it easier for me to
find areas in the interface between EAP and EAPOL (or other protocol
using EAP) and I would expect that some of the interfaces will change
during 0.6.x development to clear these, so please do not expect the
interfaces to be fixed at this point.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list