aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pluto/ca.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pluto/ca.c b/src/pluto/ca.c
index 878cf86c8..528531447 100644
--- a/src/pluto/ca.c
+++ b/src/pluto/ca.c
@@ -131,11 +131,21 @@ match_requested_ca(generalName_t *requested_ca, chunk_t our_ca, int *our_pathlen
if (trusted_ca(our_ca, requested_ca->name, &pathlen)
&& pathlen < *our_pathlen)
+ {
*our_pathlen = pathlen;
+ }
requested_ca = requested_ca->next;
}
- return *our_pathlen <= MAX_CA_PATH_LEN;
+ if (*our_pathlen > MAX_CA_PATH_LEN)
+ {
+ *our_pathlen = MAX_CA_PATH_LEN;
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
}
/*