From 0f9f19f54e90d8999ef24bf8084b216fc21a55d2 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Fri, 17 Aug 2007 07:20:27 +0000 Subject: [PATCH] fixed maximum path length info in match_requested_ca() --- src/pluto/ca.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; + } } /*