Add a return value to radius_message_t.sign()
This commit is contained in:
@@ -286,7 +286,7 @@ METHOD(radius_message_t, add, void,
|
||||
this->msg->length = htons(ntohs(this->msg->length) + attribute->length);
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, sign, void,
|
||||
METHOD(radius_message_t, sign, bool,
|
||||
private_radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer, rng_t *rng, bool msg_auth)
|
||||
{
|
||||
@@ -329,6 +329,7 @@ METHOD(radius_message_t, sign, void,
|
||||
hasher->get_hash(hasher, msg, NULL);
|
||||
hasher->get_hash(hasher, secret, this->msg->authenticator);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, verify, bool,
|
||||
|
||||
@@ -257,8 +257,9 @@ struct radius_message_t {
|
||||
* @param hasher MD5 hasher
|
||||
* @param rng RNG to create Request-Authenticator, NULL to omit
|
||||
* @param msg_auth calculate and add Message-Authenticator
|
||||
* @return TRUE if signed successfully
|
||||
*/
|
||||
void (*sign)(radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
bool (*sign)(radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer, rng_t *rng, bool msg_auth);
|
||||
|
||||
/**
|
||||
|
||||
@@ -148,8 +148,11 @@ METHOD(radius_socket_t, request, radius_message_t*,
|
||||
/* set Message Identifier */
|
||||
request->set_identifier(request, this->identifier++);
|
||||
/* sign the request */
|
||||
request->sign(request, NULL, this->secret, this->hasher, this->signer,
|
||||
rng, rng != NULL);
|
||||
if (!request->sign(request, NULL, this->secret, this->hasher, this->signer,
|
||||
rng, rng != NULL))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!check_connection(this, fd, port))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user