summaryrefslogtreecommitdiff
path: root/programs/pluto
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2006-06-26 11:35:51 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2006-06-26 11:35:51 +0000
commit6bdb8dc1a62c9bb4b0fd7e19e5f2b63357029c9d (patch)
tree7047fbf7a1a0ae2a3fa7b61e0d444b8648e4e752 /programs/pluto
parent55fc0aea7f632d151b076c636752f0fa712cde86 (diff)
downloadvyos-strongswan-6bdb8dc1a62c9bb4b0fd7e19e5f2b63357029c9d.tar.gz
vyos-strongswan-6bdb8dc1a62c9bb4b0fd7e19e5f2b63357029c9d.zip
Update to 2.7.2.
Diffstat (limited to 'programs/pluto')
-rw-r--r--programs/pluto/connections.c11
-rw-r--r--programs/pluto/demux.c5
-rw-r--r--programs/pluto/fetch.c6
-rw-r--r--programs/pluto/kernel.c4
-rw-r--r--programs/pluto/log.c6
-rw-r--r--programs/pluto/rcv_whack.c72
-rw-r--r--programs/pluto/state.c4
-rw-r--r--programs/pluto/vendor.c9
-rw-r--r--programs/pluto/vendor.h7
9 files changed, 87 insertions, 37 deletions
diff --git a/programs/pluto/connections.c b/programs/pluto/connections.c
index 263bdbd1e..6cf6a6a8b 100644
--- a/programs/pluto/connections.c
+++ b/programs/pluto/connections.c
@@ -11,7 +11,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: connections.c,v 1.42 2006/04/22 21:59:20 as Exp $
+ * RCSID $Id: connections.c,v 1.43 2006/04/29 18:16:02 as Exp $
*/
#include <string.h>
@@ -4022,7 +4022,7 @@ show_connections_status(bool all, const char *name)
/* sort it! */
qsort(array, count, sizeof(struct connection *), connection_compare_qsort);
- for (i=0; i<count; i++)
+ for (i = 0; i < count; i++)
{
const char *ifn;
char instance[1 + 10 + 1];
@@ -4076,7 +4076,7 @@ show_connections_status(bool all, const char *name)
if (c->spd.that.groups != NULL)
{
char buf[BUF_LEN];
-
+
format_groups(c->spd.that.groups, buf, BUF_LEN);
whack_log(RC_COMMENT
, "\"%s\"%s: groups: %s"
@@ -4097,7 +4097,7 @@ show_connections_status(bool all, const char *name)
, (unsigned long) c->sa_keying_tries);
/* show DPD parameters if defined */
-
+
if (c->dpd_action != DPD_ACTION_NONE)
whack_log(RC_COMMENT
, "\"%s\"%s: dpd_action: %s;"
@@ -4141,6 +4141,9 @@ show_connections_status(bool all, const char *name)
kernel_alg_show_connection(c, instance);
}
}
+ if (count > 0)
+ whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
+
pfree(array);
}
diff --git a/programs/pluto/demux.c b/programs/pluto/demux.c
index 2f8fb9a8f..db7f1c4a6 100644
--- a/programs/pluto/demux.c
+++ b/programs/pluto/demux.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: demux.c,v 1.13 2005/02/18 21:08:59 as Exp $
+ * RCSID $Id: demux.c,v 1.14 2006/06/22 11:58:25 as Exp $
*/
/* Ordering Constraints on Payloads
@@ -2397,7 +2397,8 @@ complete_state_transition(struct msg_digest **mdp, stf_status result)
* whatever retrying was in place, remains in place.
*/
whack_log(RC_NOTIFICATION + md->note
- , "%s: %s", enum_name(&state_names, st->st_state)
+ , "%s: %s"
+ , enum_name(&state_names, (st == NULL)? STATE_MAIN_R0:st->st_state)
, enum_name(&notification_names, md->note));
SEND_NOTIFICATION(md->note);
diff --git a/programs/pluto/fetch.c b/programs/pluto/fetch.c
index 075b88fd2..4bfb6031b 100644
--- a/programs/pluto/fetch.c
+++ b/programs/pluto/fetch.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: fetch.c,v 1.11 2005/11/25 10:08:00 as Exp $
+ * RCSID $Id: fetch.c,v 1.12 2006/05/16 14:19:27 as Exp $
*/
#include <stdlib.h>
@@ -339,7 +339,7 @@ fetch_curl(char *url, chunk_t *blob)
}
curl_easy_cleanup(curl);
/* not using freeanychunk because of realloc (no leak detective) */
- free(response.ptr);
+ curl_free(response.ptr);
}
return strlen(errorbuffer) > 0 ? "libcurl error" : NULL;
#else /* !LIBCURL */
@@ -728,7 +728,7 @@ fetch_ocsp_status(ocsp_location_t* location)
curl_easy_cleanup(curl);
pfree(uri);
/* not using freeanychunk because of realloc (no leak detective) */
- free(response.ptr);
+ curl_free(response.ptr);
}
freeanychunk(location->nonce);
freeanychunk(request);
diff --git a/programs/pluto/kernel.c b/programs/pluto/kernel.c
index 5d7c5f78a..d2070c0d4 100644
--- a/programs/pluto/kernel.c
+++ b/programs/pluto/kernel.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: kernel.c,v 1.25 2006/04/17 14:58:09 as Exp $
+ * RCSID $Id: kernel.c,v 1.26 2006/04/29 18:16:02 as Exp $
*/
#include <stddef.h>
@@ -934,6 +934,8 @@ show_shunt_status(void)
, ourst, ourport, hist, hisport, sat, bs->transport_proto
, prio, bs->why);
}
+ if (bare_shunts != NULL)
+ whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
}
/* Setup an IPsec route entry.
diff --git a/programs/pluto/log.c b/programs/pluto/log.c
index 137e92980..73ffceccd 100644
--- a/programs/pluto/log.c
+++ b/programs/pluto/log.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: log.c,v 1.7 2005/07/11 18:33:45 as Exp $
+ * RCSID $Id: log.c,v 1.8 2006/04/29 18:16:02 as Exp $
*/
#include <stdio.h>
@@ -770,13 +770,11 @@ show_status(bool all, const char *name)
show_ifaces_status();
show_myid_status();
show_debug_status();
+ whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
}
- whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
show_connections_status(all, name);
- whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
show_states_status(name);
#ifdef KLIPS
- whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
show_shunt_status();
#endif
}
diff --git a/programs/pluto/rcv_whack.c b/programs/pluto/rcv_whack.c
index 164a4f249..99c377765 100644
--- a/programs/pluto/rcv_whack.c
+++ b/programs/pluto/rcv_whack.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: rcv_whack.c,v 1.17 2005/12/25 12:41:23 as Exp $
+ * RCSID $Id: rcv_whack.c,v 1.18 2006/05/25 11:33:57 as Exp $
*/
#include <stdio.h>
@@ -557,7 +557,14 @@ whack_handle(int whackctlfd)
if (msg.whack_route)
{
if (!listening)
+ {
whack_log(RC_DEAF, "need --listen before --route");
+ }
+ if (msg.name == NULL)
+ {
+ whack_log(RC_UNKNOWN_NAME
+ , "whack --route requires a connection name");
+ }
else
{
struct connection *c = con_by_name(msg.name, TRUE);
@@ -579,37 +586,54 @@ whack_handle(int whackctlfd)
if (msg.whack_unroute)
{
- struct connection *c = con_by_name(msg.name, TRUE);
-
- if (c != NULL)
+ if (msg.name == NULL)
{
- struct spd_route *sr;
- int fail = 0;
-
- set_cur_connection(c);
+ whack_log(RC_UNKNOWN_NAME
+ , "whack --unroute requires a connection name");
+ }
+ else
+ {
+ struct connection *c = con_by_name(msg.name, TRUE);
- for (sr = &c->spd; sr != NULL; sr = sr->next)
+ if (c != NULL)
{
- if (sr->routing >= RT_ROUTED_TUNNEL)
- fail++;
+ struct spd_route *sr;
+ int fail = 0;
+
+ set_cur_connection(c);
+
+ for (sr = &c->spd; sr != NULL; sr = sr->next)
+ {
+ if (sr->routing >= RT_ROUTED_TUNNEL)
+ fail++;
+ }
+ if (fail > 0)
+ whack_log(RC_RTBUSY, "cannot unroute: route busy");
+ else if (c->policy & POLICY_GROUP)
+ unroute_group(c);
+ else
+ unroute_connection(c);
+ reset_cur_connection();
}
- if (fail > 0)
- whack_log(RC_RTBUSY, "cannot unroute: route busy");
- else if (c->policy & POLICY_GROUP)
- unroute_group(c);
- else
- unroute_connection(c);
- reset_cur_connection();
}
}
if (msg.whack_initiate)
{
if (!listening)
+ {
whack_log(RC_DEAF, "need --listen before --initiate");
+ }
+ else if (msg.name == NULL)
+ {
+ whack_log(RC_UNKNOWN_NAME
+ , "whack --initiate requires a connection name");
+ }
else
+ {
initiate_connection(msg.name
, msg.whack_async? NULL_FD : dup_any(whackfd));
+ }
}
if (msg.whack_oppo_initiate)
@@ -623,7 +647,17 @@ whack_handle(int whackctlfd)
}
if (msg.whack_terminate)
- terminate_connection(msg.name);
+ {
+ if (msg.name == NULL)
+ {
+ whack_log(RC_UNKNOWN_NAME
+ , "whack --terminate requires a connection name");
+ }
+ else
+ {
+ terminate_connection(msg.name);
+ }
+ }
if (msg.whack_status)
show_status(msg.whack_statusall, msg.name);
diff --git a/programs/pluto/state.c b/programs/pluto/state.c
index 5957654e3..0781d2eb3 100644
--- a/programs/pluto/state.c
+++ b/programs/pluto/state.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: state.c,v 1.12 2006/04/03 15:49:36 as Exp $
+ * RCSID $Id: state.c,v 1.13 2006/04/29 18:16:02 as Exp $
*/
#include <stdio.h>
@@ -902,6 +902,8 @@ show_states_status(const char *name)
if (IS_PHASE1(st->st_state))
show_pending_phase2(st->st_connection->host_pair, st);
}
+ if (count > 0)
+ whack_log(RC_COMMENT, BLANK_FORMAT); /* spacer */
/* free the array */
pfree(array);
diff --git a/programs/pluto/vendor.c b/programs/pluto/vendor.c
index 51931c239..3a8ac15a9 100644
--- a/programs/pluto/vendor.c
+++ b/programs/pluto/vendor.c
@@ -11,7 +11,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: vendor.c,v 1.35 2006/04/12 16:44:28 as Exp $
+ * RCSID $Id: vendor.c,v 1.38 2006/06/04 09:42:35 as Exp $
*/
#include <stdlib.h>
@@ -198,7 +198,12 @@ static struct vid_struct _vid_tab[] = {
/*
* strongSwan
*/
- DEC_MD5_VID(STRONGSWAN, "strongSwan 2.7.0")
+ DEC_MD5_VID(STRONGSWAN_4_0_0, "strongSwan 4.0.0")
+ DEC_MD5_VID(STRONGSWAN_4_0_1, "strongSwan 4.0.1")
+
+ DEC_MD5_VID(STRONGSWAN, "strongSwan 2.7.2")
+ DEC_MD5_VID(STRONGSWAN_2_7_1, "strongSwan 2.7.1")
+ DEC_MD5_VID(STRONGSWAN_2_7_0, "strongSwan 2.7.0")
DEC_MD5_VID(STRONGSWAN_2_6_4, "strongSwan 2.6.4")
DEC_MD5_VID(STRONGSWAN_2_6_3, "strongSwan 2.6.3")
DEC_MD5_VID(STRONGSWAN_2_6_2, "strongSwan 2.6.2")
diff --git a/programs/pluto/vendor.h b/programs/pluto/vendor.h
index d6b414be2..e0c3a5f30 100644
--- a/programs/pluto/vendor.h
+++ b/programs/pluto/vendor.h
@@ -11,7 +11,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: vendor.h,v 1.30 2006/04/12 16:44:28 as Exp $
+ * RCSID $Id: vendor.h,v 1.33 2006/06/04 09:42:35 as Exp $
*/
#ifndef _VENDOR_H_
@@ -76,6 +76,11 @@ enum known_vendorid {
VID_STRONGSWAN_2_6_2 = 55,
VID_STRONGSWAN_2_6_3 = 56,
VID_STRONGSWAN_2_6_4 = 57,
+ VID_STRONGSWAN_2_7_0 = 58,
+ VID_STRONGSWAN_2_7_1 = 59,
+
+ VID_STRONGSWAN_4_0_0 = 70,
+ VID_STRONGSWAN_4_0_1 = 71,
/* 101 - 200 : NAT-Traversal */
VID_NATT_STENBERG_01 =101,