for (vp = fr_pair_list_head(list);
vp;
vp = fr_pair_list_next(list, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
fr_pair_print(&FR_SBUFF_OUT(buffer, sizeof(buffer)), NULL, vp);
printf("\t%s\n", buffer);
fr_dict_attr_t const *da = da_stack->da[depth];
fr_aka_sim_ctx_t *packet_ctx = encode_ctx;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
if (unlikely(da_stack->da[depth + 1] != NULL)) {
fr_dbuff_t tl_dbuff;
fr_dbuff_t work_dbuff = FR_DBUFF(dbuff);
- VP_VERIFY(fr_dcursor_current(cursor));
+ PAIR_VERIFY(fr_dcursor_current(cursor));
FR_PROTO_STACK_PRINT(da_stack, depth);
if (da_stack->da[depth]->type != FR_TYPE_TLV) {
vp = fr_dcursor_filter_current(cursor, is_eap_aka_encodable, encode_ctx);
if (!vp) return 0;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (vp->da->depth > FR_DICT_MAX_TLV_STACK) {
fr_strerror_printf("%s: Attribute depth %i exceeds maximum nesting depth %i",
if (!log_rdebug_enabled(lvl, request)) return;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
oid_buff = log_request_oid_buff();
for (vp = fr_pair_list_head(m_vp);
vp;
vp = fr_pair_list_next(m_vp, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
log_request_pair(lvl, request, parent, vp, prefix);
}
for (vp = fr_pair_list_head(vps);
vp;
vp = fr_pair_list_next(vps, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (!fr_dict_attr_common_parent(fr_dict_root(request->dict), vp->da, true)) continue;
for (vp = fr_pair_list_head(&src_list);
vp;
vp = fr_pair_list_next(&src_list, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (RDEBUG_ENABLED) map_debug_log(request, map, vp);
}
talloc_free(vp);
return NULL;
}
- VP_VERIFY(vp); /* Check we created something sane */
+ PAIR_VERIFY(vp); /* Check we created something sane */
return vp;
}
TEST_CASE("Add 'Test-Integer' in 'request_pairs' using pair_append_request()");
TEST_CHECK(pair_append_request(&local_vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK((vp = fr_pair_list_head(&request->request_pairs)) != NULL);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 12345");
vp->vp_uint32 = 12345;
TEST_CASE("Add 'Test-Integer' in 'reply_pairs' using pair_append_reply()");
TEST_CHECK(pair_append_reply(&local_vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK((vp = fr_pair_list_head(&request->reply_pairs)) != NULL);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 12345");
vp->vp_uint32 = 12345;
TEST_CASE("Add 'Test-Integer' in 'control_pairs' using pair_append_control()");
TEST_CHECK(pair_append_control(&local_vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK((vp = fr_pair_list_head(&request->control_pairs)) != NULL);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 12345");
vp->vp_uint32 = 12345;
TEST_CASE("Add 'Test-Integer' in 'control_pairs' using pair_append_session_state()");
TEST_CHECK(pair_append_session_state(&local_vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK((vp = fr_pair_list_head(&request->session_state_pairs)) != NULL);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 12345");
vp->vp_uint32 = 12345;
TEST_CASE("Update 'Test-Integer' in 'request_pairs' using pair_update_request()");
TEST_CHECK(pair_update_request(&vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 112233");
vp->vp_uint32 = 112233;
TEST_CASE("Expected fr_dict_attr_test_uint32 (vp->vp_uint32 == 112233)");
TEST_CHECK((vp = fr_pair_find_by_da(&request->request_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_MSG("Checking if vp == 12345");
/*
TEST_CASE("Update 'Test-Integer' in 'reply_pairs' using pair_update_request()");
TEST_CHECK(pair_update_reply(&vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 3333");
vp->vp_uint32 = 3333;
TEST_CASE("Expected fr_dict_attr_test_uint32 (vp->vp_uint32 == 3333)");
TEST_CHECK((vp = fr_pair_find_by_da(&request->reply_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp && vp->vp_uint32 == 3333);
TEST_CASE("Update 'Test-Integer' in 'control_pairs' using pair_update_control()");
TEST_CHECK(pair_update_control(&vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 44444");
vp->vp_uint32 = 44444;
TEST_CASE("Expected fr_dict_attr_test_uint32 (vp->vp_uint32 == 44444)");
TEST_CHECK((vp = fr_pair_find_by_da(&request->control_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp && vp->vp_uint32 == 44444);
TEST_CASE("Update 'Test-Integer' in 'state' using pair_update_session_state()");
TEST_CHECK(pair_update_session_state(&vp, fr_dict_attr_test_uint32) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_MSG("Set vp = 7890");
vp->vp_uint32 = 7890;
TEST_CASE("Expected fr_dict_attr_test_uint32 (vp->vp_uint32 == 7890)");
TEST_CHECK((vp = fr_pair_find_by_da(&request->session_state_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp && vp->vp_uint32 == 7890);
UNUSED fr_pair_list_t *request_list,
fr_pair_t const *check_item)
{
- VP_VERIFY(check_item);
+ PAIR_VERIFY(check_item);
if (request->packet->code == check_item->vp_uint32) return 0;
UNUSED fr_pair_list_t *request_list,
fr_pair_t const *check_item)
{
- VP_VERIFY(check_item);
+ PAIR_VERIFY(check_item);
if ((check_item->op != T_OP_REG_EQ) && (check_item->op != T_OP_REG_NE)) {
int rcode;
{
paircmp_t *c;
- VP_VERIFY(check_item);
+ PAIR_VERIFY(check_item);
/*
* Check for =* and !* and return appropriately
fr_pair_t *new;
fr_dict_attr_t const *def = attr_cleartext;
- VP_VERIFY(known_good);
+ PAIR_VERIFY(known_good);
/*
* Ensure this is only ever called with a
for (i = fr_pair_list_head(from); i; ) {
fr_pair_t *j;
- VP_VERIFY(i);
+ PAIR_VERIFY(i);
/*
* We never move Fall-Through.
{
fr_pair_t *n;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
n = fr_pair_afrom_da(ctx, vp->da);
if (!n) return NULL;
{
fr_dict_attr_t *unknown;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (vp->da->flags.is_unknown) return 0;
fr_dict_attr_t *da = uctx;
for (c = to_eval; c; c = fr_dlist_next(list, c)) {
- VP_VERIFY(c);
+ PAIR_VERIFY(c);
if (c->da == da) break;
}
fr_dict_attr_t *da = uctx;
for (c = to_eval; c; c = fr_dlist_next(list, c)) {
- VP_VERIFY(c);
+ PAIR_VERIFY(c);
if (fr_dict_attr_common_parent(da, c->da, true)) break;
}
if (fr_dlist_empty(&list->order)) return NULL;
- LIST_VERIFY(list);
+ PAIR_LIST_VERIFY(list);
while ((vp = fr_pair_list_next(list, vp))) {
if (da == vp->da) {
/* List head may be NULL if it contains no VPs */
if (fr_dlist_empty(&list->order)) return NULL;
- LIST_VERIFY(list);
+ PAIR_LIST_VERIFY(list);
da = fr_dict_attr_child_by_num(parent, attr);
if (!da) return NULL;
*/
int fr_pair_prepend(fr_pair_list_t *list, fr_pair_t *to_add)
{
- VP_VERIFY(to_add);
+ PAIR_VERIFY(to_add);
if (fr_dlist_entry_in_list(&to_add->order_entry)) {
fr_strerror_printf("Pair %pV already inserted into list", to_add);
*/
int fr_pair_append(fr_pair_list_t *list, fr_pair_t *to_add)
{
- VP_VERIFY(to_add);
+ PAIR_VERIFY(to_add);
if (fr_dlist_entry_in_list(&to_add->order_entry)) {
fr_strerror_printf("Pair %pV already inserted into list", to_add);
{
fr_pair_t *i;
- VP_VERIFY(replace);
+ PAIR_VERIFY(replace);
if (fr_dlist_empty(&list->order)) {
fr_pair_append(list, replace);
* we ignore any others that might exist.
*/
for (i = fr_pair_list_head(list); i; i = fr_pair_list_next(list, i)) {
- VP_VERIFY(i);
+ PAIR_VERIFY(i);
/*
* Found the head attribute, replace it,
vp = fr_pair_find_by_da(list, da, n);
if (vp) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (out) *out = vp;
return 1;
}
fr_pair_t const *my_a = a;
fr_pair_t const *my_b = b;
- VP_VERIFY(my_a);
- VP_VERIFY(my_b);
+ PAIR_VERIFY(my_a);
+ PAIR_VERIFY(my_b);
return CMP(my_a->da, my_b->da);
}
fr_pair_t const *my_a = a;
fr_pair_t const *my_b = b;
- VP_VERIFY(my_a);
- VP_VERIFY(my_b);
+ PAIR_VERIFY(my_a);
+ PAIR_VERIFY(my_b);
return CMP(my_a->da->attr, my_b->da->attr);
}
{
if (!a) return -1;
- VP_VERIFY(a);
- if (b) VP_VERIFY(b);
+ PAIR_VERIFY(a);
+ if (b) PAIR_VERIFY(b);
switch (a->op) {
case T_OP_CMP_TRUE:
for (vp = fr_pair_list_head(from);
vp;
vp = fr_pair_list_next(from, vp), cnt++) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
new_vp = fr_pair_copy(ctx, vp);
if (!new_vp) {
fr_pair_list_free(&tmp_list);
vp = fr_pair_list_next(from, vp)) {
if (!fr_pair_matches_da(vp, da)) continue;
cnt++;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
new_vp = fr_pair_copy(ctx, vp);
if (!new_vp) {
fr_pair_list_free(&tmp_list);
if (!fr_dict_attr_common_parent(parent_da, vp->da, true)) continue;
cnt++;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
new_vp = fr_pair_copy(ctx, vp);
if (unlikely(!new_vp)) return -1;
fr_pair_append(to, new_vp);
for (vp = start;
vp && ((count == 0) || (cnt < count));
vp = fr_pair_list_next(from, vp), cnt++) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
new_vp = fr_pair_copy(ctx, vp);
if (unlikely(!new_vp)) return -1;
fr_pair_append(to, new_vp);
if (fr_value_box_from_str(vp, &vp->data, vp->da->type, vp->da, value, inlen, quote, tainted) < 0) return -1;
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
ret = fr_value_box_strdup(vp, &vp->data, vp->da, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
fr_value_box_strdup_shallow(&vp->data, vp->da, src, tainted);
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
ret = fr_value_box_strtrim(vp, &vp->data);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
ret = fr_value_box_bstr_alloc(vp, out, &vp->data, vp->da, size, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_bstr_realloc(vp, out, &vp->data, size);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_bstrndup(vp, &vp->data, vp->da, src, len, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_bstrdup_buffer(vp, &vp->data, vp->da, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
fr_value_box_clear(&vp->data);
fr_value_box_bstrndup_shallow(&vp->data, vp->da, src, len, tainted);
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
ret = fr_value_box_bstrdup_buffer_shallow(NULL, &vp->data, vp->da, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_bstrn_append(vp, &vp->data, src, len, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_bstr_append_buffer(vp, &vp->data, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_mem_alloc(vp, out, &vp->data, vp->da, size, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_mem_realloc(vp, out, &vp->data, size);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_memdup(vp, &vp->data, vp->da, src, size, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_memdup_buffer(vp, &vp->data, vp->da, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
fr_value_box_clear(&vp->data);
fr_value_box_memdup_shallow(&vp->data, vp->da, src, len, tainted);
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
fr_value_box_clear(&vp->data);
fr_value_box_memdup_buffer_shallow(NULL, &vp->data, vp->da, src, tainted);
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return 0;
}
ret = fr_value_box_mem_append(vp, &vp->data, src, len, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
ret = fr_value_box_mem_append_buffer(vp, &vp->data, src, tainted);
if (ret == 0) {
vp->type = VT_DATA;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
}
return ret;
for (slow = fr_pair_list_head(list), fast = fr_pair_list_head(list);
slow && fast;
slow = fr_pair_list_next(list, slow), fast = fr_pair_list_next(list, fast)) {
- VP_VERIFY(slow);
+ PAIR_VERIFY(slow);
/*
* Advances twice as fast as slow...
for (vp = fr_pair_list_head(list);
vp;
vp = fr_pair_list_next(list, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
switch (vp->da->type) {
case FR_TYPE_STRUCTURAL:
void fr_pair_list_verify(char const *file, int line,
TALLOC_CTX const *expected, fr_pair_list_t const *list) CC_HINT(nonnull(4));
-# define VP_VERIFY(_x) fr_pair_verify(__FILE__, __LINE__, _x)
-# define LIST_VERIFY(_x) fr_pair_list_verify(__FILE__, __LINE__, NULL, _x)
+# define PAIR_VERIFY(_x) fr_pair_verify(__FILE__, __LINE__, _x)
+# define PAIR_LIST_VERIFY(_x) fr_pair_list_verify(__FILE__, __LINE__, NULL, _x)
#else
DIAG_OFF(nonnull-compare)
/** Wrapper function to defeat nonnull checks
*
- * We may sprinkle VP_VERIFY and LIST_VERIFY in functions which
+ * We may sprinkle PAIR_VERIFY and PAIR_LIST_VERIFY in functions which
* have their pair argument marked up as nonnull.
*
* This would usually generate errors when WITH_VERIFY_PTR is not
* the pointer must not be NULL when these various macros are used
* so we can add some sneaky soft asserts.
*/
-# define VP_VERIFY(_x) fr_pair_nonnull_assert(_x)
-# define LIST_VERIFY(_x) fr_pair_list_nonnull_assert(_x)
+# define PAIR_VERIFY(_x) fr_pair_nonnull_assert(_x)
+# define PAIR_LIST_VERIFY(_x) fr_pair_list_nonnull_assert(_x)
#endif
/* Initialisation */
for (i = fr_pair_list_head(from); i; ) {
fr_pair_t *j;
- VP_VERIFY(i);
+ PAIR_VERIFY(i);
/*
* We never move Fall-Through.
TEST_CASE("Creating 'vp' using fr_pair_make()");
TEST_CHECK((vp = fr_pair_make(ctx, test_dict, &list, "Test-String-0", test_string, T_DOUBLE_QUOTED_STRING)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == test_string)");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, test_string) == 0);
TEST_CASE("Find 'Test-String-0'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Marking 'vp' using fr_pair_mark_xlat()");
TEST_CHECK(fr_pair_mark_xlat(vp, "Hello %{Test-Uint32-0}") == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->xlat == 'Hello %{Test-Uint32-0}')");
TEST_CHECK(vp && strcmp(vp->xlat, "Hello %{Test-Uint32-0}") == 0);
TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Checking if (Test-Uint32-0 == 123)");
TEST_CHECK(vp && vp->vp_uint32 == 123);
TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Checking if (Test-String-0 == 'Testing123')");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, "Testing123") == 0);
TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Checking if (Test-Uint32-0 == 123)");
TEST_CHECK(vp && vp->vp_uint32 == 123);
TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Checking if (Test-String-0 == 'Testing123')");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, "Testing123") == 0);
TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&new_list, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp != NULL);
TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&new_list, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp != NULL);
fr_pair_t *child;
fr_dcursor_t cursor;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
/*
* Legacy crap that needs to be removed
fr_sbuff_t our_out = FR_SBUFF_NO_ADVANCE(out);
fr_dict_attr_t const *parent_da = NULL;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if ((vp->op > T_INVALID) && (vp->op < T_TOKEN_LAST)) {
token = fr_tokens[vp->op];
char buff[1024];
fr_sbuff_t sbuff = FR_SBUFF_OUT(buff, sizeof(buff));
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
fr_sbuff_in_char(&sbuff, '\t');
fr_pair_print(&sbuff, NULL, vp);
fr_dict_attr_t const *parent_da = NULL;
for (vp = fr_pair_list_head(list); vp; vp = fr_pair_list_next(list, vp)) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
fr_sbuff_set_to_start(sbuff);
TEST_CHECK(fr_pair_value_from_str(vp, test_string, strlen(test_string), '"', false) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp && strcmp(vp->vp_strvalue, test_string) == 0);
TEST_MSG("Expected vp->vp_strvalue == test_string");
TEST_CASE("Allocation using fr_pair_afrom_child_num");
TEST_CHECK((vp = fr_pair_afrom_child_num(autofree, fr_dict_root(test_dict), attr)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CHECK(vp && vp->da->attr == FR_TEST_ATTR_STRING);
TEST_MSG("Expected attr(%d) == vp->da->attr(%d)", attr, vp->da->attr);
TEST_CASE("Allocation using fr_pair_copy");
TEST_CHECK((vp = fr_pair_afrom_da(autofree, fr_dict_attr_test_uint32)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy = fr_pair_copy(autofree, vp);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(copy);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(copy);
vp->op = T_OP_CMP_EQ;
TEST_CASE("Allocate a new attribute fr_pair_afrom_da");
TEST_CHECK((vp = fr_pair_afrom_da(ctx, fr_dict_attr_test_uint32)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Stealing 'vp' pair using fr_pair_steal()");
fr_pair_steal(autofree, vp); /* It should exit without memory-leaks */
TEST_CASE("Allocate a new attribute fr_pair_afrom_da");
TEST_CHECK((vp = fr_pair_afrom_da(autofree, fr_dict_attr_test_octets)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Converting regular 'vp' as unkown");
TEST_CHECK(fr_pair_to_unknown(vp) == 0);
TEST_CHECK(1 == 1); /* this never will be reached */
}
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK(needle != NULL);
- if (needle) VP_VERIFY(needle);
+ if (needle) PAIR_VERIFY(needle);
TEST_CASE("Expected (needle->da == fr_dict_attr_test_uint32)");
TEST_CHECK(needle && needle->da == fr_dict_attr_test_uint32);
TEST_CHECK(needle != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- if (needle) VP_VERIFY(needle);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ if (needle) PAIR_VERIFY(needle);
TEST_CASE("Expected (needle->da == fr_dict_attr_test_tlv_string)");
TEST_CHECK(needle && needle->da == fr_dict_attr_test_tlv_string);
TEST_CASE("Search for fr_dict_attr_test_tlv_string using fr_pair_find_by_da()");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_tlv_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Expected (vp->da == fr_dict_attr_test_tlv_string)");
TEST_CHECK(vp && vp->da == fr_dict_attr_test_tlv_string);
TEST_CASE("Search for FR_TEST_ATTR_STRING using fr_pair_find_by_child_num()");
TEST_CHECK((vp = fr_pair_find_by_child_num(&test_pairs, fr_dict_root(test_dict), FR_TEST_ATTR_STRING)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Expected (vp->da == fr_dict_attr_test_string)");
TEST_CHECK(vp && vp->da == fr_dict_attr_test_string);
TEST_CASE("Expected fr_dict_attr_test_uint32 (vp->vp_uint32 == 54321)");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Expected (vp == 54321)");
TEST_CHECK(vp && vp->vp_uint32 == 54321);
TEST_CASE("Create the vp1 'Test-Integer = 123'");
TEST_CHECK((vp1 = fr_pair_afrom_da(autofree, fr_dict_attr_test_uint32)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp1);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp1);
vp1->op = T_OP_EQ;
vp1->vp_uint32 = 123;
TEST_CASE("Create the vp2 'Test-Integer = 321'");
TEST_CHECK((vp2 = fr_pair_afrom_da(autofree, fr_dict_attr_test_uint32)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp2);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp2);
vp2->op = T_OP_CMP_EQ;
vp2->vp_uint32 = 321;
for (vp = fr_dcursor_init(&cursor, fr_pair_list_order(&local_pairs));
vp;
vp = fr_dcursor_next(&cursor)) {
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Expected (vp->da == fr_dict_attr_test_string)");
TEST_CHECK(vp->da == fr_dict_attr_test_string);
for (vp = fr_dcursor_init(&cursor, fr_pair_list_order(&local_pairs));
vp;
vp = fr_dcursor_next(&cursor)) {
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
if (vp->da == fr_dict_attr_test_tlv_string) {
needle = vp;
}
}
- TEST_CASE("Validating VP_VERIFY()");
+ TEST_CASE("Validating PAIR_VERIFY()");
TEST_CHECK(needle != NULL);
- if (needle) VP_VERIFY(needle);
+ if (needle) PAIR_VERIFY(needle);
TEST_CASE("Expected (needle->da == fr_dict_attr_test_tlv_string)");
TEST_CHECK(needle && needle->da == fr_dict_attr_test_tlv_string);
TEST_CASE("Create 'vp1' with Test-Integer = 123");
TEST_CHECK((vp1 = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_uint32, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp1);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp1);
vp1->vp_uint32 = 123;
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Convert 'test_string' value to attribute value using fr_pair_value_from_str()");
TEST_CHECK(fr_pair_value_from_str(vp, test_string, strlen(test_string), '"', false) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == test_string)");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, test_string) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'test_string' to attribute value using fr_pair_value_strdup()");
TEST_CHECK(fr_pair_value_strdup(vp, test_string, false) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == test_string)");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, test_string) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Copy content of 'test_string' to attribute value using fr_pair_value_strdup_shallow()");
TEST_CHECK(fr_pair_value_strdup_shallow(vp, copy_test_string, true) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == copy_test_string)");
TEST_CHECK(vp && strncmp(vp->vp_strvalue, test_string, strlen(copy_test_string)) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'test_string' to attribute value using fr_pair_value_strdup_shallow()");
TEST_CHECK(fr_pair_value_strdup(vp, test_string, false) == 0);
TEST_CASE("Trim the length of the string buffer using fr_pair_value_strtrim()");
TEST_CHECK(fr_pair_value_strtrim(vp) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == test_string)");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, test_string) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'fmt_test' to attribute value using fr_pair_value_aprintf()");
TEST_CHECK(fr_pair_value_aprintf(vp, "Now is %"PRId64, fr_time_unwrap(now)) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Check (vp->vp_string == fmt_test)");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, fmt_test) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Pre-allocate a memory buffer using fr_pair_value_bstr_alloc()");
TEST_CHECK(fr_pair_value_bstr_alloc(vp, &out, test_string_len, false) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy 'test_string' to the pre-allocated pointer");
TEST_CHECK(strlcpy(out, test_string, test_string_len) == test_string_len);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Pre-allocate 1 byte of memory buffer using fr_pair_value_bstr_alloc()");
TEST_CHECK(fr_pair_value_bstr_alloc(vp, &out, 1, false) == 0);
TEST_CASE("Re-allocate (test_string_len-1) byte of memory buffer using fr_pair_value_bstr_realloc()");
TEST_CHECK(fr_pair_value_bstr_realloc(vp, &out, (test_string_len - 1)) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy 'test_string' to the pre-allocated pointer");
TEST_CHECK(strlcpy(out, test_string, test_string_len) == test_string_len);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'test_string' to attribute value using fr_pair_value_bstrndup()");
TEST_CHECK(fr_pair_value_bstrndup(vp, test_string, test_string_len-1, false) == 0);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Find 'Test-String'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_string = talloc_strdup(vp, test_string);
talloc_set_type(copy_test_string, char);
TEST_CASE("Append the 'copy_test_string' value using fr_pair_value_bstr_append_buffer()");
TEST_CHECK(fr_pair_value_bstr_append_buffer(vp, copy_test_string, true) == 0);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
// awful hack, just verify the first part of buffer and then the second part. yep, just appended twice.
TEST_CASE("Check 1. part (vp->vp_string == test_string)");
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Pre-allocate a memory buffer using fr_pair_value_bstr_alloc()");
TEST_CHECK(fr_pair_value_mem_alloc(vp, &out, NUM_ELEMENTS(test_octets), false) == 0);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Pre-allocate a memory buffer using fr_pair_value_bstr_alloc()");
TEST_CHECK(fr_pair_value_mem_alloc(vp, &out, NUM_ELEMENTS(test_octets), false) == 0);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'test_octets' to attribute value using fr_pair_value_memdup()");
TEST_CHECK(fr_pair_value_memdup(vp, test_octets, NUM_ELEMENTS(test_octets), false) == 0);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_octets = talloc_memdup(vp, test_octets, NUM_ELEMENTS(test_octets));
talloc_set_type(copy_test_octets, uint8_t);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_octets = talloc_memdup(vp, test_octets, NUM_ELEMENTS(test_octets));
talloc_set_type(copy_test_octets, uint8_t);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_octets = talloc_memdup(vp, test_octets, NUM_ELEMENTS(test_octets));
talloc_set_type(copy_test_octets, uint8_t);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
TEST_CASE("Copy content of 'test_octets' to attribute value using fr_pair_value_memdup()");
TEST_CHECK(fr_pair_value_memdup(vp, test_octets, NUM_ELEMENTS(test_octets), false) == 0);
TEST_CASE("Find 'Test-Octets'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_octets, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
copy_test_octets = talloc_memdup(vp, test_octets, NUM_ELEMENTS(test_octets));
talloc_set_type(copy_test_octets, uint8_t);
TEST_CASE("Find 'Test-Values'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_enum, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
vp->vp_uint32 = 123;
TEST_CASE("Find 'Test-Values'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_enum, 0)) != NULL);
- TEST_CASE("Validating VP_VERIFY()");
- VP_VERIFY(vp);
+ TEST_CASE("Validating PAIR_VERIFY()");
+ PAIR_VERIFY(vp);
vp->vp_uint32 = 123;
goto do_splice;
}
- VP_VERIFY(in);
+ PAIR_VERIFY(in);
fr_pair_aprint(NULL, &subst, NULL, in);
}
goto do_splice;
if (!to_eval) return NULL;
for (c = to_eval; c; c = fr_dlist_next(list, c)) {
- VP_VERIFY(c);
+ PAIR_VERIFY(c);
if ((c->da->dict == dict) && (!c->da->flags.internal)) break;
}
return -1;
}
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
parent = da_stack->da[depth];
if (parent->type != FR_TYPE_STRUCT) {
EVP_PKEY_CTX *evp_encrypt_ctx; //!< Pre-allocated evp_pkey_ctx.
EVP_PKEY_CTX *evp_sign_ctx; //!< Pre-allocated evp_pkey_ctx.
EVP_PKEY_CTX *evp_decrypt_ctx; //!< Pre-allocated evp_pkey_ctx.
- EVP_PKEY_CTX *evp_verify_ctx; //!< Pre-allocated evp_pkey_ctx.
+ EVP_PKEY_CTX *ePAIR_VERIFY_ctx; //!< Pre-allocated evp_pkey_ctx.
EVP_MD_CTX *evp_md_ctx; //!< Pre-allocated evp_md_ctx for sign and verify.
uint8_t *digest_buff; //!< Pre-allocated digest buffer.
/*
* Now check the signature matches what we expected
*/
- switch (EVP_PKEY_verify(xt->evp_verify_ctx, sig, sig_len, xt->digest_buff, (size_t)digest_len)) {
+ switch (EVP_PKEY_verify(xt->ePAIR_VERIFY_ctx, sig, sig_len, xt->digest_buff, (size_t)digest_len)) {
case 1: /* success (signature valid) */
MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_BOOL, NULL, false));
vb->vb_bool = true;
/*
* Alloc verify
*/
- ti->evp_verify_ctx = EVP_PKEY_CTX_new(inst->rsa->certificate_file, NULL);
- if (!ti->evp_verify_ctx) {
+ ti->ePAIR_VERIFY_ctx = EVP_PKEY_CTX_new(inst->rsa->certificate_file, NULL);
+ if (!ti->ePAIR_VERIFY_ctx) {
fr_tls_log_strerror_printf(NULL);
PERROR("%s: Failed allocating verify EVP_PKEY_CTX", __FUNCTION__);
return -1;
}
- talloc_set_type(ti->evp_verify_ctx, EVP_PKEY_CTX);
- ti->evp_verify_ctx = talloc_steal(ti, ti->evp_verify_ctx); /* Bind lifetime to instance */
- talloc_set_destructor(ti->evp_verify_ctx, _evp_pkey_ctx_free); /* Free ctx correctly on chunk free */
+ talloc_set_type(ti->ePAIR_VERIFY_ctx, EVP_PKEY_CTX);
+ ti->ePAIR_VERIFY_ctx = talloc_steal(ti, ti->ePAIR_VERIFY_ctx); /* Bind lifetime to instance */
+ talloc_set_destructor(ti->ePAIR_VERIFY_ctx, _evp_pkey_ctx_free); /* Free ctx correctly on chunk free */
/*
* Configure verify
*/
- if (unlikely(EVP_PKEY_verify_init(ti->evp_verify_ctx) <= 0)) {
+ if (unlikely(EVP_PKEY_verify_init(ti->ePAIR_VERIFY_ctx) <= 0)) {
fr_tls_log_strerror_printf(NULL);
PERROR("%s: Failed initialising verify EVP_PKEY_CTX", __FUNCTION__);
return XLAT_ACTION_FAIL;
* OAEP not valid for signing or verification
*/
if (inst->rsa->padding != RSA_PKCS1_OAEP_PADDING) {
- if (unlikely(cipher_rsa_padding_params_set(ti->evp_verify_ctx, inst->rsa) < 0)) {
+ if (unlikely(cipher_rsa_padding_params_set(ti->ePAIR_VERIFY_ctx, inst->rsa) < 0)) {
ERROR("%s: Failed setting padding for verify EVP_PKEY_CTX", __FUNCTION__);
return -1;
}
}
- if (unlikely(EVP_PKEY_CTX_set_signature_md(ti->evp_verify_ctx, inst->rsa->sig_digest)) <= 0) {
+ if (unlikely(EVP_PKEY_CTX_set_signature_md(ti->ePAIR_VERIFY_ctx, inst->rsa->sig_digest)) <= 0) {
fr_tls_log_strerror_printf(NULL);
PERROR("%s: Failed setting signature digest type", __FUNCTION__);
return XLAT_ACTION_FAIL;
char buf[34];
fr_pair_t *vp = fr_pair_list_head(&response);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
RDEBUG2("MSCHAP-Error: %pV", &vp->data);
if (fr_pair_value_from_str(vp, val, len, '\0', false) < 0) goto fail;
}
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
RDEBUG2("&%s.%s %s $%s{'%s'} -> '%s'", list_name, key, fr_table_str_by_value(fr_tokens_table, op, "<INVALID>"),
hash_name, key, val);
} else ret = pairadd_sv(ctx, request, vps, key, res_sv, T_OP_EQ, hash_name, list_name) + ret;
}
- if (!fr_pair_list_empty(vps)) LIST_VERIFY(vps);
+ if (!fr_pair_list_empty(vps)) PAIR_LIST_VERIFY(vps);
return ret;
}
{
fr_pair_t *vp;
- VP_VERIFY(*to_restore);
+ PAIR_VERIFY(*to_restore);
vp = fr_pair_find_by_da(&request->reply_pairs, (*to_restore)->da, 0);
if (vp) {
fr_pair_t const *my_a = a, *my_b = b;
fr_dict_attr_t const *a_82, *b_82;
- VP_VERIFY(my_a);
- VP_VERIFY(my_b);
+ PAIR_VERIFY(my_a);
+ PAIR_VERIFY(my_b);
/*
* We can only use attribute numbers if we know they're
{
fr_pair_t const *vp = item;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
return (vp->da->dict == dict_dhcpv4) && (!vp->da->flags.internal);
}
if (!to_eval) return NULL;
for (c = to_eval; c; c = fr_dlist_next(list, c)) {
- VP_VERIFY(c);
+ PAIR_VERIFY(c);
if (c->da->dict != dict || c->da->flags.internal) continue;
if (c->da->type == FR_TYPE_BOOL && !c->vp_bool) continue;
fr_pair_t const *vp = fr_dcursor_current(cursor);
fr_dict_attr_t const *da = da_stack->da[depth];
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
/*
ssize_t len;
fr_dbuff_marker(&hdr, &work_dbuff);
- VP_VERIFY(fr_dcursor_current(cursor));
+ PAIR_VERIFY(fr_dcursor_current(cursor));
FR_PROTO_STACK_PRINT(da_stack, depth);
if (da_stack->da[depth]->type != FR_TYPE_TLV) {
fr_dict_attr_t const *da = da_stack->da[depth];
fr_dns_ctx_t *packet_ctx = encode_ctx;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
/*
ssize_t len;
fr_dbuff_marker(&hdr, &work_dbuff);
- VP_VERIFY(fr_dcursor_current(cursor));
+ PAIR_VERIFY(fr_dcursor_current(cursor));
FR_PROTO_STACK_PRINT(da_stack, depth);
if (da_stack->da[depth]->type != FR_TYPE_TLV) {
if (!to_eval) return NULL;
for (c = to_eval; c; c = fr_dlist_next(list, c)) {
- VP_VERIFY(c);
+ PAIR_VERIFY(c);
if ((c->da->dict == dict) &&
(!c->da->flags.internal || ((c->da->attr > FR_TAG_BASE) && (c->da->attr < (FR_TAG_BASE + 0x20))))) {
break;
*/
fr_dcursor_talloc_iter_init(&cursor, fr_pair_list_order(vps), fr_radius_next_encodable, dict_radius, fr_pair_t);
while ((vp = fr_dcursor_current(&cursor))) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
/*
* Encode an individual VP
fr_dcursor_talloc_iter_init(&cursor, fr_pair_list_order(vps),
fr_proto_next_encodable, dict_radius, fr_pair_t);
while ((vp = fr_dcursor_current(&cursor))) {
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
/*
* Encode an individual VP
fr_dbuff_marker_t value_start, src, dest;
bool encrypted = false;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
/*
fr_pair_t const *vp = fr_dcursor_current(cursor);
fr_dbuff_t work_dbuff;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
extra = flag_long_extended(&da_stack->da[0]->flags);
fr_dbuff_marker(&hdr, &work_dbuff);
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
dv = da_stack->da[depth++];
/*
* Sanity checks
*/
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
FR_PROTO_STACK_PRINT(da_stack, depth);
switch (da_stack->da[depth]->type) {
vp = fr_dcursor_current(cursor);
if (!vp) return 0;
- VP_VERIFY(vp);
+ PAIR_VERIFY(vp);
if (vp->da->depth > FR_DICT_MAX_TLV_STACK) {
fr_strerror_printf("%s: Attribute depth %i exceeds maximum nesting depth %i",