aboutsummaryrefslogtreecommitdiffstats
path: root/src/starter/starterstroke.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-05-14 17:36:46 +0200
committerTobias Brunner <tobias@strongswan.org>2012-06-11 17:33:30 +0200
commite838c39ba965787395ee05f64e78990398d3624c (patch)
tree5f4b26e8d75e3f97621021bbb45fec2ab97f0a69 /src/starter/starterstroke.c
parent041e763b7741906f18ec38bcb64fbabe11256080 (diff)
downloadstrongswan-e838c39ba965787395ee05f64e78990398d3624c.tar.bz2
strongswan-e838c39ba965787395ee05f64e78990398d3624c.tar.xz
starter: Parse authby as string.
Diffstat (limited to 'src/starter/starterstroke.c')
-rw-r--r--src/starter/starterstroke.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/starter/starterstroke.c b/src/starter/starterstroke.c
index bef7ede9a..6cd9b6c69 100644
--- a/src/starter/starterstroke.c
+++ b/src/starter/starterstroke.c
@@ -270,19 +270,22 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn)
starter_stroke_add_end(&msg, &msg.add_conn.me, &conn->left);
starter_stroke_add_end(&msg, &msg.add_conn.other, &conn->right);
- if (!msg.add_conn.me.auth && !msg.add_conn.other.auth)
+ if (!msg.add_conn.me.auth && !msg.add_conn.other.auth &&
+ conn->authby)
{ /* leftauth/rightauth not set, use legacy options */
- if (conn->policy & POLICY_PUBKEY)
+ if (streq(conn->authby, "rsa") || streq(conn->authby, "rsasig") ||
+ streq(conn->authby, "ecdsa") || streq(conn->authby, "ecdsasig") ||
+ streq(conn->authby, "pubkey"))
{
msg.add_conn.me.auth = push_string(&msg, "pubkey");
msg.add_conn.other.auth = push_string(&msg, "pubkey");
}
- else if (conn->policy & POLICY_PSK)
+ else if (streq(conn->authby, "secret") || streq(conn->authby, "psk"))
{
msg.add_conn.me.auth = push_string(&msg, "psk");
msg.add_conn.other.auth = push_string(&msg, "psk");
}
- else if (conn->policy & POLICY_XAUTH_RSASIG)
+ else if (streq(conn->authby, "xauthrsasig"))
{
msg.add_conn.me.auth = push_string(&msg, "pubkey");
msg.add_conn.other.auth = push_string(&msg, "pubkey");
@@ -295,7 +298,7 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn)
msg.add_conn.me.auth2 = push_string(&msg, "xauth");
}
}
- else if (conn->policy & POLICY_XAUTH_PSK)
+ else if (streq(conn->authby, "xauthpsk"))
{
msg.add_conn.me.auth = push_string(&msg, "psk");
msg.add_conn.other.auth = push_string(&msg, "psk");