From: Alan T. DeKok Date: Sun, 10 Nov 2024 15:30:38 +0000 (-0500) Subject: handle raw / unknown attributes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4ab0d2df4daaecb05b6a5715a87e3f54a1c9e47;p=thirdparty%2Ffreeradius-server.git handle raw / unknown attributes with a "todo" to discover the actual type --- diff --git a/src/lib/util/cbor.c b/src/lib/util/cbor.c index 91ea0897d17..9d126e4b9b4 100644 --- a/src/lib/util/cbor.c +++ b/src/lib/util/cbor.c @@ -1175,11 +1175,19 @@ ssize_t fr_cbor_decode_pair(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dbuff_t *db da = fr_dict_attr_child_by_num(parent, value); if (!da) { - fr_assert(0); /* @todo - yup! */ + /* + * @todo - the value here isn't a cbor octets type, but is instead cbor data. Since cbor + * is typed, we _could_ perhaps instead discover the type from the cbor data, and then + * use that instead. This would involve creating a function which maps cbor types to our + * data types. + */ + da = fr_dict_attr_unknown_raw_afrom_num(ctx, parent, value); + if (!da) goto oom; } vp = fr_pair_afrom_da(ctx, da); if (!vp) { + oom: fr_strerror_const("Out of memory"); return -fr_dbuff_used(&work_dbuff); }