=====================================================
This repository is an implementation of EAP-NOOB. It is an EAP method for secure bootstrapping of IoT appliances. The specification for EAP-NOOB can be found at: https://datatracker.ietf.org/doc/draft-aura-eap-noob/?include_text=1.
This implementation consists of three separate applications:
-
hostapd : Contains EAP-NOOB server side implementation (AAA server).
-
wpa_supplicant: Contains EAP-NOOB peer/supplicant implementation.
-
NodeJS webserver: Maintains users accounts and provides a front end for the database tracking the IoT appliances being bootstrapped. Out-of-band (OOB) messages encoded as URLs are sent to, or received from this web server. This server is vital for associating the appliance being bootstrapped with a registered user account.
Copyright (c) 2018, Aalto University All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the Aalto University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AALTO UNIVERSITY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
See CONTRIBUTORS for more information.
------- -------------- ---------
| WPA_S | ---------------------------- | Access Point | ----------------------------- | Hostapd |
------- -------------- ---------
| |
| |
| |
| |
| ---------- ------------
|--------------------------------------|OOB device| ------------------------------| Web server |
---------- ------------
The Access point is a Wi-Fi access point supporting WAP2-enterprise (IEEE 802.1x) authentication. OOB device is a helper device that may be used for delivering the out-of-band (OOB) message. An example OOB device is user's mobile phone.
Following packages have to be installed before compiling the EAP-NOOB code:
-
libssl-dev (minimum version 1.1.1a for elliptic curve X25519).
-
libsqlite3-dev (sqlite3).
-
libjansson-dev (Package for JSON encoding/decoding http://jansson.readthedocs.io/en/2.7/index.html).
-
nodejs-legacy (NodeJS package).
-
npm (node package manager).
hostapd:
- Move to directory hostapd-2.6/hostapd.
- Open build configuration file .config and set CONFIG_DRIVER_WIRED=y and CONFIG_EAP_OOB=y.
- Run $ make
wpa_supplicant:
- Move to directory wpa_supplicant-2.6/wpa_supplicant.
- Open build configuration file .config and set CONFIG_DRIVER_NL80211=y and CONFIG_EAP_OOB=Y.
- Run $ make
webserver:
- Move to folder nodejs
- Run $ npm install
-
Fetch the tarball: wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
-
Unpack the tarball with tar -zxf openssl-1.1.1a.tar.gz && cd openssl-1.1.1a
-
Issue the command ./config.
-
Issue the command make (You may need to run sudo apt install make gcc before running this command successfully).
-
Run make test to check for possible errors.
-
Backup current openssl binary: sudo mv /usr/bin/openssl ~/tmp
-
Issue the command sudo make install.
-
Create symbolic link from newly install binary to the default location:
-
sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
-
Run the command sudo ldconfig to update symlinks and rebuild the library cache.
-
sudo apt-get install -y npm pkg-config libssl-dev libsqlite3-dev libjansson-dev libnl-3-dev libnl-genl-3-dev
-
sudo apt remove libssl-dev
The hostapd (AAA server) and the webserver interact with each other through a shared transactional database. For this interaction to correctly work, they both need to read and write to the same database file peer_connection_db.
hostapd:
At location hostapd-2.6/hostapd edit file eapoob.conf to configure parameters such server URL, Server name etc. For more information on configurable parameters, see Appendix B. Application-specific parameters in the Internet draft.
webserver:
At location nodejs/config edit file "database.js" to fill in the relevant data like server URL and the path to the shared database i.e. absolutes path to database file "peer_connection_db" inside hostapd-2.6/hostapd.
wpa_Supplicant:
At location wpa_supplicant-2.6/wpa_supplicant edit file eapoob.conf to fill in relevant configuration information such as peerinfo etc. For more information on configurable parameters, see Appendix B. Application-specific parameters in the Internet draft.
-
hostapd: At location hostapd-2.6/hostapd run the command:
$ ./hostapd hostapd.conf
-
webserver: At location nodejs run the command:
$ node server.js
-
wpa_supplicant: At location wpa_supplicant-2.6/wpa_supplicant run the command:
$ ./wpa_auto_run.py
Note: Before executing wpa_supplicant, the network manager of the host machine must be stopped. To stop network-manger run the command $ sudo stop network-manger.
A local AAA server can also be used between the Access Point (AP) and the AAA server (hostapd). This would typically happen in enterprise deployments. The local AAA server should be configured to forward all authentication requests containing the Network Access Identifier (NAI) of the form (eap-noob.net) to the hostapd server.
Most of the source code for EAP-NOOB can be found at the following files:
hostapd:
-
eap-noob/hostapd-2.6/src/eap_server/eap_server_noob.c
-
eap-noob/hostapd-2.6/src/eap_server/eap_server_noob.h
wpa_supplicant:
-
eap-noob/wpa_supplicant-2.6/src/eap_peer/eap_noob.c
-
eap-noob/wpa_supplicant-2.6/src/eap_peer/eap_noob.h