added EAP_SUCCESS/FAILURE message to RADIUS Accept/Reject
[strongswan.git] / src / libcharon / plugins / tnc_pdp / tnc_pdp.c
index 0edecc8..6b0021d 100644 (file)
@@ -183,7 +183,7 @@ static void send_response(private_tnc_pdp_t *this,
        }
        response->set_identifier(response, request->get_identifier(request));
        response->sign(response, request->get_authenticator(request),
-                                  this->secret, this->hasher, this->signer, NULL);
+                                  this->secret, this->hasher, this->signer, NULL, TRUE);
 
        DBG1(DBG_CFG, "sending RADIUS %N to client '%H'", radius_message_code_names,
                 code, client);
@@ -250,17 +250,22 @@ static void process_eap(private_tnc_pdp_t *this, radius_message_t *request,
                                        break;
                                case SUCCESS:
                                        code = RMC_ACCESS_ACCEPT;
+                                       DESTROY_IF(out);
+                                       out = eap_payload_create_code(EAP_SUCCESS,
+                                                                                                 in->get_identifier(in));
                                        break;
                                case FAILED:
                                default:
                                        code = RMC_ACCESS_REJECT;
+                                       DESTROY_IF(out);
+                                       out = eap_payload_create_code(EAP_FAILURE,
+                                                                                                 in->get_identifier(in));
                        }
                }
 
                send_response(this, request, code, out, source);
-
                in->destroy(in);
-               DESTROY_IF(out);
+               out->destroy(out);
        }
 }