summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-09-03 21:40:34 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-09-03 21:40:34 +0400
commit9739251101bffde2c62ba08c1869eb170d952d5b (patch)
tree41f59ad7a2c6fc855404f808cba887d88a32c96a /accel-pppd
parent44adc2a544ea23aee39105b048c8f90cef565a5b (diff)
downloadaccel-ppp-9739251101bffde2c62ba08c1869eb170d952d5b.tar.gz
accel-ppp-9739251101bffde2c62ba08c1869eb170d952d5b.zip
implemented crypto library selection: -DCRYPTO=OPENSSL|TOMCRYPT|INTERNAL (default OPENSSL)
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/CMakeLists.txt16
-rw-r--r--accel-pppd/auth/CMakeLists.txt6
-rw-r--r--accel-pppd/auth/auth_chap_md5.c2
-rw-r--r--accel-pppd/auth/auth_mschap_v1.c4
-rw-r--r--accel-pppd/auth/auth_mschap_v2.c4
-rw-r--r--accel-pppd/ctrl/pppoe/CMakeLists.txt6
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c3
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.h4
-rw-r--r--accel-pppd/extra/chap-secrets.c2
-rw-r--r--accel-pppd/extra/pppd_compat.c2
l---------accel-pppd/include/crypto.h1
-rw-r--r--accel-pppd/ppp/ppp.c2
-rw-r--r--accel-pppd/radius/acct.c2
-rw-r--r--accel-pppd/radius/auth.c4
-rw-r--r--accel-pppd/radius/dm_coa.c3
15 files changed, 24 insertions, 37 deletions
diff --git a/accel-pppd/CMakeLists.txt b/accel-pppd/CMakeLists.txt
index cdc2d3ea..f0701292 100644
--- a/accel-pppd/CMakeLists.txt
+++ b/accel-pppd/CMakeLists.txt
@@ -1,17 +1,3 @@
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckIncludeFiles)
-
-CHECK_LIBRARY_EXISTS(crypto MD5_Init "" HAVE_SSL)
-IF (NOT HAVE_SSL)
- MESSAGE(FATAL_ERROR "openssl library not found")
-ENDIF (NOT HAVE_SSL)
-
-SET(CMAKE_REQUIRED_INCLUDES "openssl")
-CHECK_INCLUDE_FILES("md5.h" HAVE_SSL)
-IF (NOT HAVE_SSL)
- MESSAGE(FATAL_ERROR "openssl headers not found")
-ENDIF (NOT HAVE_SSL)
-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fvisibility=hidden -fno-strict-aliasing -D_GNU_SOURCE -DPTHREAD_SPINLOCK -fPIC")
IF (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT)
@@ -89,7 +75,7 @@ ADD_EXECUTABLE(accel-pppd
memdebug.c
)
-TARGET_LINK_LIBRARIES(accel-pppd triton rt pthread crypto pcre)
+TARGET_LINK_LIBRARIES(accel-pppd triton rt pthread ${crypto_lib} pcre)
set_property(TARGET accel-pppd PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE)
set_property(TARGET accel-pppd PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE)
diff --git a/accel-pppd/auth/CMakeLists.txt b/accel-pppd/auth/CMakeLists.txt
index ef9478aa..7af8faca 100644
--- a/accel-pppd/auth/CMakeLists.txt
+++ b/accel-pppd/auth/CMakeLists.txt
@@ -3,9 +3,9 @@ ADD_LIBRARY(auth_chap_md5 SHARED auth_chap_md5.c)
ADD_LIBRARY(auth_mschap_v1 SHARED auth_mschap_v1.c)
ADD_LIBRARY(auth_mschap_v2 SHARED auth_mschap_v2.c)
-TARGET_LINK_LIBRARIES(auth_chap_md5 crypto)
-TARGET_LINK_LIBRARIES(auth_mschap_v1 crypto)
-TARGET_LINK_LIBRARIES(auth_mschap_v2 crypto)
+TARGET_LINK_LIBRARIES(auth_chap_md5 ${crypto_lib})
+TARGET_LINK_LIBRARIES(auth_mschap_v1 ${crypto_lib})
+TARGET_LINK_LIBRARIES(auth_mschap_v2 ${crypto_lib})
INSTALL(TARGETS auth_pap auth_chap_md5 auth_mschap_v1 auth_mschap_v2
LIBRARY DESTINATION lib/accel-ppp
diff --git a/accel-pppd/auth/auth_chap_md5.c b/accel-pppd/auth/auth_chap_md5.c
index 2307f14a..d72f70aa 100644
--- a/accel-pppd/auth/auth_chap_md5.c
+++ b/accel-pppd/auth/auth_chap_md5.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <arpa/inet.h>
-#include <openssl/md5.h>
+#include "crypto.h"
#include "log.h"
#include "ppp.h"
diff --git a/accel-pppd/auth/auth_mschap_v1.c b/accel-pppd/auth/auth_mschap_v1.c
index 10d5fe8e..b212f034 100644
--- a/accel-pppd/auth/auth_mschap_v1.c
+++ b/accel-pppd/auth/auth_mschap_v1.c
@@ -8,9 +8,7 @@
#include <byteswap.h>
#include <arpa/inet.h>
-#include <openssl/md4.h>
-#include <openssl/des.h>
-#include <openssl/sha.h>
+#include "crypto.h"
#include "log.h"
#include "ppp.h"
diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c
index ebcffb7a..0dd41430 100644
--- a/accel-pppd/auth/auth_mschap_v2.c
+++ b/accel-pppd/auth/auth_mschap_v2.c
@@ -8,9 +8,7 @@
#include <byteswap.h>
#include <arpa/inet.h>
-#include <openssl/md4.h>
-#include <openssl/des.h>
-#include <openssl/sha.h>
+#include "crypto.h"
#include "log.h"
#include "ppp.h"
diff --git a/accel-pppd/ctrl/pppoe/CMakeLists.txt b/accel-pppd/ctrl/pppoe/CMakeLists.txt
index b2c0584d..a38cfb2c 100644
--- a/accel-pppd/ctrl/pppoe/CMakeLists.txt
+++ b/accel-pppd/ctrl/pppoe/CMakeLists.txt
@@ -12,6 +12,10 @@ SET(sources ${sources} tr101.c)
ENDIF(RADIUS)
ADD_LIBRARY(pppoe SHARED ${sources})
-TARGET_LINK_LIBRARIES(pppoe crypto)
+TARGET_LINK_LIBRARIES(pppoe ${crypto_lib})
+#set_property(TARGET pppoe PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE)
+#set_property(TARGET pppoe PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+#set_property(TARGET pppoe PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE)
+#set_property(TARGET pppoe PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp)
INSTALL(TARGETS pppoe LIBRARY DESTINATION lib/accel-ppp)
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 92934034..4d04f07f 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -13,7 +13,7 @@
#include <arpa/inet.h>
#include <printf.h>
-#include <openssl/md5.h>
+#include "crypto.h"
#include "events.h"
#include "triton.h"
@@ -459,7 +459,6 @@ static void generate_cookie(struct pppoe_serv_t *serv, const uint8_t *src, uint8
uint8_t raw[24];
} u1, u2;
- memset(&key, 0, sizeof(key));
DES_random_key(&key);
DES_set_key(&key, &ks);
diff --git a/accel-pppd/ctrl/pppoe/pppoe.h b/accel-pppd/ctrl/pppoe/pppoe.h
index 2264dd16..b8c7281d 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.h
+++ b/accel-pppd/ctrl/pppoe/pppoe.h
@@ -3,11 +3,11 @@
#include <pthread.h>
-#include <openssl/des.h>
-
#include <linux/if.h>
#include <linux/if_pppox.h>
+#include "crypto.h"
+
/* PPPoE codes */
#define CODE_PADI 0x09
#define CODE_PADO 0x07
diff --git a/accel-pppd/extra/chap-secrets.c b/accel-pppd/extra/chap-secrets.c
index 61cd2a91..e8f1b589 100644
--- a/accel-pppd/extra/chap-secrets.c
+++ b/accel-pppd/extra/chap-secrets.c
@@ -280,4 +280,4 @@ static void init(void)
triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);
}
-DEFINE_INIT(100, init);
+DEFINE_INIT(200, init);
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 36225314..68d718b1 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -539,4 +539,4 @@ static void init(void)
#endif
}
-DEFINE_INIT(101, init);
+DEFINE_INIT(100, init);
diff --git a/accel-pppd/include/crypto.h b/accel-pppd/include/crypto.h
new file mode 120000
index 00000000..2f3f63cb
--- /dev/null
+++ b/accel-pppd/include/crypto.h
@@ -0,0 +1 @@
+../../crypto/crypto.h \ No newline at end of file
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c
index 2836f7c1..b0f34741 100644
--- a/accel-pppd/ppp/ppp.c
+++ b/accel-pppd/ppp/ppp.c
@@ -11,7 +11,7 @@
#include <signal.h>
#include "linux_ppp.h"
-#include <openssl/md5.h>
+#include "crypto.h"
#include "triton.h"
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index e3baee58..bcc0a12a 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -7,7 +7,7 @@
#include <netinet/in.h>
#include "linux_ppp.h"
-#include <openssl/md5.h>
+#include "crypto.h"
#include "log.h"
#include "radius_p.h"
diff --git a/accel-pppd/radius/auth.c b/accel-pppd/radius/auth.c
index 11557a64..089f67bb 100644
--- a/accel-pppd/radius/auth.c
+++ b/accel-pppd/radius/auth.c
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
-#include <openssl/md5.h>
-#include <openssl/sha.h>
+
+#include "crypto.h"
#include "triton.h"
#include "events.h"
diff --git a/accel-pppd/radius/dm_coa.c b/accel-pppd/radius/dm_coa.c
index 10b3350e..a41388cf 100644
--- a/accel-pppd/radius/dm_coa.c
+++ b/accel-pppd/radius/dm_coa.c
@@ -9,7 +9,8 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
-#include <openssl/md5.h>
+
+#include "crypto.h"
#include "triton.h"
#include "events.h"