Add a return value to hasher_t.get_hash()
This commit is contained in:
@@ -332,8 +332,11 @@ METHOD(radius_message_t, sign, bool,
|
||||
|
||||
/* build Response-Authenticator */
|
||||
msg = chunk_create((u_char*)this->msg, ntohs(this->msg->length));
|
||||
hasher->get_hash(hasher, msg, NULL);
|
||||
hasher->get_hash(hasher, secret, this->msg->authenticator);
|
||||
if (!hasher->get_hash(hasher, msg, NULL) ||
|
||||
!hasher->get_hash(hasher, secret, this->msg->authenticator))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -364,9 +367,9 @@ METHOD(radius_message_t, verify, bool,
|
||||
}
|
||||
|
||||
/* verify Response-Authenticator */
|
||||
hasher->get_hash(hasher, msg, NULL);
|
||||
hasher->get_hash(hasher, secret, buf);
|
||||
if (!memeq(buf, res_auth, HASH_SIZE_MD5))
|
||||
if (!hasher->get_hash(hasher, msg, NULL) ||
|
||||
!hasher->get_hash(hasher, secret, buf) ||
|
||||
!memeq(buf, res_auth, HASH_SIZE_MD5))
|
||||
{
|
||||
DBG1(DBG_CFG, "RADIUS Response-Authenticator verification failed");
|
||||
return FALSE;
|
||||
|
||||
@@ -260,8 +260,11 @@ static chunk_t decrypt_mppe_key(private_radius_socket_t *this, u_int16_t salt,
|
||||
while (c < C.ptr + C.len)
|
||||
{
|
||||
/* b(i) = MD5(S + c(i-1)) */
|
||||
this->hasher->get_hash(this->hasher, this->secret, NULL);
|
||||
this->hasher->get_hash(this->hasher, seed, p);
|
||||
if (!this->hasher->get_hash(this->hasher, this->secret, NULL) ||
|
||||
!this->hasher->get_hash(this->hasher, seed, p))
|
||||
{
|
||||
return chunk_empty;
|
||||
}
|
||||
|
||||
/* p(i) = b(i) xor c(1) */
|
||||
memxor(p, c, HASH_SIZE_MD5);
|
||||
|
||||
Reference in New Issue
Block a user