]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
eap-gtc: Pass request message to credential set
authorTobias Brunner <tobias@strongswan.org>
Fri, 19 Feb 2021 09:26:35 +0000 (10:26 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 19 Feb 2021 13:06:33 +0000 (14:06 +0100)
src/libcharon/plugins/eap_gtc/eap_gtc.c

index e085631a2891d743a5d30920e17cd950146e7379..95fd822b82feb5bedd059bb71437abfcc8fd2454 100644 (file)
@@ -19,7 +19,7 @@
 #include <daemon.h>
 #include <library.h>
 
-#define GTC_REQUEST_MSG "password"
+#define GTC_REQUEST_MSG "Password"
 
 typedef struct private_eap_gtc_t private_eap_gtc_t;
 
@@ -98,11 +98,20 @@ METHOD(eap_method_t, process_peer, status_t,
 {
        eap_gtc_header_t *res;
        shared_key_t *shared;
-       chunk_t key;
+       chunk_t msg, key;
+       char *msg_str = NULL;
        size_t len;
 
+       msg = chunk_skip(in->get_data(in), 5);
+       if (msg.len)
+       {
+               chunk_printable(msg, &msg, '?');
+               msg_str = strndup(msg.ptr, msg.len);
+               free(msg.ptr);
+       }
        shared = lib->credmgr->get_shared(lib->credmgr, SHARED_EAP,
-                                                                         this->peer, this->server, NULL);
+                                                                         this->peer, this->server, msg_str);
+       free(msg_str);
        if (shared == NULL)
        {
                DBG1(DBG_IKE, "no EAP key found for '%Y' - '%Y'",