Accept a xauth backend name appended to left/rightauth
authorMartin Willi <martin@revosec.ch>
Thu, 8 Dec 2011 15:57:38 +0000 (16:57 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:15 +0000 (17:31 +0100)
src/libcharon/plugins/stroke/stroke_config.c

index f1af65e..fec28c1 100644 (file)
@@ -469,8 +469,15 @@ static auth_cfg_t *build_auth_cfg(private_stroke_config_t *this,
        {
                cfg->add(cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK);
        }
-       else if (streq(auth, "xauth"))
+       else if (strneq(auth, "xauth", 5))
        {
+               char *pos;
+
+               pos = strchr(auth, '-');
+               if (pos)
+               {
+                       cfg->add(cfg, AUTH_RULE_XAUTH_BACKEND, strdup(++pos));
+               }
                cfg->add(cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_XAUTH);
        }
        else if (strneq(auth, "eap", 3))