Added an XAUTH identity to use or require for XAuth authentication
authorMartin Willi <martin@revosec.ch>
Thu, 15 Dec 2011 10:58:26 +0000 (11:58 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:23 +0000 (17:31 +0100)
src/libstrongswan/credentials/auth_cfg.c
src/libstrongswan/credentials/auth_cfg.h

index e2cea07..0646b0e 100644 (file)
@@ -39,6 +39,7 @@ ENUM(auth_rule_names, AUTH_RULE_IDENTITY, AUTH_HELPER_REVOCATION_CERT,
        "RULE_EAP_TYPE",
        "RULE_EAP_VENDOR",
        "RULE_XAUTH_BACKEND",
+       "RULE_XAUTH_IDENTITY",
        "RULE_CA_CERT",
        "RULE_IM_CERT",
        "RULE_SUBJECT_CERT",
@@ -144,6 +145,7 @@ static void destroy_entry_value(entry_t *entry)
                case AUTH_RULE_EAP_IDENTITY:
                case AUTH_RULE_AAA_IDENTITY:
                case AUTH_RULE_GROUP:
+               case AUTH_RULE_XAUTH_IDENTITY:
                {
                        identification_t *id = (identification_t*)entry->value;
                        id->destroy(id);
@@ -209,6 +211,7 @@ static void replace(private_auth_cfg_t *this, entry_enumerator_t *enumerator,
                        case AUTH_RULE_EAP_IDENTITY:
                        case AUTH_RULE_AAA_IDENTITY:
                        case AUTH_RULE_XAUTH_BACKEND:
+                       case AUTH_RULE_XAUTH_IDENTITY:
                        case AUTH_RULE_GROUP:
                        case AUTH_RULE_CA_CERT:
                        case AUTH_RULE_IM_CERT:
@@ -278,6 +281,7 @@ METHOD(auth_cfg_t, get, void*,
                case AUTH_RULE_EAP_IDENTITY:
                case AUTH_RULE_AAA_IDENTITY:
                case AUTH_RULE_XAUTH_BACKEND:
+               case AUTH_RULE_XAUTH_IDENTITY:
                case AUTH_RULE_GROUP:
                case AUTH_RULE_CA_CERT:
                case AUTH_RULE_IM_CERT:
@@ -319,6 +323,7 @@ static void add(private_auth_cfg_t *this, auth_rule_t type, ...)
                case AUTH_RULE_EAP_IDENTITY:
                case AUTH_RULE_AAA_IDENTITY:
                case AUTH_RULE_XAUTH_BACKEND:
+               case AUTH_RULE_XAUTH_IDENTITY:
                case AUTH_RULE_GROUP:
                case AUTH_RULE_CA_CERT:
                case AUTH_RULE_IM_CERT:
@@ -440,6 +445,7 @@ METHOD(auth_cfg_t, complies, bool,
                        case AUTH_RULE_IDENTITY:
                        case AUTH_RULE_EAP_IDENTITY:
                        case AUTH_RULE_AAA_IDENTITY:
+                       case AUTH_RULE_XAUTH_IDENTITY:
                        {
                                identification_t *id1, *id2;
 
@@ -661,6 +667,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
                                case AUTH_RULE_EAP_IDENTITY:
                                case AUTH_RULE_AAA_IDENTITY:
                                case AUTH_RULE_GROUP:
+                               case AUTH_RULE_XAUTH_IDENTITY:
                                {
                                        identification_t *id = (identification_t*)value;
 
@@ -754,6 +761,7 @@ static bool equals(private_auth_cfg_t *this, private_auth_cfg_t *other)
                                        case AUTH_RULE_EAP_IDENTITY:
                                        case AUTH_RULE_AAA_IDENTITY:
                                        case AUTH_RULE_GROUP:
+                                       case AUTH_RULE_XAUTH_IDENTITY:
                                        {
                                                identification_t *id1, *id2;
 
@@ -837,6 +845,7 @@ METHOD(auth_cfg_t, clone_, auth_cfg_t*,
                        case AUTH_RULE_EAP_IDENTITY:
                        case AUTH_RULE_AAA_IDENTITY:
                        case AUTH_RULE_GROUP:
+                       case AUTH_RULE_XAUTH_IDENTITY:
                        {
                                identification_t *id = (identification_t*)entry->value;
                                clone->add(clone, entry->type, id->clone(id));
index 3e0fc73..fbc4b6e 100644 (file)
@@ -80,6 +80,8 @@ enum auth_rule_t {
        AUTH_RULE_EAP_VENDOR,
        /** XAUTH backend name to use, char* */
        AUTH_RULE_XAUTH_BACKEND,
+       /** XAuth identity to use or require, identification_t* */
+       AUTH_RULE_XAUTH_IDENTITY,
        /** certificate authority, certificate_t* */
        AUTH_RULE_CA_CERT,
        /** intermediate certificate in trustchain, certificate_t* */