define peer and server identities
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Mar 2012 22:19:13 +0000 (23:19 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 13 Mar 2012 15:27:17 +0000 (16:27 +0100)
src/libcharon/plugins/tnc_pdp/tnc_pdp.c

index 6b0021d..52c52c5 100644 (file)
@@ -227,9 +227,16 @@ static void process_eap(private_tnc_pdp_t *this, radius_message_t *request,
                if (eap_type == EAP_IDENTITY)
                {
                        identification_t *server, *peer;
+                       chunk_t eap_identity;
+
+                       if (message.len < 5)
+                       {
+                               return;
+                       }
+                       eap_identity = chunk_create(message.ptr + 5, message.len - 5);
+                       peer = identification_create_from_data(eap_identity);
+                       server = identification_create_from_string("%any");
 
-                       peer = identification_create_from_string("carol@strongswan.org");
-                       server = identification_create_from_string("server");
                        this->method = charon->eap->create_instance(charon->eap, EAP_MD5, 0,
                                                                                                EAP_SERVER, server, peer); 
                        if (!this->method)