check it specified IF-TNCCS protocol is enabled
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 21 Oct 2013 19:03:53 +0000 (21:03 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 21 Oct 2013 19:03:53 +0000 (21:03 +0200)
src/libcharon/plugins/eap_tnc/eap_tnc.c

index cf4044f..f9ab742 100644 (file)
@@ -298,6 +298,12 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
        tnccs = tnc->tnccs->create_instance(tnc->tnccs, type,
                                                is_server, server, peer, TNC_IFT_EAP_1_1,
                                                is_server ? enforce_recommendation : NULL);
+       if (!tnccs)
+       {
+               DBG1(DBG_TNC, "TNCCS protocol '%s' not enabled", protocol);
+               free(this);
+               return NULL;
+       }
        this->tnccs = tnccs->get_ref(tnccs);
        this->tls_eap = tls_eap_create(EAP_TNC, &tnccs->tls,
                                                                   EAP_TNC_MAX_MESSAGE_LEN,