#include <freeradius-devel/tls/strerror.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/sha1.h>
+#include <freeradius-devel/util/decode.h>
#include <freeradius-devel/eap/types.h>
#include "attrs.h"
fr_pair_t *vp;
uint8_t const *p = data;
size_t prefix = 0;
- fr_dict_attr_t *unknown;
fr_aka_sim_ctx_t *packet_ctx = decode_ctx;
break;
case FR_TYPE_OCTETS:
+ if (parent->flags.is_unknown) goto raw;
+
/*
* Get the number of bytes we expect before the value
*/
#endif
fr_assert(parent->parent);
- /*
- * Re-write the attribute to be "raw". It is
- * therefore of type "octets", and will be
- * handled below.
- */
- parent = unknown = fr_dict_unknown_attr_afrom_da(ctx, parent);
- if (!parent) {
- fr_strerror_printf_push("%s[%d]: Internal sanity check failed", __FUNCTION__, __LINE__);
- return -1;
- }
+ if (fr_pair_raw_from_network(ctx, out, parent, p, attr_len) < 0) return -1;
+
+ return attr_len;
}
+ fr_assert(!parent->flags.is_unknown);
+
vp = fr_pair_afrom_da(ctx, parent);
if (!vp) return -1;
- /*
- * For unknown attributes copy the entire value, not skipping
- * any reserved bytes.
- */
- if (parent->flags.is_unknown) {
- fr_pair_value_memdup(vp, p, attr_len, true);
- vp->vp_length = attr_len;
- goto done;
- }
-
switch (parent->type) {
/*
* 0 1 2 3