]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-nm: Correctly set remote auth class for PSK authentication
authorTobias Brunner <tobias@strongswan.org>
Fri, 20 Mar 2020 14:53:37 +0000 (15:53 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 20 Mar 2020 15:06:12 +0000 (16:06 +0100)
Fixes: bc3eda99bac0 ("charon-nm: Add support for EAP-TLS")
src/charon-nm/nm/nm_service.c

index 1dcadb0411eb5507198a2eca6d6225d3e6d54473..dba12764d1a3edab93ab64b95836c9a9348099ff 100644 (file)
@@ -605,7 +605,6 @@ static gboolean connect_(NMVpnServicePlugin *plugin, NMConnection *connection,
        traffic_selector_t *ts;
        ike_sa_t *ike_sa;
        auth_cfg_t *auth;
-       auth_class_t auth_class = AUTH_CLASS_EAP;
        certificate_t *cert = NULL;
        x509_t *x509;
        bool loose_gateway_id = FALSE;
@@ -799,7 +798,7 @@ static gboolean connect_(NMVpnServicePlugin *plugin, NMConnection *connection,
        }
 
        auth = auth_cfg_create();
-       if (auth_class == AUTH_CLASS_PSK)
+       if (streq(method, "psk"))
        {
                auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK);
        }