diff options
Diffstat (limited to 'src/libradius/radius_message.c')
-rw-r--r-- | src/libradius/radius_message.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libradius/radius_message.c b/src/libradius/radius_message.c index 23f549c87..77f9b0398 100644 --- a/src/libradius/radius_message.c +++ b/src/libradius/radius_message.c @@ -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; |