* isn't thread-safe.
*/
if (entry) {
- fr_pair_list_move_by_num(request, &request->state, &entry->vps, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(request, &request->state, &entry->vps, 0, 0, TAG_ANY);
RDEBUG2("session-state: Found cached attributes");
rdebug_pair_list(L_DBG_LVL_1, request, request->state, NULL);
* This has to be done in a mutex lock, because talloc
* isn't thread-safe.
*/
- fr_pair_list_move_by_num(entry, &entry->vps, &request->state, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(entry, &entry->vps, &request->state, 0, 0, TAG_ANY);
PTHREAD_MUTEX_UNLOCK(&state->mutex);
rad_assert(request->state == NULL);
}
/* move the cached VPs into the session */
- fr_pair_list_move_by_num(talloc_ctx, &vps, &pairlist->reply, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(talloc_ctx, &vps, &pairlist->reply, 0, 0, TAG_ANY);
SSL_SESSION_set_ex_data(sess, fr_tls_ex_index_vps, vps);
RWDEBUG("Successfully restored session %s", buffer);
static void fix_mppe_keys(eap_handler_t *handler, mschapv2_opaque_t *data)
{
- fr_pair_list_move_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 7, VENDORPEC_MICROSOFT, TAG_ANY);
- fr_pair_list_move_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 8, VENDORPEC_MICROSOFT, TAG_ANY);
- fr_pair_list_move_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 16, VENDORPEC_MICROSOFT, TAG_ANY);
- fr_pair_list_move_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 17, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 7, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 8, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 16, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &data->mppe_keys, &handler->request->reply->vps, 17, VENDORPEC_MICROSOFT, TAG_ANY);
}
/*
* Move the attribute, so it doesn't go into
* the reply.
*/
- fr_pair_list_move_by_num(data, &response, &request->reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &response, &request->reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
break;
default:
case PW_EAP_MSCHAPV2_SUCCESS:
eap_ds->request->code = PW_EAP_SUCCESS;
- fr_pair_list_move_by_num(request->reply, &request->reply->vps, &data->mppe_keys, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(request->reply, &request->reply->vps, &data->mppe_keys, 0, 0, TAG_ANY);
/* FALL-THROUGH */
case PW_EAP_MSCHAPV2_ACK:
*/
request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;
#endif
- fr_pair_list_move_by_num(request->reply, &request->reply->vps, &data->reply, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(request->reply, &request->reply->vps, &data->reply, 0, 0, TAG_ANY);
return 1;
}
REDEBUG("Sent SUCCESS expecting SUCCESS (or ACK) but got %d", ccode);
*/
response = NULL;
if (rcode == RLM_MODULE_OK) {
- fr_pair_list_move_by_num(data, &response, &request->reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &response, &request->reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
data->code = PW_EAP_MSCHAPV2_SUCCESS;
} else if (inst->send_error) {
- fr_pair_list_move_by_num(data, &response, &request->reply->vps, PW_MSCHAP_ERROR, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(data, &response, &request->reply->vps, PW_MSCHAP_ERROR, VENDORPEC_MICROSOFT, TAG_ANY);
if (response) {
int n,err,retry;
char buf[34];
fr_pair_delete_by_num(&reply->vps, 17, VENDORPEC_MICROSOFT, TAG_ANY);
fr_pair_list_free(&t->accept_vps); /* for proxying MS-CHAP2 */
- fr_pair_list_move_by_num(t, &t->accept_vps, &reply->vps, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &t->accept_vps, &reply->vps, 0, 0, TAG_ANY);
rad_assert(!reply->vps);
}
break;
* Get rid of the old State, too.
*/
fr_pair_list_free(&t->state);
- fr_pair_list_move_by_num(t, &t->state, &reply->vps, PW_STATE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &t->state, &reply->vps, PW_STATE, 0, TAG_ANY);
/*
* PEAP takes only EAP-Message attributes inside
* Access-Challenge is ignored.
*/
vp = NULL;
- fr_pair_list_move_by_num(t, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
/*
* Handle EAP-MSCHAP-V2, where Access-Accept's
fr_pair_delete_by_num(&reply->vps, PW_MESSAGE_AUTHENTICATOR, 0, TAG_ANY);
rad_assert(!t->accept_vps);
- fr_pair_list_move_by_num(t, &t->accept_vps, &reply->vps, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &t->accept_vps, &reply->vps, 0, 0, TAG_ANY);
rad_assert(!reply->vps);
}
/* save the SoH VPs */
rad_assert(!t->soh_reply_vps);
- fr_pair_list_move_by_num(t, &t->soh_reply_vps, &fake->reply->vps, 0, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &t->soh_reply_vps, &fake->reply->vps, 0, 0, TAG_ANY);
rad_assert(!fake->reply->vps);
talloc_free(fake);
* Tell the original request that it's going
* to be proxied.
*/
- fr_pair_list_move_by_num(request, &request->config,
+ fr_pair_list_mcopy_by_num(request, &request->config,
&fake->config,
PW_PROXY_TO_REALM, 0, TAG_ANY);
if (peap->soh_reply_vps) {
RDEBUG2("Using saved attributes from the SoH reply");
rdebug_pair_list(L_DBG_LVL_2, request, peap->soh_reply_vps, NULL);
- fr_pair_list_move_by_num(handler->request->reply,
+ fr_pair_list_mcopy_by_num(handler->request->reply,
&handler->request->reply->vps,
&peap->soh_reply_vps, 0, 0, TAG_ANY);
}
if (peap->accept_vps) {
RDEBUG2("Using saved attributes from the original Access-Accept");
rdebug_pair_list(L_DBG_LVL_2, request, peap->accept_vps, NULL);
- fr_pair_list_move_by_num(handler->request->reply,
+ fr_pair_list_mcopy_by_num(handler->request->reply,
&handler->request->reply->vps,
&peap->accept_vps, 0, 0, TAG_ANY);
} else if (peap->use_tunneled_reply) {
rad_virtual_server(fake);
/* copy the reply vps back to our reply */
- fr_pair_list_move_by_num(request->reply, &request->reply->vps,
+ fr_pair_list_mcopy_by_num(request->reply, &request->reply->vps,
&fake->reply->vps, 0, 0, TAG_ANY);
/* reject if virtual server didn't return accept */
if (t->accept_vps) {
RDEBUG2("Using saved attributes from the original Access-Accept");
rdebug_pair_list(L_DBG_LVL_2, request, t->accept_vps, NULL);
- fr_pair_list_move_by_num(handler->request->reply,
+ fr_pair_list_mcopy_by_num(handler->request->reply,
&handler->request->reply->vps,
&t->accept_vps, 0, 0, TAG_ANY);
} else if (t->use_tunneled_reply) {
* packet, and we will send EAP-Success.
*/
vp = NULL;
- fr_pair_list_move_by_num(tls_session, &vp, &reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
+ fr_pair_list_mcopy_by_num(tls_session, &vp, &reply->vps, PW_MSCHAP2_SUCCESS, VENDORPEC_MICROSOFT, TAG_ANY);
if (vp) {
RDEBUG("Got MS-CHAP2-Success, tunneling it to the client in a challenge");
rcode = RLM_MODULE_HANDLED;
*/
if (t->use_tunneled_reply) {
rad_assert(!t->accept_vps);
- fr_pair_list_move_by_num(t, &t->accept_vps, &reply->vps,
+ fr_pair_list_mcopy_by_num(t, &t->accept_vps, &reply->vps,
0, 0, TAG_ANY);
rad_assert(!reply->vps);
}
* can figure it out, from the non-tunneled
* EAP-Success packet.
*/
- fr_pair_list_move_by_num(tls_session, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(tls_session, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
fr_pair_list_free(&vp);
}
/* move channel binding responses; we need to send them */
- fr_pair_list_move_by_num(tls_session, &vp, &reply->vps, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY);
+ fr_pair_list_mcopy_by_num(tls_session, &vp, &reply->vps, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY);
if (fr_pair_find_by_num(vp, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY) != NULL) {
t->authenticated = true;
/*
*/
if (t->use_tunneled_reply) {
rad_assert(!t->accept_vps);
- fr_pair_list_move_by_num(t, &t->accept_vps, &reply->vps,
+ fr_pair_list_mcopy_by_num(t, &t->accept_vps, &reply->vps,
0, 0, TAG_ANY);
rad_assert(!reply->vps);
}
*/
if (t->use_tunneled_reply) {
fr_pair_delete_by_num(&reply->vps, PW_PROXY_STATE, 0, TAG_ANY);
- fr_pair_list_move_by_num(request->reply, &request->reply->vps,
+ fr_pair_list_mcopy_by_num(request->reply, &request->reply->vps,
&reply->vps, 0, 0, TAG_ANY);
}
break;
* Get rid of the old State, too.
*/
fr_pair_list_free(&t->state);
- fr_pair_list_move_by_num(t, &t->state, &reply->vps, PW_STATE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &t->state, &reply->vps, PW_STATE, 0, TAG_ANY);
/*
* We should really be a bit smarter about this,
* method works in 99.9% of the situations.
*/
vp = NULL;
- fr_pair_list_move_by_num(t, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &vp, &reply->vps, PW_EAP_MESSAGE, 0, TAG_ANY);
/*
* There MUST be a Reply-Message in the challenge,
* we MUST create one, with an empty string as
* it's value.
*/
- fr_pair_list_move_by_num(t, &vp, &reply->vps, PW_REPLY_MESSAGE, 0, TAG_ANY);
+ fr_pair_list_mcopy_by_num(t, &vp, &reply->vps, PW_REPLY_MESSAGE, 0, TAG_ANY);
/* also move chbind messages, if any */
- fr_pair_list_move_by_num(t, &vp, &reply->vps, PW_UKERNA_CHBIND, VENDORPEC_UKERNA,
+ fr_pair_list_mcopy_by_num(t, &vp, &reply->vps, PW_UKERNA_CHBIND, VENDORPEC_UKERNA,
TAG_ANY);
/*
* Tell the original request that it's going
* to be proxied.
*/
- fr_pair_list_move_by_num(request, &request->config,
+ fr_pair_list_mcopy_by_num(request, &request->config,
&fake->config,
PW_PROXY_TO_REALM, 0, TAG_ANY);