* @param _b value
* @param _c op
*/
-#define pair_make_packet(_a, _b, _c) fr_pair_make(request->packet, &request->packet->vps, _a, _b, _c)
+#define pair_make_request(_a, _b, _c) fr_pair_make(request->packet, &request->packet->vps, _a, _b, _c)
#define pair_make_reply(_a, _b, _c) fr_pair_make(request->reply, &request->reply->vps, _a, _b, _c)
#define pair_make_config(_a, _b, _c) fr_pair_make(request, &request->config, _a, _b, _c)
const char *identity = SSL_get_psk_identity(sock->ssn->ssl);
if (identity) {
RDEBUG("Retrieved psk identity: %s", identity);
- pair_make_packet("TLS-PSK-Identity", identity, T_OP_SET);
+ pair_make_request("TLS-PSK-Identity", identity, T_OP_SET);
}
#endif
}
p = talloc_vasprintf(request, fmt, aq);
va_end(aq);
- MEM(vp = pair_make_packet("Module-Failure-Message", NULL, T_OP_ADD));
+ MEM(vp = pair_make_request("Module-Failure-Message", NULL, T_OP_ADD));
if (request->module && (request->module[0] != '\0')) {
fr_pair_value_sprintf(vp, "%s: %s", request->module, p);
} else {
/*
* Remember that we sent the request to a Realm.
*/
- if (realmname) pair_make_packet("Realm", realmname, T_OP_EQ);
+ if (realmname) pair_make_request("Realm", realmname, T_OP_EQ);
/*
* Strip the name, if told to.
}
data_len -= 18;
- vp = pair_make_packet("SoH-MS-Machine-OS-vendor", "Microsoft", T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-OS-vendor", "Microsoft", T_OP_EQ);
if (!vp) return 0;
- vp = pair_make_packet("SoH-MS-Machine-OS-version", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-OS-version", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_32(p); p+=4;
- vp = pair_make_packet("SoH-MS-Machine-OS-release", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-OS-release", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_32(p); p+=4;
- vp = pair_make_packet("SoH-MS-Machine-OS-build", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-OS-build", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_32(p); p+=4;
- vp = pair_make_packet("SoH-MS-Machine-SP-version", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-SP-version", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_16(p); p+=2;
- vp = pair_make_packet("SoH-MS-Machine-SP-release", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-SP-release", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_16(p); p+=2;
- vp = pair_make_packet("SoH-MS-Machine-Processor", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-Processor", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = soh_pull_be_16(p); p+=2;
t = soh_pull_be_16(p);
p += 2;
- vp = pair_make_packet("SoH-MS-Machine-Name", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-Name", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_strvalue = q = talloc_array(vp, char, t);
* 24 bytes opaque binary which we might, in future, have
* to echo back to the client in a final SoHR
*/
- vp = pair_make_packet("SoH-MS-Correlation-Id", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Correlation-Id", NULL, T_OP_EQ);
if (!vp) return 0;
fr_pair_value_memcpy(vp, p, 24);
* 1 byte product type (client=1 domain_controller=2 server=3)
*/
p += 4;
- vp = pair_make_packet("SoH-MS-Machine-Role", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Machine-Role", NULL, T_OP_EQ);
if (!vp) return 0;
vp->vp_integer = *p;
RDEBUG2("SoH Health-Class-Status microsoft DWORD=%08x", hcstatus);
- vp = pair_make_packet("SoH-MS-Windows-Health-Status", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Windows-Health-Status", NULL, T_OP_EQ);
if (!vp) return 0;
switch (curr_hc) {
break;
}
} else {
- vp = pair_make_packet("SoH-MS-Health-Other", NULL, T_OP_EQ);
+ vp = pair_make_request("SoH-MS-Health-Other", NULL, T_OP_EQ);
if (!vp) return 0;
/* FIXME: what to do with the payload? */
return 0;
}
- vp = pair_make_packet("TLS-PSK-Identity", identity, T_OP_SET);
+ vp = pair_make_request("TLS-PSK-Identity", identity, T_OP_SET);
if (!vp) return 0;
hex_len = radius_xlat(buffer, sizeof(buffer), request, conf->psk_query,
}
fclose(fp);
- if (!pair_make_packet("TLS-Client-Cert-Filename",
+ if (!pair_make_request("TLS-Client-Cert-Filename",
filename, T_OP_SET)) {
RDEBUG("Failed creating TLS-Client-Cert-Filename");
/*
* Mark the request as resumed.
*/
- pair_make_packet("EAP-Session-Resumed", "1", T_OP_SET);
+ pair_make_request("EAP-Session-Resumed", "1", T_OP_SET);
}
return 0;
/* Set-up the fake request */
fake = request_alloc_fake(request);
- pair_make_packet("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ);
+ pair_make_request("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ);
/* Add the username to the fake request */
if (chbind->username) {
*/
fr_pair_delete_by_num(&request->packet->vps, PW_USER_PASSWORD, 0, TAG_ANY);
- vp = pair_make_packet("User-Password", NULL, T_OP_EQ);
+ vp = pair_make_request("User-Password", NULL, T_OP_EQ);
if (!vp) {
return 0;
}
RDEBUG2("Password change packet received");
- challenge = pair_make_packet("MS-CHAP-Challenge", NULL, T_OP_EQ);
+ challenge = pair_make_request("MS-CHAP-Challenge", NULL, T_OP_EQ);
if (!challenge) return 0;
fr_pair_value_memcpy(challenge, data->challenge, MSCHAPV2_CHALLENGE_LEN);
- cpw = pair_make_packet("MS-CHAP2-CPW", NULL, T_OP_EQ);
+ cpw = pair_make_request("MS-CHAP2-CPW", NULL, T_OP_EQ);
cpw->vp_length = 68;
cpw->vp_octets = p = talloc_array(cpw, uint8_t, cpw->vp_length);
int to_copy = 516 - copied;
if (to_copy > 243) to_copy = 243;
- nt_enc = pair_make_packet("MS-CHAP-NT-Enc-PW", NULL, T_OP_ADD);
+ nt_enc = pair_make_request("MS-CHAP-NT-Enc-PW", NULL, T_OP_ADD);
nt_enc->vp_length = 4 + to_copy;
nt_enc->vp_octets = p = talloc_array(nt_enc, uint8_t, nt_enc->vp_length);
* to pass to the 'mschap' module. This is a little wonky,
* but it works.
*/
- challenge = pair_make_packet("MS-CHAP-Challenge", NULL, T_OP_EQ);
+ challenge = pair_make_request("MS-CHAP-Challenge", NULL, T_OP_EQ);
if (!challenge) return 0;
fr_pair_value_memcpy(challenge, data->challenge, MSCHAPV2_CHALLENGE_LEN);
- response = pair_make_packet("MS-CHAP2-Response", NULL, T_OP_EQ);
+ response = pair_make_request("MS-CHAP2-Response", NULL, T_OP_EQ);
if (!response) return 0;
response->vp_length = MSCHAPV2_RESPONSE_LEN;
response->vp_octets = p = talloc_array(response, uint8_t, response->vp_length);
p[1] = eap_ds->response->type.data[5 + MSCHAPV2_RESPONSE_LEN];
memcpy(p + 2, &eap_ds->response->type.data[5], MSCHAPV2_RESPONSE_LEN - 2);
- name = pair_make_packet("MS-CHAP-User-Name", NULL, T_OP_EQ);
+ name = pair_make_request("MS-CHAP-User-Name", NULL, T_OP_EQ);
if (!name) return 0;
/*
RDEBUG("pwd unable to create fake request!");
return 0;
}
- fake->username = pair_make_packet("User-Name", NULL, T_OP_EQ);
+ fake->username = pair_make_request("User-Name", NULL, T_OP_EQ);
if (!fake->username) {
RDEBUG("pwd unanable to create value pair for username!");
talloc_free(fake);
/*
* Tell the request that it's a fake one.
*/
- pair_make_packet("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ);
+ pair_make_request("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ);
RDEBUG("Got tunneled request");
rdebug_pair_list(L_DBG_LVL_1, request, fake->packet->vps, NULL);
* The new NT hash - this should be preferred over the
* cleartext password as it avoids unicode hassles.
*/
- new_hash = pair_make_packet("MS-CHAP-New-NT-Password", NULL, T_OP_EQ);
+ new_hash = pair_make_request("MS-CHAP-New-NT-Password", NULL, T_OP_EQ);
new_hash->vp_length = NT_DIGEST_LENGTH;
new_hash->vp_octets = q = talloc_array(new_hash, uint8_t, new_hash->vp_length);
fr_md4_calc(q, p, passlen);
*
* First pass: get the length of the converted string.
*/
- new_pass = pair_make_packet("MS-CHAP-New-Cleartext-Password", NULL, T_OP_EQ);
+ new_pass = pair_make_request("MS-CHAP-New-Cleartext-Password", NULL, T_OP_EQ);
new_pass->vp_length = 0;
i = 0;
gettoken(&p, newattr, sizeof(newattr), false);
if (dict_attrbyname(newattr) != NULL) {
- pair_make_packet(newattr, ptr + 1, T_OP_EQ);
+ pair_make_request(newattr, ptr + 1, T_OP_EQ);
}
} else { /* h322-foo-bar = "h323-foo-bar = baz" */
/*
* entered.
*/
if (realm->name[0] != '~') realmname = realm->name;
- pair_make_packet("Realm", realmname, T_OP_EQ);
+ pair_make_request("Realm", realmname, T_OP_EQ);
RDEBUG2("Adding Realm = \"%s\"", realmname);
talloc_free(namebuf);
vp = fr_pair_find_by_num(request->packet->vps, PW_UKERNA_TR_COI, VENDORPEC_UKERNA, TAG_ANY);
if (vp)
community = vp->vp_strvalue;
- else pair_make_packet("Trust-Router-COI", community, T_OP_SET);
+ else pair_make_request("Trust-Router-COI", community, T_OP_SET);
cookie.fr_realm_name = talloc_asprintf(NULL,
"%s%%%s",
* Add the Sql-Group attribute to the request list so we know
* which group we're retrieving attributes for
*/
- sql_group = pair_make_packet(inst->group_da->name, NULL, T_OP_EQ);
+ sql_group = pair_make_request(inst->group_da->name, NULL, T_OP_EQ);
if (!sql_group) {
REDEBUG("Error creating %s attribute", inst->group_da->name);
rcode = RLM_MODULE_FAIL;
* Insert a new request attribute just containing the OTP
* portion.
*/
- vp = pair_make_packet("Yubikey-OTP", otp, T_OP_SET);
+ vp = pair_make_request("Yubikey-OTP", otp, T_OP_SET);
if (!vp) {
REDEBUG("Failed creating 'Yubikey-OTP' attribute");
return RLM_MODULE_FAIL;