Raise an alert of generating local authentication data fails

This commit is contained in:
Martin Willi 2012-11-05 15:33:34 +01:00
parent cc0cc3b54d
commit 3f7f5388a5
2 changed files with 12 additions and 6 deletions

View File

@ -86,6 +86,8 @@ enum alert_t {
ALERT_RADIUS_NOT_RESPONDING,
/** a shutdown signal has been received, argument is the signal (int) */
ALERT_SHUTDOWN_SIGNAL,
/** creating local authentication data failed, no arguments */
ALERT_LOCAL_AUTH_FAILED,
/** peer authentication failed, no arguments */
ALERT_PEER_AUTH_FAILED,
/** failed to resolve peer address, no arguments */

View File

@ -457,6 +457,7 @@ METHOD(task_t, build_i, status_t,
this->reserved);
if (!this->my_auth)
{
charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
return FAILED;
}
}
@ -473,6 +474,7 @@ METHOD(task_t, build_i, status_t,
case NEED_MORE:
break;
default:
charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
return FAILED;
}
@ -748,7 +750,7 @@ METHOD(task_t, build_r, status_t,
this->reserved);
if (!this->my_auth)
{
goto peer_auth_failed;
goto local_auth_failed;
}
}
}
@ -786,9 +788,7 @@ METHOD(task_t, build_r, status_t,
case NEED_MORE:
break;
default:
message->add_notify(message, TRUE, AUTHENTICATION_FAILED,
chunk_empty);
return FAILED;
goto local_auth_failed;
}
}
@ -830,11 +830,14 @@ METHOD(task_t, build_r, status_t,
return NEED_MORE;
peer_auth_failed:
message->add_notify(message, TRUE, AUTHENTICATION_FAILED,
chunk_empty);
message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
peer_auth_failed_no_notify:
charon->bus->alert(charon->bus, ALERT_PEER_AUTH_FAILED);
return FAILED;
local_auth_failed:
message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
return FAILED;
}
METHOD(task_t, process_i, status_t,
@ -987,6 +990,7 @@ METHOD(task_t, process_i, status_t,
case NEED_MORE:
break;
default:
charon->bus->alert(charon->bus, ALERT_LOCAL_AUTH_FAILED);
return FAILED;
}
}