summaryrefslogtreecommitdiff
path: root/src/libstrongswan/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/utils')
-rw-r--r--src/libstrongswan/utils/fetcher.c3
-rw-r--r--src/libstrongswan/utils/host.c2
-rw-r--r--src/libstrongswan/utils/identification.c16
3 files changed, 17 insertions, 4 deletions
diff --git a/src/libstrongswan/utils/fetcher.c b/src/libstrongswan/utils/fetcher.c
index 6165cc1e1..7a06999aa 100644
--- a/src/libstrongswan/utils/fetcher.c
+++ b/src/libstrongswan/utils/fetcher.c
@@ -25,6 +25,9 @@
#endif /* LIBCURL */
#ifdef LIBLDAP
+#ifndef LDAP_DEPRECATED
+#define LDAP_DEPRECATED 1
+#endif
#include <ldap.h>
#endif /* LIBLDAP */
diff --git a/src/libstrongswan/utils/host.c b/src/libstrongswan/utils/host.c
index 8cbfd6ab8..68e9c9500 100644
--- a/src/libstrongswan/utils/host.c
+++ b/src/libstrongswan/utils/host.c
@@ -325,7 +325,7 @@ static bool equals(private_host_t *this, private_host_t *other)
{
if (!ip_equals(this, other))
{
- return FAILED;
+ return FALSE;
}
switch (this->address.sa_family)
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c
index 341af39c0..673cbb828 100644
--- a/src/libstrongswan/utils/identification.c
+++ b/src/libstrongswan/utils/identification.c
@@ -738,8 +738,15 @@ static bool contains_wildcards(private_identification_t *this)
*/
static bool equals_binary(private_identification_t *this, private_identification_t *other)
{
- return this->type == other->type &&
- chunk_equals(this->encoded, other->encoded);
+ if (this->type == other->type)
+ {
+ if (this->type == ID_ANY)
+ {
+ return TRUE;
+ }
+ return chunk_equals(this->encoded, other->encoded);
+ }
+ return FALSE;
}
/**
@@ -956,7 +963,10 @@ static identification_t *clone_(private_identification_t *this)
private_identification_t *clone = identification_create();
clone->type = this->type;
- clone->encoded = chunk_clone(this->encoded);
+ if (this->encoded.len)
+ {
+ clone->encoded = chunk_clone(this->encoded);
+ }
clone->public.equals = this->public.equals;
clone->public.matches = this->public.matches;