diff options
-rw-r--r-- | src/libcharon/plugins/eap_gtc/eap_gtc.c | 1 | ||||
-rw-r--r-- | src/libcharon/plugins/eap_radius/eap_radius_xauth.c | 3 | ||||
-rw-r--r-- | src/libcharon/plugins/eap_radius/eap_radius_xauth.h | 4 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_eap/xauth_eap.c | 2 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_eap/xauth_eap.h | 4 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_generic/xauth_generic.c | 6 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_generic/xauth_generic.h | 8 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_noauth/xauth_noauth.c | 3 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_noauth/xauth_noauth.h | 4 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_pam/xauth_pam.c | 2 | ||||
-rw-r--r-- | src/libcharon/plugins/xauth_pam/xauth_pam.h | 3 | ||||
-rw-r--r-- | src/libcharon/sa/ikev1/tasks/xauth.c | 2 | ||||
-rw-r--r-- | src/libcharon/sa/xauth/xauth_manager.c | 17 | ||||
-rw-r--r-- | src/libcharon/sa/xauth/xauth_manager.h | 6 | ||||
-rw-r--r-- | src/libcharon/sa/xauth/xauth_method.h | 4 |
15 files changed, 52 insertions, 17 deletions
diff --git a/src/libcharon/plugins/eap_gtc/eap_gtc.c b/src/libcharon/plugins/eap_gtc/eap_gtc.c index f090e94a8..2f64f325c 100644 --- a/src/libcharon/plugins/eap_gtc/eap_gtc.c +++ b/src/libcharon/plugins/eap_gtc/eap_gtc.c @@ -280,4 +280,3 @@ eap_gtc_t *eap_gtc_create_peer(identification_t *server, identification_t *peer) return &this->public; } - diff --git a/src/libcharon/plugins/eap_radius/eap_radius_xauth.c b/src/libcharon/plugins/eap_radius/eap_radius_xauth.c index bd960d2bc..af24985e7 100644 --- a/src/libcharon/plugins/eap_radius/eap_radius_xauth.c +++ b/src/libcharon/plugins/eap_radius/eap_radius_xauth.c @@ -175,7 +175,8 @@ METHOD(xauth_method_t, destroy, void, * Described in header. */ eap_radius_xauth_t *eap_radius_xauth_create_server(identification_t *server, - identification_t *peer) + identification_t *peer, + char *profile) { private_eap_radius_xauth_t *this; diff --git a/src/libcharon/plugins/eap_radius/eap_radius_xauth.h b/src/libcharon/plugins/eap_radius/eap_radius_xauth.h index 8571bbc9f..5baacfbe8 100644 --- a/src/libcharon/plugins/eap_radius/eap_radius_xauth.h +++ b/src/libcharon/plugins/eap_radius/eap_radius_xauth.h @@ -41,9 +41,11 @@ struct eap_radius_xauth_t { * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_generic_t object */ eap_radius_xauth_t *eap_radius_xauth_create_server(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); #endif /** EAP_RADIUS_XAUTH_H_ @}*/ diff --git a/src/libcharon/plugins/xauth_eap/xauth_eap.c b/src/libcharon/plugins/xauth_eap/xauth_eap.c index 1da1d9f85..5ac4f10d2 100644 --- a/src/libcharon/plugins/xauth_eap/xauth_eap.c +++ b/src/libcharon/plugins/xauth_eap/xauth_eap.c @@ -266,7 +266,7 @@ METHOD(xauth_method_t, destroy, void, * Described in header. */ xauth_eap_t *xauth_eap_create_server(identification_t *server, - identification_t *peer) + identification_t *peer, char *profile) { private_xauth_eap_t *this; diff --git a/src/libcharon/plugins/xauth_eap/xauth_eap.h b/src/libcharon/plugins/xauth_eap/xauth_eap.h index 70927247e..7da243a11 100644 --- a/src/libcharon/plugins/xauth_eap/xauth_eap.h +++ b/src/libcharon/plugins/xauth_eap/xauth_eap.h @@ -47,9 +47,11 @@ struct xauth_eap_t { * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_eap_t object */ xauth_eap_t *xauth_eap_create_server(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); #endif /** XAUTH_EAP_H_ @}*/ diff --git a/src/libcharon/plugins/xauth_generic/xauth_generic.c b/src/libcharon/plugins/xauth_generic/xauth_generic.c index f0e675ac0..03fe291bc 100644 --- a/src/libcharon/plugins/xauth_generic/xauth_generic.c +++ b/src/libcharon/plugins/xauth_generic/xauth_generic.c @@ -187,7 +187,8 @@ METHOD(xauth_method_t, destroy, void, * Described in header. */ xauth_generic_t *xauth_generic_create_peer(identification_t *server, - identification_t *peer) + identification_t *peer, + char *profile) { private_xauth_generic_t *this; @@ -211,7 +212,8 @@ xauth_generic_t *xauth_generic_create_peer(identification_t *server, * Described in header. */ xauth_generic_t *xauth_generic_create_server(identification_t *server, - identification_t *peer) + identification_t *peer, + char *profile) { private_xauth_generic_t *this; diff --git a/src/libcharon/plugins/xauth_generic/xauth_generic.h b/src/libcharon/plugins/xauth_generic/xauth_generic.h index 5773589cb..52744d0a6 100644 --- a/src/libcharon/plugins/xauth_generic/xauth_generic.h +++ b/src/libcharon/plugins/xauth_generic/xauth_generic.h @@ -42,19 +42,23 @@ struct xauth_generic_t { * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_generic_t object */ xauth_generic_t *xauth_generic_create_server(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); /** * Creates the generic XAuth method, acting as peer. * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_generic_t object */ xauth_generic_t *xauth_generic_create_peer(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); #endif /** XAUTH_GENERIC_H_ @}*/ diff --git a/src/libcharon/plugins/xauth_noauth/xauth_noauth.c b/src/libcharon/plugins/xauth_noauth/xauth_noauth.c index a9d95126a..4b8ad8ecd 100644 --- a/src/libcharon/plugins/xauth_noauth/xauth_noauth.c +++ b/src/libcharon/plugins/xauth_noauth/xauth_noauth.c @@ -69,7 +69,8 @@ METHOD(xauth_method_t, destroy, void, * Described in header. */ xauth_noauth_t *xauth_noauth_create_server(identification_t *server, - identification_t *peer) + identification_t *peer, + char *profile) { private_xauth_noauth_t *this; diff --git a/src/libcharon/plugins/xauth_noauth/xauth_noauth.h b/src/libcharon/plugins/xauth_noauth/xauth_noauth.h index 8984b0a7c..2ac358ee0 100644 --- a/src/libcharon/plugins/xauth_noauth/xauth_noauth.h +++ b/src/libcharon/plugins/xauth_noauth/xauth_noauth.h @@ -42,9 +42,11 @@ struct xauth_noauth_t { * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_noauth_t object */ xauth_noauth_t *xauth_noauth_create_server(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); #endif /** XAUTH_NOAUTH_H_ @}*/ diff --git a/src/libcharon/plugins/xauth_pam/xauth_pam.c b/src/libcharon/plugins/xauth_pam/xauth_pam.c index 98c1a97a4..6cbe1c263 100644 --- a/src/libcharon/plugins/xauth_pam/xauth_pam.c +++ b/src/libcharon/plugins/xauth_pam/xauth_pam.c @@ -195,7 +195,7 @@ METHOD(xauth_method_t, destroy, void, * Described in header. */ xauth_pam_t *xauth_pam_create_server(identification_t *server, - identification_t *peer) + identification_t *peer, char *profile) { private_xauth_pam_t *this; diff --git a/src/libcharon/plugins/xauth_pam/xauth_pam.h b/src/libcharon/plugins/xauth_pam/xauth_pam.h index f2d310c0d..8b9fffefe 100644 --- a/src/libcharon/plugins/xauth_pam/xauth_pam.h +++ b/src/libcharon/plugins/xauth_pam/xauth_pam.h @@ -41,9 +41,10 @@ struct xauth_pam_t { * * @param server ID of the XAuth server * @param peer ID of the XAuth client + * @param profile configuration string * @return xauth_pam_t object */ xauth_pam_t *xauth_pam_create_server(identification_t *server, - identification_t *peer); + identification_t *peer, char *profile); #endif /** XAUTH_PAM_H_ @}*/ diff --git a/src/libcharon/sa/ikev1/tasks/xauth.c b/src/libcharon/sa/ikev1/tasks/xauth.c index 31114e592..f5555ecd2 100644 --- a/src/libcharon/sa/ikev1/tasks/xauth.c +++ b/src/libcharon/sa/ikev1/tasks/xauth.c @@ -127,7 +127,7 @@ static xauth_method_t *load_method(private_xauth_t* this) { if (name) { - DBG1(DBG_CFG, "no XAuth method found named '%s'", name); + DBG1(DBG_CFG, "no XAuth method found for '%s'", name); } else { diff --git a/src/libcharon/sa/xauth/xauth_manager.c b/src/libcharon/sa/xauth/xauth_manager.c index 5709dc652..17eecc2c9 100644 --- a/src/libcharon/sa/xauth/xauth_manager.c +++ b/src/libcharon/sa/xauth/xauth_manager.c @@ -107,6 +107,17 @@ METHOD(xauth_manager_t, create_instance, xauth_method_t*, enumerator_t *enumerator; xauth_entry_t *entry; xauth_method_t *method = NULL; + char *profile = NULL; + + if (name) + { + profile = strchr(name, ':'); + if (profile) + { + name = strndup(name, profile - name); + profile++; + } + } this->lock->read_lock(this->lock); enumerator = this->methods->create_enumerator(this->methods); @@ -118,7 +129,7 @@ METHOD(xauth_manager_t, create_instance, xauth_method_t*, } if (role == entry->role && (!name || streq(name, entry->name))) { - method = entry->constructor(server, peer); + method = entry->constructor(server, peer, profile); if (method) { break; @@ -127,6 +138,10 @@ METHOD(xauth_manager_t, create_instance, xauth_method_t*, } enumerator->destroy(enumerator); this->lock->unlock(this->lock); + if (profile) + { + free(name); + } return method; } diff --git a/src/libcharon/sa/xauth/xauth_manager.h b/src/libcharon/sa/xauth/xauth_manager.h index 929d5de8f..4cef4aec1 100644 --- a/src/libcharon/sa/xauth/xauth_manager.h +++ b/src/libcharon/sa/xauth/xauth_manager.h @@ -55,7 +55,11 @@ struct xauth_manager_t { /** * Create a new XAuth method instance. * - * @param name backend name, as it was registered with + * The name may contain an option string, seperated by a colon. This option + * string gets passed to the XAuth constructor to specify the behavior + * of the XAuth method. + * + * @param name backend name, with optional config string * @param role XAUTH_SERVER or XAUTH_PEER * @param server identity of the server * @param peer identity of the peer (client) diff --git a/src/libcharon/sa/xauth/xauth_method.h b/src/libcharon/sa/xauth/xauth_method.h index 9f6067dbf..701b4dc77 100644 --- a/src/libcharon/sa/xauth/xauth_method.h +++ b/src/libcharon/sa/xauth/xauth_method.h @@ -104,10 +104,12 @@ struct xauth_method_t { * * @param server ID of the server to use for credential lookup * @param peer ID of the peer to use for credential lookup + * @param profile configuration string to pass to XAuth method, or NULL * @return implementation of the eap_method_t interface */ typedef xauth_method_t *(*xauth_constructor_t)(identification_t *server, - identification_t *peer); + identification_t *peer, + char *profile); /** * Helper function to (un-)register XAuth methods from plugin features. |