aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-08-13 10:39:34 +0200
committerTobias Brunner <tobias@strongswan.org>2012-08-13 10:45:39 +0200
commite4ef4c9877d5ccb773ace0edf655351428c39572 (patch)
tree9b3349ad0cafc1acebafb2ff2dc78a031f28c555 /src/libstrongswan
parent000668d3081422a3ac06fe16f038a4b1d6700f96 (diff)
parent6fbf4472ea785f3c75d278b1a7400534989bf26a (diff)
downloadstrongswan-e4ef4c9877d5ccb773ace0edf655351428c39572.tar.bz2
strongswan-e4ef4c9877d5ccb773ace0edf655351428c39572.tar.xz
Merge branch 'android-ndk'
This branch comes with some preliminary changes for the user-land IPsec implementation and the Android App. One important change is that the UDP ports used by the socket-default plugin were made configurable (either via ./configure or strongswan.conf). Also, the plugin does randomly allocate a port if it is configured to 0, which is useful for client implementations. A consequence of these changes is that the local UDP port used when creating ike_cfg_t objects has to be fetched from the socket.
Diffstat (limited to 'src/libstrongswan')
-rw-r--r--src/libstrongswan/Android.mk2
-rw-r--r--src/libstrongswan/debug.c2
-rw-r--r--src/libstrongswan/debug.h2
-rw-r--r--src/libstrongswan/plugins/plugin_loader.c21
-rw-r--r--src/libstrongswan/settings.c11
5 files changed, 29 insertions, 9 deletions
diff --git a/src/libstrongswan/Android.mk b/src/libstrongswan/Android.mk
index ae5a7733e..8cba58816 100644
--- a/src/libstrongswan/Android.mk
+++ b/src/libstrongswan/Android.mk
@@ -58,7 +58,7 @@ LOCAL_SRC_FILES += $(call add_plugin, nonce)
LOCAL_SRC_FILES += $(call add_plugin, openssl)
ifneq ($(call plugin_enabled, openssl),)
-LOCAL_C_INCLUDES += external/openssl/include
+LOCAL_C_INCLUDES += $(openssl_PATH)
LOCAL_SHARED_LIBRARIES += libcrypto
endif
diff --git a/src/libstrongswan/debug.c b/src/libstrongswan/debug.c
index 985ce6a2a..e8c9e6b98 100644
--- a/src/libstrongswan/debug.c
+++ b/src/libstrongswan/debug.c
@@ -34,6 +34,7 @@ ENUM(debug_names, DBG_DMN, DBG_LIB,
"PTS",
"TLS",
"APP",
+ "ESP",
"LIB",
);
@@ -54,6 +55,7 @@ ENUM(debug_lower_names, DBG_DMN, DBG_LIB,
"pts",
"tls",
"app",
+ "esp",
"lib",
);
diff --git a/src/libstrongswan/debug.h b/src/libstrongswan/debug.h
index 65e55a639..ff4b4a1e9 100644
--- a/src/libstrongswan/debug.h
+++ b/src/libstrongswan/debug.h
@@ -64,6 +64,8 @@ enum debug_t {
DBG_TLS,
/** applications other than daemons */
DBG_APP,
+ /** libipsec */
+ DBG_ESP,
/** libstrongswan */
DBG_LIB,
/** number of groups */
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index d5777e35b..95a0bfc02 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -250,8 +250,11 @@ static bool load_plugin(private_plugin_loader_t *this, char *name, char *file,
this->plugins->insert_last(this->plugins, entry);
return TRUE;
case NOT_FOUND:
- /* try to load the plugin from a file */
- break;
+ if (file)
+ { /* try to load the plugin from a file */
+ break;
+ }
+ /* fall-through */
default:
return FALSE;
}
@@ -651,16 +654,18 @@ METHOD(plugin_loader_t, load_plugins, bool,
char *token;
bool critical_failed = FALSE;
+#ifdef PLUGINDIR
if (path == NULL)
{
path = PLUGINDIR;
}
+#endif /* PLUGINDIR */
enumerator = enumerator_create_token(list, " ", " ");
while (!critical_failed && enumerator->enumerate(enumerator, &token))
{
bool critical = FALSE;
- char file[PATH_MAX];
+ char buf[PATH_MAX], *file = NULL;
int len;
token = strdup(token);
@@ -675,10 +680,14 @@ METHOD(plugin_loader_t, load_plugins, bool,
free(token);
continue;
}
- if (snprintf(file, sizeof(file), "%s/libstrongswan-%s.so",
- path, token) >= sizeof(file))
+ if (path)
{
- return FALSE;
+ if (snprintf(buf, sizeof(buf), "%s/libstrongswan-%s.so",
+ path, token) >= sizeof(buf))
+ {
+ return FALSE;
+ }
+ file = buf;
}
if (!load_plugin(this, token, file, critical) && critical)
{
diff --git a/src/libstrongswan/settings.c b/src/libstrongswan/settings.c
index b26fbebb4..8977cd9ed 100644
--- a/src/libstrongswan/settings.c
+++ b/src/libstrongswan/settings.c
@@ -1117,14 +1117,21 @@ static bool load_files_internal(private_settings_t *this, section_t *parent,
char *pattern, bool merge)
{
char *text;
- linked_list_t *contents = linked_list_create();
- section_t *section = section_create(NULL);
+ linked_list_t *contents;
+ section_t *section;
if (pattern == NULL)
{
+#ifdef STRONGSWAN_CONF
pattern = STRONGSWAN_CONF;
+#else
+ return FALSE;
+#endif
}
+ contents = linked_list_create();
+ section = section_create(NULL);
+
if (!parse_files(contents, NULL, 0, pattern, section))
{
contents->destroy_function(contents, (void*)free);