Skip to content
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

Add support for legacy clients using SSLv2 and SSLv3 #35

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "openssl"]
path = openssl
url = https://github.com/openssl/openssl
19 changes: 19 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

echo "[*] Downloading OpenSSL..."
git submodule init
git submodule update

echo "[*] Building OpenSSL..."
cd openssl
./config --prefix=$(pwd)/local enable-ssl2 enable-ssl3 enable-ssl3-method enable-des enable-rc4 enable-weak-ssl-ciphers no-shared
make
make install_sw
cd ..

echo "[*] Building hostapd-mana..."
cd hostapd
make
cd ..

echo "[+] Done!"
5 changes: 5 additions & 0 deletions hostapd/.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# be modified from here. In most cass, these lines should use += in order not
# to override previous values of the variables.

# Use local OpenSSL library
CONFIG_OPENSSL=y

# Driver interface for Host AP driver
CONFIG_DRIVER_HOSTAP=y

Expand All @@ -26,6 +29,8 @@ CONFIG_DRIVER_NL80211=y
#
#CFLAGS += -I$<path to libnl include files>
#LIBS += -L$<path to libnl library files>
LIBS += -L../openssl/local/lib/
CFLAGS += -I../openssl/local/include/

# Use libnl v2.0 (or 3.0) libraries.
#CONFIG_LIBNL20=y
Expand Down
4 changes: 4 additions & 0 deletions hostapd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hostapd
hostapd_cli
*.o
*.d
5 changes: 5 additions & 0 deletions hostapd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export BINDIR ?= /usr/local/bin/

-include .config

ifdef CONFIG_OPENSSL
LIBS += -Wl,-rpath=../openssl/local/lib
LIBS += -lpthread
endif

ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
ifeq ($(wildcard ../.git),../.git)
Expand Down
5 changes: 5 additions & 0 deletions hostapd/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# be modified from here. In most cass, these lines should use += in order not
# to override previous values of the variables.

# Use local OpenSSL library
CONFIG_OPENSSL=y

# Driver interface for Host AP driver
CONFIG_DRIVER_HOSTAP=y

Expand All @@ -26,6 +29,8 @@ CONFIG_DRIVER_NL80211=y
#
#CFLAGS += -I$<path to libnl include files>
#LIBS += -L$<path to libnl library files>
LIBS += -L../openssl/local/lib/
CFLAGS += -I../openssl/local/include/

# Use libnl v2.0 (or 3.0) libraries.
#CONFIG_LIBNL20=y
Expand Down
1 change: 1 addition & 0 deletions openssl
Submodule openssl added at 50eaac
2 changes: 2 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**.o
**.d
9 changes: 5 additions & 4 deletions src/crypto/tls_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,8 @@ void * tls_init(const struct tls_config *conf)
if (conf)
data->tls_session_lifetime = conf->tls_session_lifetime;

SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv2);
SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv3);
//SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv2);
//SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv3);

SSL_CTX_set_info_callback(ssl, ssl_info_cb);
SSL_CTX_set_app_data(ssl, context);
Expand Down Expand Up @@ -1350,8 +1350,9 @@ struct tls_connection * tls_connection_init(void *ssl_ctx)
SSL_set_app_data(conn->ssl, conn);
SSL_set_msg_callback(conn->ssl, tls_msg_cb);
SSL_set_msg_callback_arg(conn->ssl, conn);
options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
SSL_OP_SINGLE_DH_USE;
//options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
// SSL_OP_SINGLE_DH_USE;
options = SSL_OP_SINGLE_DH_USE;
#ifdef SSL_OP_NO_COMPRESSION
options |= SSL_OP_NO_COMPRESSION;
#endif /* SSL_OP_NO_COMPRESSION */
Expand Down