]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Moved TLS stack to its own library
authorMartin Willi <martin@revosec.ch>
Tue, 3 Aug 2010 13:17:40 +0000 (15:17 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 3 Aug 2010 13:39:26 +0000 (15:39 +0200)
28 files changed:
Doxyfile.in
configure.in
src/Makefile.am
src/libcharon/Makefile.am
src/libcharon/plugins/eap_tls/Makefile.am
src/libcharon/plugins/eap_tls/eap_tls.c
src/libtls/Makefile.am [new file with mode: 0644]
src/libtls/tls.c [moved from src/libcharon/plugins/eap_tls/tls/tls.c with 99% similarity]
src/libtls/tls.h [moved from src/libcharon/plugins/eap_tls/tls/tls.h with 96% similarity]
src/libtls/tls_compression.c [moved from src/libcharon/plugins/eap_tls/tls/tls_compression.c with 98% similarity]
src/libtls/tls_compression.h [moved from src/libcharon/plugins/eap_tls/tls/tls_compression.h with 99% similarity]
src/libtls/tls_crypto.c [moved from src/libcharon/plugins/eap_tls/tls/tls_crypto.c with 99% similarity]
src/libtls/tls_crypto.h [moved from src/libcharon/plugins/eap_tls/tls/tls_crypto.h with 99% similarity]
src/libtls/tls_fragmentation.c [moved from src/libcharon/plugins/eap_tls/tls/tls_fragmentation.c with 99% similarity]
src/libtls/tls_fragmentation.h [moved from src/libcharon/plugins/eap_tls/tls/tls_fragmentation.h with 99% similarity]
src/libtls/tls_handshake.h [moved from src/libcharon/plugins/eap_tls/tls/tls_handshake.h with 97% similarity]
src/libtls/tls_peer.c [moved from src/libcharon/plugins/eap_tls/tls/tls_peer.c with 99% similarity]
src/libtls/tls_peer.h [moved from src/libcharon/plugins/eap_tls/tls/tls_peer.h with 98% similarity]
src/libtls/tls_prf.c [moved from src/libcharon/plugins/eap_tls/tls/tls_prf.c with 100% similarity]
src/libtls/tls_prf.h [moved from src/libcharon/plugins/eap_tls/tls/tls_prf.h with 98% similarity]
src/libtls/tls_protection.c [moved from src/libcharon/plugins/eap_tls/tls/tls_protection.c with 99% similarity]
src/libtls/tls_protection.h [moved from src/libcharon/plugins/eap_tls/tls/tls_protection.h with 99% similarity]
src/libtls/tls_reader.c [moved from src/libcharon/plugins/eap_tls/tls/tls_reader.c with 98% similarity]
src/libtls/tls_reader.h [moved from src/libcharon/plugins/eap_tls/tls/tls_reader.h with 98% similarity]
src/libtls/tls_server.c [moved from src/libcharon/plugins/eap_tls/tls/tls_server.c with 99% similarity]
src/libtls/tls_server.h [moved from src/libcharon/plugins/eap_tls/tls/tls_server.h with 98% similarity]
src/libtls/tls_writer.c [moved from src/libcharon/plugins/eap_tls/tls/tls_writer.c with 99% similarity]
src/libtls/tls_writer.h [moved from src/libcharon/plugins/eap_tls/tls/tls_writer.h with 98% similarity]

index b79c9909d2155dde24af48552cef2286bda58c88..52e62b7670bf95599b74fbbeb1856c7da69e5a83 100644 (file)
@@ -531,6 +531,7 @@ INPUT                  = @SRC_DIR@/src/libstrongswan \
                          @SRC_DIR@/src/libhydra \
                          @SRC_DIR@/src/libcharon \
                          @SRC_DIR@/src/libsimaka \
+                         @SRC_DIR@/src/libtls \
                          @SRC_DIR@/src/libfast \
                          @SRC_DIR@/src/manager
 
index 65f45c8894db14825a1ade00e3b8879e889b87c0..f15e5d2d8d1ee06fa62cdce8712486d5a9731e32 100644 (file)
@@ -225,6 +225,10 @@ if test x$eap_sim = xtrue; then
        simaka=true;
 fi
 
+if test x$eap_tls = xtrue; then
+       tls=true;
+fi
+
 if test x$fips_prf = xtrue; then
        if test x$openssl = xfalse; then
                sha1=true;
@@ -895,6 +899,7 @@ AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
 AM_CONDITIONAL(USE_LIBCAP, test x$capabilities = xlibcap)
 AM_CONDITIONAL(USE_VSTR, test x$vstr = xtrue)
 AM_CONDITIONAL(USE_SIMAKA, test x$simaka = xtrue)
+AM_CONDITIONAL(USE_TLS, test x$tls = xtrue)
 AM_CONDITIONAL(MONOLITHIC, test x$monolithic = xtrue)
 
 dnl ==============================
@@ -955,6 +960,7 @@ AC_OUTPUT(
        src/libhydra/plugins/resolve/Makefile
        src/libfreeswan/Makefile
        src/libsimaka/Makefile
+       src/libtls/Makefile
        src/pluto/Makefile
        src/pluto/plugins/xauth/Makefile
        src/whack/Makefile
index 8d4dd2e37f1cc729cb951f1c9869bf828d829c76..0edddc9fc2dfd8d466090c7c9a1186969df0f9e1 100644 (file)
@@ -12,6 +12,10 @@ if USE_SIMAKA
   SUBDIRS += libsimaka
 endif
 
+if USE_TLS
+  SUBDIRS += libtls
+endif
+
 if USE_FILE_CONFIG
   SUBDIRS += libfreeswan starter ipsec _copyright
 endif
index 510f5e5699b8454302faedadd5d5f76c02e963e7..4681fb9641002df85651d68db31380d6ef791e34 100644 (file)
@@ -352,6 +352,13 @@ if MONOLITHIC
 endif
 endif
 
+if USE_TLS
+if MONOLITHIC
+  # otherwise this library is linked to eap_tls
+  libcharon_la_LIBADD += $(top_builddir)/src/libtls/libtls.la
+endif
+endif
+
 if USE_MEDSRV
   SUBDIRS += plugins/medsrv
   PLUGINS += medsrv
index bd8f82a6233a3a14a705e02eeae0191bb6c5cd70..29ddd822b695e4d9eea2f51ff2d8984fb564638a 100644 (file)
@@ -1,6 +1,6 @@
 
 INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libhydra \
-       -I$(top_srcdir)/src/libcharon
+       -I$(top_srcdir)/src/libcharon -I$(top_srcdir)/src/libtls
 
 AM_CFLAGS = -rdynamic
 
@@ -8,18 +8,10 @@ if MONOLITHIC
 noinst_LTLIBRARIES = libstrongswan-eap-tls.la
 else
 plugin_LTLIBRARIES = libstrongswan-eap-tls.la
+libstrongswan_eap_tls_la_LIBADD = $(top_builddir)/src/libtls/libtls.la
 endif
 
-libstrongswan_eap_tls_la_SOURCES = eap_tls_plugin.h eap_tls_plugin.c \
-       eap_tls.h eap_tls.c tls/tls.h tls/tls.c \
-       tls/tls_protection.h tls/tls_protection.c \
-       tls/tls_compression.h tls/tls_compression.c \
-       tls/tls_fragmentation.h tls/tls_fragmentation.c \
-       tls/tls_crypto.h tls/tls_crypto.c \
-       tls/tls_prf.h tls/tls_prf.c \
-       tls/tls_reader.h tls/tls_reader.c \
-       tls/tls_writer.h tls/tls_writer.c \
-       tls/tls_peer.h tls/tls_peer.c \
-       tls/tls_server.h tls/tls_server.c \
-       tls/tls_handshake.h
+libstrongswan_eap_tls_la_SOURCES = \
+       eap_tls_plugin.h eap_tls_plugin.c eap_tls.h eap_tls.c
+
 libstrongswan_eap_tls_la_LDFLAGS = -module -avoid-version
index cf42949703228e2ffc2432954d18a6e548dbb73b..453a4cc057941fac39a018c601b6ff6ba3019e4c 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "eap_tls.h"
 
-#include "tls/tls.h"
+#include <tls.h>
 
 #include <daemon.h>
 #include <library.h>
diff --git a/src/libtls/Makefile.am b/src/libtls/Makefile.am
new file mode 100644 (file)
index 0000000..d61cd84
--- /dev/null
@@ -0,0 +1,15 @@
+
+INCLUDES = -I$(top_srcdir)/src/libstrongswan
+
+noinst_LTLIBRARIES = libtls.la
+libtls_la_SOURCES = \
+       tls_protection.h tls_protection.c \
+       tls_compression.h tls_compression.c \
+       tls_fragmentation.h tls_fragmentation.c \
+       tls_crypto.h tls_crypto.c \
+       tls_prf.h tls_prf.c \
+       tls_reader.h tls_reader.c \
+       tls_writer.h tls_writer.c \
+       tls_peer.h tls_peer.c \
+       tls_server.h tls_server.c \
+       tls_handshake.h tls.h tls.c
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls.c
rename to src/libtls/tls.c
index ab03037fae01c9b7107ed4da26f62e7f7b2f38b7..4384c07497d9a5808f79a310d4d28a780df8961e 100644 (file)
@@ -22,8 +22,6 @@
 #include "tls_server.h"
 #include "tls_peer.h"
 
-#include <daemon.h>
-
 ENUM_BEGIN(tls_version_names, SSL_2_0, SSL_2_0,
        "SSLv2");
 ENUM_NEXT(tls_version_names, SSL_3_0, TLS_1_2, SSL_2_0,
similarity index 96%
rename from src/libcharon/plugins/eap_tls/tls/tls.h
rename to src/libtls/tls.h
index 283f591e74e4ed5f1c57a19e0b42aad6a8f84c5e..67ee74230433e5c9b03779be061788bcde3d9cee 100644 (file)
  */
 
 /**
- * @defgroup tlsgroup tls
- * @{ @ingroup eap_tls
+ * @defgroup libtls libtls
+ *
+ * @addtogroup libtls
+ * TLS implementation on top of libstrongswan
  *
  * @defgroup tls tls
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_H_
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_compression.c
rename to src/libtls/tls_compression.c
index 4535580843cf1ca73cbe5f3658454bdcbe786a1e..02a3578e375659ad3e2e892fbd8eddc89cf3d9ee 100644 (file)
@@ -15,8 +15,6 @@
 
 #include "tls_compression.h"
 
-#include <daemon.h>
-
 typedef struct private_tls_compression_t private_tls_compression_t;
 
 /**
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_compression.h
rename to src/libtls/tls_compression.h
index a6154300410105986ac09dda200d04c40e7ed2a1..bd27ab5d7847a0b914ad6580570a3f83adfeca69 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_compression tls_compression
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_COMPRESSION_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_crypto.c
rename to src/libtls/tls_crypto.c
index f8894629fb7196941d200ca8b9f5f30a103b79a9..085c11e2d7f015ed65314fd622146e877bef570b 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "tls_crypto.h"
 
-#include <daemon.h>
+#include <debug.h>
 
 typedef struct private_tls_crypto_t private_tls_crypto_t;
 
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_crypto.h
rename to src/libtls/tls_crypto.h
index 69b8da7420abc608f87e0391726fcd37dc364a99..0d2588aa63a72fdf8f6e214679381d29f16dd54d 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_crypto tls_crypto
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_CRYPTO_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_fragmentation.c
rename to src/libtls/tls_fragmentation.c
index 7a99c92351776e3cf064bf33f192122a6278de2c..a8d8aa289ee6e1ecc66bfc39098b757a74e87aad 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "tls_reader.h"
 
-#include <daemon.h>
+#include <debug.h>
 
 typedef struct private_tls_fragmentation_t private_tls_fragmentation_t;
 
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_fragmentation.h
rename to src/libtls/tls_fragmentation.h
index 61bf5488e248744ed99e33476a9c2fe630916ed7..e141a334bcfd1834307184417fc21e5f9b88b12a 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_fragmentation tls_fragmentation
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_FRAGMENTATION_H_
similarity index 97%
rename from src/libcharon/plugins/eap_tls/tls/tls_handshake.h
rename to src/libtls/tls_handshake.h
index 1139740427a60c2956cfb7c5b6ad715033ac1194..c0798625e830a493af8fc0ca70f98d05596a264b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010 revosec AG
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_handshake tls_handshake
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_HANDSHAKE_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_peer.c
rename to src/libtls/tls_peer.c
index 95973598b00de0c40adcd6c4128ee62c22fcbd75..c87002fc797ff61fb81881dde6ea11114a97ef1c 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "tls_peer.h"
 
-#include <daemon.h>
+#include <debug.h>
 
 #include <time.h>
 
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_peer.h
rename to src/libtls/tls_peer.h
index 7857d32612fa2ea4c5380d7af3160ada0ce77d12..eb97c97e4f54307646ae348d8f2e12f79ba6d55e 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_peer tls_peer
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_PEER_H_
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_prf.h
rename to src/libtls/tls_prf.h
index 7326be98cf9b688fa2bbc098964cd4584bde7acb..811ce2d0532b88298b6d0e51bb167b3bfbe6baf8 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_prf tls_prf
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_PRF_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_protection.c
rename to src/libtls/tls_protection.c
index 75fae0a714ce378c1a545daab4a11a098637f8fd..5ea0a831260027c2ef088acc46890345c1d66cfb 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "tls_protection.h"
 
-#include <daemon.h>
+#include <debug.h>
 
 typedef struct private_tls_protection_t private_tls_protection_t;
 
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_protection.h
rename to src/libtls/tls_protection.h
index fab91378893f835f733536f6a446675186542578..aa7681bd53258a24a379a56647f4f3040702dbb7 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_protection tls_protection
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_PROTECTION_H_
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_reader.c
rename to src/libtls/tls_reader.c
index b21eb04f3c868cca60feef89438f32a0c3ea0088..ee537be719119c351ba86fbbed55e06bed1eccd9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010 revosec AG
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -15,7 +15,7 @@
 
 #include "tls_reader.h"
 
-#include <daemon.h>
+#include <debug.h>
 
 typedef struct private_tls_reader_t private_tls_reader_t;
 
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_reader.h
rename to src/libtls/tls_reader.h
index a8917dfb6e4e135b2ca2737c099f906f14abf6a1..a8978b486952614e689ed72c01123c95ddeb738f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010 revosec AG
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_reader tls_reader
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_READER_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_server.c
rename to src/libtls/tls_server.c
index 60c62684e42132a96ddfbb848677d11ecc00833a..c0c0cc45fb4cfd089153fa4f7822fdd08db4ee2e 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <time.h>
 
-#include <daemon.h>
+#include <debug.h>
 
 typedef struct private_tls_server_t private_tls_server_t;
 
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_server.h
rename to src/libtls/tls_server.h
index 3fddea22550dd8c7f28bcbd5c9391a3eab8704e4..6dc26cd3fa209e61e3b7ca2e220d42ce545069fb 100644 (file)
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_server tls_server
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_SERVER_H_
similarity index 99%
rename from src/libcharon/plugins/eap_tls/tls/tls_writer.c
rename to src/libtls/tls_writer.c
index f1d9d790e6751eb670b8d541525b5779ae5b3def..235dc2cdffd87b7449436ff210c74b0391172f90 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010 revosec AG
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
similarity index 98%
rename from src/libcharon/plugins/eap_tls/tls/tls_writer.h
rename to src/libtls/tls_writer.h
index ce8ba6a6ea19af36cfa5a332c0b48de289f60395..e6522dbfb46c349004d5f3e3558237a7d5bbf0f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2010 revosec AG
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -15,7 +15,7 @@
 
 /**
  * @defgroup tls_writer tls_writer
- * @{ @ingroup tls
+ * @{ @ingroup libtls
  */
 
 #ifndef TLS_WRITER_H_