TNC can only be run inside of a tunneled method.
authoraland <aland>
Tue, 27 Nov 2007 19:44:11 +0000 (19:44 +0000)
committeraland <aland>
Tue, 27 Nov 2007 19:44:11 +0000 (19:44 +0000)
src/modules/rlm_eap/eap.c
src/modules/rlm_eap/types/rlm_eap_tnc/rlm_eap_tnc.c

index efd6922..fcd5245 100644 (file)
@@ -260,6 +260,12 @@ int eaptype_select(rlm_eap_t *inst, EAP_HANDLER *handler)
                        DEBUG2(" rlm_eap: WARNING: Tunnelling TLS inside of a TLS will probably not work.");
                }
 
+               if ((default_eap_type == PW_EAP_TNC) &&
+                   !handler->request->parent) {
+                       DEBUG2(" rlm_eap: ERROR: EAP-TNC must be run inside of a TLS method.");
+                       return EAP_INVALID;
+               }
+
                if (eaptype_call(inst->types[default_eap_type],
                                 handler) == 0) {
                        DEBUG2(" rlm_eap: Default EAP type %s failed in initiate",
index 2b9d488..73bf36a 100644 (file)
@@ -100,6 +100,11 @@ static void init(void){
  */
 static int tnc_initiate(void *type_data, EAP_HANDLER *handler)
 {
+       if (!handler->request || !handler->request->parent) {
+               DEBUG2("rlm_eap_tnc: Must be run inside of a TLS method");
+               return 0;
+       }
+
        DEBUG("tnc_initiate: %ld", handler->timestamp);
     if(vlanAccess==0 || vlanIsolate==0 || pathToSO==0){
         init();