Skip to content
Permalink
Browse files

Fix Auth-Type checks in rlm_pap and rlm_chap

They were looking in the wrong list, and the output should not have been an error
  • Loading branch information
arr2036 committed Aug 29, 2019
1 parent 06adf83 commit 1e3a0ae2f32eaa4e7811b6b7c2dd24feace7cd65
Showing with 7 additions and 7 deletions.
  1. +5 −5 src/modules/rlm_chap/rlm_chap.c
  2. +2 −2 src/modules/rlm_pap/rlm_pap.c
@@ -65,17 +65,17 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
rlm_chap_t *inst = instance;
VALUE_PAIR *vp;

if (fr_pair_find_by_da(request->control, attr_auth_type, TAG_ANY) != NULL) {
RDEBUG3("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name);
return RLM_MODULE_NOOP;
}

/*
* This case means the warnings below won't be printed
* unless there's a CHAP-Password in the request.
*/
if (!fr_pair_find_by_da(request->packet->vps, attr_chap_password, TAG_ANY)) return RLM_MODULE_NOOP;

if (fr_pair_find_by_da(request->packet->vps, attr_auth_type, TAG_ANY) != NULL) {
REDEBUG("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name);
return RLM_MODULE_NOOP;
}

/*
* Create the CHAP-Challenge if it wasn't already in the packet.
*
@@ -172,8 +172,8 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
rlm_pap_t const *inst = instance;
VALUE_PAIR *password;

if (fr_pair_find_by_da(request->packet->vps, attr_auth_type, TAG_ANY) != NULL) {
REDEBUG("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name);
if (fr_pair_find_by_da(request->control, attr_auth_type, TAG_ANY) != NULL) {
RDEBUG3("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name);
return RLM_MODULE_NOOP;
}

0 comments on commit 1e3a0ae

Please sign in to comment.
You can’t perform that action at this time.