Add a return value to radius_message_t.sign()
[strongswan.git] / src / libcharon / plugins / eap_radius / eap_radius_dae.c
index 80da99a..75b7b70 100644 (file)
@@ -184,11 +184,16 @@ static void send_response(private_eap_radius_dae_t *this,
 
        response = radius_message_create(code);
        response->set_identifier(response, request->get_identifier(request));
-       response->sign(response, request->get_authenticator(request),
-                                  this->secret, this->hasher, this->signer, NULL, FALSE);
-
-       send_message(this, response, client);
-       save_retransmit(this, response, client);
+       if (response->sign(response, request->get_authenticator(request),
+                                          this->secret, this->hasher, this->signer, NULL, FALSE))
+       {
+               send_message(this, response, client);
+               save_retransmit(this, response, client);
+       }
+       else
+       {
+               response->destroy(response);
+       }
 }
 
 /**