From: Nick Porter Date: Mon, 16 Jun 2025 09:47:15 +0000 (+0100) Subject: No need to copy User-Password to Password.Cleartext X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e6d322785897c3be59d66cd30c22ab21869f55d;p=thirdparty%2Ffreeradius-server.git No need to copy User-Password to Password.Cleartext --- diff --git a/src/bin/radclient-ng.c b/src/bin/radclient-ng.c index aa7df0c3851..8251f4eef6c 100644 --- a/src/bin/radclient-ng.c +++ b/src/bin/radclient-ng.c @@ -662,8 +662,7 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files) */ pair_update_request(request->password, attr_cleartext_password); fr_pair_value_bstrndup(request->password, vp->vp_strvalue, vp->vp_length, true); - } else if ((vp->da == attr_user_password) || - (vp->da == attr_ms_chap_password)) { + } else if (vp->da == attr_ms_chap_password) { pair_update_request(request->password, attr_cleartext_password); fr_pair_value_bstrndup(request->password, vp->vp_strvalue, vp->vp_length, true); @@ -1002,10 +1001,7 @@ static int send_one_packet(fr_bio_packet_t *client, rc_request_t *request) if (request->password) { fr_pair_t *vp; - if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_user_password)) != NULL) { - fr_pair_value_strdup(vp, request->password->vp_strvalue, false); - - } else if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_chap_password)) != NULL) { + if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_chap_password)) != NULL) { uint8_t buffer[17]; fr_pair_t *challenge; uint8_t const *vector; diff --git a/src/bin/radclient.c b/src/bin/radclient.c index 51a7b0d2e55..d0f2110dd48 100644 --- a/src/bin/radclient.c +++ b/src/bin/radclient.c @@ -648,8 +648,7 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files) */ pair_update_request(request->password, attr_cleartext_password); fr_pair_value_bstrndup(request->password, vp->vp_strvalue, vp->vp_length, true); - } else if ((vp->da == attr_user_password) || - (vp->da == attr_ms_chap_password)) { + } else if (vp->da == attr_ms_chap_password) { pair_update_request(request->password, attr_cleartext_password); fr_pair_value_bstrndup(request->password, vp->vp_strvalue, vp->vp_length, true); @@ -1008,10 +1007,7 @@ static int send_one_packet(rc_request_t *request) if (request->password) { fr_pair_t *vp; - if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_user_password)) != NULL) { - fr_pair_value_strdup(vp, request->password->vp_strvalue, false); - - } else if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_chap_password)) != NULL) { + if ((vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_chap_password)) != NULL) { uint8_t buffer[17]; fr_pair_t *challenge; uint8_t const *vector;