From: Arran Cudbard-Bell Date: Mon, 11 Oct 2021 17:08:48 +0000 (-0500) Subject: s/VP_VERIFY/PAIR_VERIFY/ s/LIST_VERIFY/PAIR_LIST_VERIFY/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d243f209ccf4addbde3bc88e41a84975afa81ca5;p=thirdparty%2Ffreeradius-server.git s/VP_VERIFY/PAIR_VERIFY/ s/LIST_VERIFY/PAIR_LIST_VERIFY/ --- diff --git a/src/bin/dhcpclient.c b/src/bin/dhcpclient.c index f6bd8d87f22..5a00a284f83 100644 --- a/src/bin/dhcpclient.c +++ b/src/bin/dhcpclient.c @@ -538,7 +538,7 @@ static void dhcp_packet_debug(fr_radius_packet_t *packet, fr_pair_list_t *list, 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); diff --git a/src/lib/eap_aka_sim/encode.c b/src/lib/eap_aka_sim/encode.c index 080817afd30..3cc9aa4b7ee 100644 --- a/src/lib/eap_aka_sim/encode.c +++ b/src/lib/eap_aka_sim/encode.c @@ -276,7 +276,7 @@ static ssize_t encode_value(fr_dbuff_t *dbuff, 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)) { @@ -732,7 +732,7 @@ static ssize_t encode_tlv_hdr(fr_dbuff_t *dbuff, 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) { @@ -794,7 +794,7 @@ ssize_t fr_aka_sim_encode_pair(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *en 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", diff --git a/src/lib/server/log.c b/src/lib/server/log.c index 8bda670a648..3ac0ace7185 100644 --- a/src/lib/server/log.c +++ b/src/lib/server/log.c @@ -764,7 +764,7 @@ void log_request_pair(fr_log_lvl_t lvl, request_t *request, if (!log_rdebug_enabled(lvl, request)) return; - VP_VERIFY(vp); + PAIR_VERIFY(vp); oid_buff = log_request_oid_buff(); @@ -817,7 +817,7 @@ void log_request_pair_list(fr_log_lvl_t lvl, request_t *request, 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); } @@ -845,7 +845,7 @@ void log_request_proto_pair_list(fr_log_lvl_t lvl, request_t *request, 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; diff --git a/src/lib/server/map.c b/src/lib/server/map.c index 1ed41cb3af0..9a8ed723ee4 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -1547,7 +1547,7 @@ int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t f 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); } diff --git a/src/lib/server/map_async.c b/src/lib/server/map_async.c index e15bfbacd34..dd02f51cd89 100644 --- a/src/lib/server/map_async.c +++ b/src/lib/server/map_async.c @@ -820,7 +820,7 @@ static inline fr_pair_t *map_list_mod_to_vp(TALLOC_CTX *ctx, tmpl_t const *attr, talloc_free(vp); return NULL; } - VP_VERIFY(vp); /* Check we created something sane */ + PAIR_VERIFY(vp); /* Check we created something sane */ return vp; } diff --git a/src/lib/server/pair_server_tests.c b/src/lib/server/pair_server_tests.c index 9fa69a32d52..c6bd552fb14 100644 --- a/src/lib/server/pair_server_tests.c +++ b/src/lib/server/pair_server_tests.c @@ -117,9 +117,9 @@ static void test_pair_append_request(void) 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; @@ -138,9 +138,9 @@ static void test_pair_append_reply(void) 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; @@ -160,9 +160,9 @@ static void test_pair_append_control(void) 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; @@ -182,9 +182,9 @@ static void test_pair_append_session_state(void) 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; @@ -203,8 +203,8 @@ static void test_pair_update_request(void) 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; @@ -212,8 +212,8 @@ static void test_pair_update_request(void) 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"); /* @@ -232,8 +232,8 @@ static void test_pair_update_reply(void) 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; @@ -241,8 +241,8 @@ static void test_pair_update_reply(void) 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); @@ -257,8 +257,8 @@ static void test_pair_update_control(void) 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; @@ -266,8 +266,8 @@ static void test_pair_update_control(void) 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); @@ -282,8 +282,8 @@ static void test_pair_update_session_state(void) 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; @@ -291,8 +291,8 @@ static void test_pair_update_session_state(void) 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); diff --git a/src/lib/server/paircmp.c b/src/lib/server/paircmp.c index dcfb95adb70..819c4c3850f 100644 --- a/src/lib/server/paircmp.c +++ b/src/lib/server/paircmp.c @@ -108,7 +108,7 @@ static int packet_cmp(UNUSED void *instance, 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; @@ -123,7 +123,7 @@ static int generic_cmp(UNUSED void *instance, 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; @@ -426,7 +426,7 @@ static int paircmp_func(request_t *request, { paircmp_t *c; - VP_VERIFY(check_item); + PAIR_VERIFY(check_item); /* * Check for =* and !* and return appropriately diff --git a/src/lib/server/password.c b/src/lib/server/password.c index 913775d6c77..3b784da47b7 100644 --- a/src/lib/server/password.c +++ b/src/lib/server/password.c @@ -631,7 +631,7 @@ static fr_pair_t *password_process_header(TALLOC_CTX *ctx, request_t *request, f 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 diff --git a/src/lib/util/dpair_legacy.c b/src/lib/util/dpair_legacy.c index c34beb46ca8..130cda91122 100644 --- a/src/lib/util/dpair_legacy.c +++ b/src/lib/util/dpair_legacy.c @@ -672,7 +672,7 @@ void fr_pair_list_move(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op) for (i = fr_pair_list_head(from); i; ) { fr_pair_t *j; - VP_VERIFY(i); + PAIR_VERIFY(i); /* * We never move Fall-Through. diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 2c97eb9b208..cce5ef44c20 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -332,7 +332,7 @@ fr_pair_t *fr_pair_copy(TALLOC_CTX *ctx, fr_pair_t const *vp) { fr_pair_t *n; - VP_VERIFY(vp); + PAIR_VERIFY(vp); n = fr_pair_afrom_da(ctx, vp->da); if (!n) return NULL; @@ -478,7 +478,7 @@ int fr_pair_to_unknown(fr_pair_t *vp) { fr_dict_attr_t *unknown; - VP_VERIFY(vp); + PAIR_VERIFY(vp); if (vp->da->flags.is_unknown) return 0; @@ -510,7 +510,7 @@ void *fr_pair_iter_next_by_da(fr_dlist_head_t *list, void *to_eval, void *uctx) 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; } @@ -533,7 +533,7 @@ void *fr_pair_iter_next_by_ancestor(fr_dlist_head_t *list, void *to_eval, void * 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; } @@ -577,7 +577,7 @@ fr_pair_t *fr_pair_find_by_da(fr_pair_list_t const *list, fr_dict_attr_t const * 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) { @@ -628,7 +628,7 @@ fr_pair_t *fr_pair_find_by_child_num(fr_pair_list_t *list, fr_dict_attr_t const /* 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; @@ -727,7 +727,7 @@ void *fr_pair_list_tail(fr_pair_list_t const *list) */ 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); @@ -751,7 +751,7 @@ int fr_pair_prepend(fr_pair_list_t *list, fr_pair_t *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); @@ -778,7 +778,7 @@ void fr_pair_replace(fr_pair_list_t *list, fr_pair_t *replace) { fr_pair_t *i; - VP_VERIFY(replace); + PAIR_VERIFY(replace); if (fr_dlist_empty(&list->order)) { fr_pair_append(list, replace); @@ -791,7 +791,7 @@ void fr_pair_replace(fr_pair_list_t *list, fr_pair_t *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, @@ -889,7 +889,7 @@ int fr_pair_update_by_da(TALLOC_CTX *ctx, fr_pair_t **out, fr_pair_list_t *list, vp = fr_pair_find_by_da(list, da, n); if (vp) { - VP_VERIFY(vp); + PAIR_VERIFY(vp); if (out) *out = vp; return 1; } @@ -1000,8 +1000,8 @@ int8_t fr_pair_cmp_by_da(void const *a, void const *b) 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); } @@ -1020,8 +1020,8 @@ static inline int8_t pair_cmp_by_num(void const *a, void const *b) 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); } @@ -1090,8 +1090,8 @@ int fr_pair_cmp(fr_pair_t const *a, fr_pair_t const *b) { 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: @@ -1439,7 +1439,7 @@ int fr_pair_list_copy(TALLOC_CTX *ctx, fr_pair_list_t *to, fr_pair_list_t const 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); @@ -1489,7 +1489,7 @@ int fr_pair_list_copy_by_da(TALLOC_CTX *ctx, fr_pair_list_t *to, 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); @@ -1534,7 +1534,7 @@ int fr_pair_list_copy_by_ancestor(TALLOC_CTX *ctx, fr_pair_list_t *to, 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); @@ -1570,7 +1570,7 @@ int fr_pair_sublist_copy(TALLOC_CTX *ctx, fr_pair_list_t *to, 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); @@ -1663,7 +1663,7 @@ int fr_pair_value_from_str(fr_pair_t *vp, char const *value, ssize_t inlen, char 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; } @@ -1689,7 +1689,7 @@ int fr_pair_value_strdup(fr_pair_t *vp, char const *src, bool tainted) 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; @@ -1712,7 +1712,7 @@ int fr_pair_value_strdup_shallow(fr_pair_t *vp, char const *src, bool tainted) fr_value_box_strdup_shallow(&vp->data, vp->da, src, tainted); vp->type = VT_DATA; - VP_VERIFY(vp); + PAIR_VERIFY(vp); return 0; } @@ -1733,7 +1733,7 @@ int fr_pair_value_strtrim(fr_pair_t *vp) ret = fr_value_box_strtrim(vp, &vp->data); if (ret == 0) { vp->type = VT_DATA; - VP_VERIFY(vp); + PAIR_VERIFY(vp); } return ret; @@ -1760,7 +1760,7 @@ int fr_pair_value_aprintf(fr_pair_t *vp, char const *fmt, ...) if (ret == 0) { vp->type = VT_DATA; - VP_VERIFY(vp); + PAIR_VERIFY(vp); return 0; } @@ -1790,7 +1790,7 @@ int fr_pair_value_bstr_alloc(fr_pair_t *vp, char **out, size_t size, bool tainte 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; @@ -1815,7 +1815,7 @@ int fr_pair_value_bstr_realloc(fr_pair_t *vp, char **out, size_t size) 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; @@ -1846,7 +1846,7 @@ int fr_pair_value_bstrndup(fr_pair_t *vp, char const *src, size_t len, bool tain 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; @@ -1873,7 +1873,7 @@ int fr_pair_value_bstrdup_buffer(fr_pair_t *vp, char const *src, bool tainted) 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; @@ -1896,7 +1896,7 @@ int fr_pair_value_bstrndup_shallow(fr_pair_t *vp, char const *src, size_t len, b 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; } @@ -1920,7 +1920,7 @@ int fr_pair_value_bstrdup_buffer_shallow(fr_pair_t *vp, char const *src, bool ta 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; @@ -1945,7 +1945,7 @@ int fr_pair_value_bstrn_append(fr_pair_t *vp, char const *src, size_t len, bool 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; @@ -1969,7 +1969,7 @@ int fr_pair_value_bstr_append_buffer(fr_pair_t *vp, char const *src, bool tainte 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; @@ -1998,7 +1998,7 @@ int fr_pair_value_mem_alloc(fr_pair_t *vp, uint8_t **out, size_t size, bool tain 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; @@ -2023,7 +2023,7 @@ int fr_pair_value_mem_realloc(fr_pair_t *vp, uint8_t **out, size_t size) 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; @@ -2051,7 +2051,7 @@ int fr_pair_value_memdup(fr_pair_t *vp, uint8_t const *src, size_t size, bool ta 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; @@ -2078,7 +2078,7 @@ int fr_pair_value_memdup_buffer(fr_pair_t *vp, uint8_t const *src, bool tainted) 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; @@ -2101,7 +2101,7 @@ int fr_pair_value_memdup_shallow(fr_pair_t *vp, uint8_t const *src, size_t len, 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; } @@ -2122,7 +2122,7 @@ int fr_pair_value_memdup_buffer_shallow(fr_pair_t *vp, uint8_t const *src, bool 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; } @@ -2147,7 +2147,7 @@ int fr_pair_value_mem_append(fr_pair_t *vp, uint8_t *src, size_t len, bool taint 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; @@ -2171,7 +2171,7 @@ int fr_pair_value_mem_append_buffer(fr_pair_t *vp, uint8_t *src, bool tainted) 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; @@ -2426,7 +2426,7 @@ void fr_pair_list_verify(char const *file, int line, TALLOC_CTX const *expected, 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... @@ -2464,7 +2464,7 @@ void fr_pair_list_tainted(fr_pair_list_t *list) 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: diff --git a/src/lib/util/pair.h b/src/lib/util/pair.h index e49280c9f07..e3f5c28982b 100644 --- a/src/lib/util/pair.h +++ b/src/lib/util/pair.h @@ -168,13 +168,13 @@ void fr_pair_verify(char const *file, int line, fr_pair_t const *vp) CC_HINT(no 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 @@ -199,8 +199,8 @@ DIAG_ON(nonnull-compare) * 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 */ diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index a5da0901c99..852c825895e 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -740,7 +740,7 @@ void fr_pair_list_move(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op) for (i = fr_pair_list_head(from); i; ) { fr_pair_t *j; - VP_VERIFY(i); + PAIR_VERIFY(i); /* * We never move Fall-Through. diff --git a/src/lib/util/pair_legacy_tests.c b/src/lib/util/pair_legacy_tests.c index be40fb29097..fd3526b2dac 100644 --- a/src/lib/util/pair_legacy_tests.c +++ b/src/lib/util/pair_legacy_tests.c @@ -96,8 +96,8 @@ static void test_fr_pair_make(void) 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); @@ -112,14 +112,14 @@ static void test_fr_pair_mark_xlat(void) 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); @@ -142,8 +142,8 @@ static void test_fr_pair_list_afrom_str(void) 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); @@ -151,8 +151,8 @@ static void test_fr_pair_list_afrom_str(void) 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); @@ -191,8 +191,8 @@ static void test_fr_pair_list_afrom_file(void) 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); @@ -200,8 +200,8 @@ static void test_fr_pair_list_afrom_file(void) 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); @@ -232,8 +232,8 @@ static void test_fr_pair_list_move(void) 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); @@ -243,8 +243,8 @@ static void test_fr_pair_list_move(void) 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); diff --git a/src/lib/util/pair_print.c b/src/lib/util/pair_print.c index 9dee92ad40e..c53fdba983c 100644 --- a/src/lib/util/pair_print.c +++ b/src/lib/util/pair_print.c @@ -41,7 +41,7 @@ ssize_t fr_pair_print_value_quoted(fr_sbuff_t *out, fr_pair_t const *vp, fr_toke fr_pair_t *child; fr_dcursor_t cursor; - VP_VERIFY(vp); + PAIR_VERIFY(vp); /* * Legacy crap that needs to be removed @@ -103,7 +103,7 @@ ssize_t fr_pair_print(fr_sbuff_t *out, fr_pair_t const *parent, fr_pair_t const 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]; @@ -140,7 +140,7 @@ void fr_pair_fprint(FILE *fp, fr_pair_t const *vp) 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); @@ -156,7 +156,7 @@ static void fr_pair_list_log_sbuff(fr_log_t const *log, int lvl, fr_pair_t *pare 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); diff --git a/src/lib/util/pair_tests.c b/src/lib/util/pair_tests.c index 42e2ebafa72..bad0852d9f8 100644 --- a/src/lib/util/pair_tests.c +++ b/src/lib/util/pair_tests.c @@ -96,8 +96,8 @@ static void test_fr_pair_afrom_da(void) 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"); @@ -113,8 +113,8 @@ static void test_fr_pair_afrom_child_num(void) 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); @@ -129,13 +129,13 @@ static void test_fr_pair_copy(void) 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; @@ -154,8 +154,8 @@ static void test_fr_pair_steal(void) 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 */ @@ -171,8 +171,8 @@ static void test_fr_pair_to_unknown(void) 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); @@ -198,10 +198,10 @@ static void test_fr_dcursor_iter_by_da_init(void) 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); @@ -226,8 +226,8 @@ static void test_fr_dcursor_iter_by_ancestor_init(void) 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); @@ -240,8 +240,8 @@ static void test_fr_pair_find_by_da(void) 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); @@ -254,8 +254,8 @@ static void test_fr_pair_find_by_child_num(void) 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); @@ -333,8 +333,8 @@ static void test_fr_pair_update_by_da(void) 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); @@ -374,8 +374,8 @@ static void test_fr_pair_cmp(void) 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; @@ -383,8 +383,8 @@ static void test_fr_pair_cmp(void) 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; @@ -443,8 +443,8 @@ static void test_fr_pair_list_copy_by_da(void) 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); @@ -468,8 +468,8 @@ static void test_fr_pair_list_copy_by_ancestor(void) 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; @@ -477,10 +477,10 @@ static void test_fr_pair_list_copy_by_ancestor(void) } } - 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); @@ -546,8 +546,8 @@ static void test_fr_pair_value_copy(void) 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; @@ -565,14 +565,14 @@ static void test_fr_pair_value_from_str(void) 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); @@ -585,14 +585,14 @@ static void test_fr_pair_value_strdup(void) 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); @@ -606,8 +606,8 @@ static void test_fr_pair_value_strdup_shallow(void) 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); @@ -615,8 +615,8 @@ static void test_fr_pair_value_strdup_shallow(void) 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); @@ -631,8 +631,8 @@ static void test_fr_pair_value_strtrim(void) 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); @@ -640,8 +640,8 @@ static void test_fr_pair_value_strtrim(void) 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); @@ -658,14 +658,14 @@ static void test_fr_pair_value_aprintf(void) 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); @@ -679,14 +679,14 @@ static void test_fr_pair_value_bstr_alloc(void) 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); @@ -706,8 +706,8 @@ static void test_fr_pair_value_bstr_realloc(void) 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); @@ -715,8 +715,8 @@ static void test_fr_pair_value_bstr_realloc(void) 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); @@ -735,8 +735,8 @@ static void test_fr_pair_value_bstrndup(void) 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); @@ -753,8 +753,8 @@ static void test_fr_pair_value_bstrdup_buffer(void) 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); @@ -776,8 +776,8 @@ static void test_fr_pair_value_bstrndup_shallow(void) 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); @@ -799,8 +799,8 @@ static void test_fr_pair_value_bstrdup_buffer_shallow(void) 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); @@ -822,8 +822,8 @@ static void test_fr_pair_value_bstrn_append(void) 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); @@ -852,8 +852,8 @@ static void test_fr_pair_value_bstr_append_buffer(void) 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); @@ -864,8 +864,8 @@ static void test_fr_pair_value_bstr_append_buffer(void) 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)"); @@ -885,8 +885,8 @@ static void test_fr_pair_value_mem_alloc(void) 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); @@ -909,8 +909,8 @@ static void test_fr_pair_value_mem_realloc(void) 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); @@ -946,8 +946,8 @@ static void test_fr_pair_value_memdup(void) 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); @@ -964,8 +964,8 @@ static void test_fr_pair_value_memdup_buffer(void) 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); @@ -987,8 +987,8 @@ static void test_fr_pair_value_memdup_shallow(void) 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); @@ -1010,8 +1010,8 @@ static void test_fr_pair_value_memdup_buffer_shallow(void) 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); @@ -1032,8 +1032,8 @@ static void test_fr_pair_value_mem_append(void) 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); @@ -1057,8 +1057,8 @@ static void test_fr_pair_value_mem_append_buffer(void) 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); @@ -1088,8 +1088,8 @@ static void test_fr_pair_value_enum(void) 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; @@ -1110,8 +1110,8 @@ static void test_fr_pair_value_enum_box(void) 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; diff --git a/src/lib/util/print.c b/src/lib/util/print.c index 59f0a6a4d2b..8b18607b0d1 100644 --- a/src/lib/util/print.c +++ b/src/lib/util/print.c @@ -796,7 +796,7 @@ char *fr_vasprintf(TALLOC_CTX *ctx, char const *fmt, va_list ap) goto do_splice; } - VP_VERIFY(in); + PAIR_VERIFY(in); fr_pair_aprint(NULL, &subst, NULL, in); } goto do_splice; diff --git a/src/lib/util/proto.c b/src/lib/util/proto.c index 4118186cd3c..4cce1fec40c 100644 --- a/src/lib/util/proto.c +++ b/src/lib/util/proto.c @@ -105,7 +105,7 @@ void *fr_proto_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx) 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; } diff --git a/src/lib/util/struct.c b/src/lib/util/struct.c index d52b6acfae2..79ae3e9ece2 100644 --- a/src/lib/util/struct.c +++ b/src/lib/util/struct.c @@ -475,7 +475,7 @@ ssize_t fr_struct_to_network(fr_dbuff_t *dbuff, return -1; } - VP_VERIFY(vp); + PAIR_VERIFY(vp); parent = da_stack->da[depth]; if (parent->type != FR_TYPE_STRUCT) { diff --git a/src/modules/rlm_cipher/rlm_cipher.c b/src/modules/rlm_cipher/rlm_cipher.c index d975eec60e7..46329f07306 100644 --- a/src/modules/rlm_cipher/rlm_cipher.c +++ b/src/modules/rlm_cipher/rlm_cipher.c @@ -129,7 +129,7 @@ typedef 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. @@ -865,7 +865,7 @@ static xlat_action_t cipher_rsa_verify_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, /* * 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; @@ -1165,20 +1165,20 @@ static int cipher_rsa_thread_instantiate(UNUSED CONF_SECTION const *conf, void * /* * 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; @@ -1188,13 +1188,13 @@ static int cipher_rsa_thread_instantiate(UNUSED CONF_SECTION const *conf, void * * 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; diff --git a/src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c b/src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c index 6d39d0f6d8b..d24b7bcd4fe 100644 --- a/src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c +++ b/src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c @@ -380,7 +380,7 @@ static unlang_action_t mschap_finalize(rlm_rcode_t *p_result, module_ctx_t const char buf[34]; fr_pair_t *vp = fr_pair_list_head(&response); - VP_VERIFY(vp); + PAIR_VERIFY(vp); RDEBUG2("MSCHAP-Error: %pV", &vp->data); diff --git a/src/modules/rlm_perl/rlm_perl.c b/src/modules/rlm_perl/rlm_perl.c index e4915aac606..cf9c35230e2 100644 --- a/src/modules/rlm_perl/rlm_perl.c +++ b/src/modules/rlm_perl/rlm_perl.c @@ -807,7 +807,7 @@ static int pairadd_sv(TALLOC_CTX *ctx, request_t *request, fr_pair_list_t *vps, 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, ""), hash_name, key, val); @@ -838,7 +838,7 @@ static int get_hv_content(TALLOC_CTX *ctx, request_t *request, HV *my_hv, fr_pai } 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; } diff --git a/src/process/dhcpv6/base.c b/src/process/dhcpv6/base.c index a2b62e31e78..9747cb691a1 100644 --- a/src/process/dhcpv6/base.c +++ b/src/process/dhcpv6/base.c @@ -298,7 +298,7 @@ int restore_field(request_t *request, fr_pair_t **to_restore) { 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) { diff --git a/src/protocols/dhcpv4/base.c b/src/protocols/dhcpv4/base.c index d77d40a3cd6..dbf6b745406 100644 --- a/src/protocols/dhcpv4/base.c +++ b/src/protocols/dhcpv4/base.c @@ -169,8 +169,8 @@ int8_t fr_dhcpv4_attr_cmp(void const *a, void const *b) 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 @@ -285,7 +285,7 @@ bool fr_dhcpv4_is_encodable(void const *item, UNUSED void const *uctx) { fr_pair_t const *vp = item; - VP_VERIFY(vp); + PAIR_VERIFY(vp); return (vp->da->dict == dict_dhcpv4) && (!vp->da->flags.internal); } diff --git a/src/protocols/dhcpv6/base.c b/src/protocols/dhcpv6/base.c index 5dfe76bfdac..4cf5f91ded0 100644 --- a/src/protocols/dhcpv6/base.c +++ b/src/protocols/dhcpv6/base.c @@ -779,7 +779,7 @@ void *fr_dhcpv6_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx) 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; diff --git a/src/protocols/dhcpv6/encode.c b/src/protocols/dhcpv6/encode.c index cce544a49a3..be1c15b92dd 100644 --- a/src/protocols/dhcpv6/encode.c +++ b/src/protocols/dhcpv6/encode.c @@ -108,7 +108,7 @@ static ssize_t encode_value(fr_dbuff_t *dbuff, 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); /* @@ -653,7 +653,7 @@ static ssize_t encode_tlv_hdr(fr_dbuff_t *dbuff, 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) { diff --git a/src/protocols/dns/encode.c b/src/protocols/dns/encode.c index a9d585bd5b9..96dec93f318 100644 --- a/src/protocols/dns/encode.c +++ b/src/protocols/dns/encode.c @@ -110,7 +110,7 @@ static ssize_t encode_value(fr_dbuff_t *dbuff, 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); /* @@ -494,7 +494,7 @@ static ssize_t encode_tlv_hdr(fr_dbuff_t *dbuff, 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) { diff --git a/src/protocols/radius/base.c b/src/protocols/radius/base.c index 8f5352fd970..b2b2eaa2fd5 100644 --- a/src/protocols/radius/base.c +++ b/src/protocols/radius/base.c @@ -884,7 +884,7 @@ void *fr_radius_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx) 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; @@ -997,7 +997,7 @@ ssize_t fr_radius_encode_dbuff(fr_dbuff_t *dbuff, uint8_t const *original, */ 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 diff --git a/src/protocols/radius/encode.c b/src/protocols/radius/encode.c index 0cd5065adff..9ffe08b4fbc 100644 --- a/src/protocols/radius/encode.c +++ b/src/protocols/radius/encode.c @@ -316,7 +316,7 @@ static ssize_t encode_tags(fr_dbuff_t *dbuff, fr_pair_list_t const *vps, void *e 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 @@ -356,7 +356,7 @@ static ssize_t encode_value(fr_dbuff_t *dbuff, fr_dbuff_marker_t value_start, src, dest; bool encrypted = false; - VP_VERIFY(vp); + PAIR_VERIFY(vp); FR_PROTO_STACK_PRINT(da_stack, depth); /* @@ -757,7 +757,7 @@ static ssize_t encode_extended(fr_dbuff_t *dbuff, 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); @@ -1037,7 +1037,7 @@ static ssize_t encode_wimax(fr_dbuff_t *dbuff, fr_dbuff_marker(&hdr, &work_dbuff); - VP_VERIFY(vp); + PAIR_VERIFY(vp); FR_PROTO_STACK_PRINT(da_stack, depth); dv = da_stack->da[depth++]; @@ -1351,7 +1351,7 @@ static ssize_t encode_rfc(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned i /* * Sanity checks */ - VP_VERIFY(vp); + PAIR_VERIFY(vp); FR_PROTO_STACK_PRINT(da_stack, depth); switch (da_stack->da[depth]->type) { @@ -1448,7 +1448,7 @@ ssize_t fr_radius_encode_pair(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *enc 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",