35RCSID(
"$Id: af9119b609ad976548702b3cdd7a56ec9e599026 $")
37#include <freeradius-devel/fuzzer/common.h>
50#define NUM_DER_ROOTS (sizeof(der_root_names) / sizeof(der_root_names[0]))
75 fr_perror(
"fuzzer_der: DER protocol dictionary is not loaded");
100 void *decode_ctx = NULL;
110 if (len < 2)
return 0;
120 fr_perror(
"fuzzer_der: failed initializing decode_ctx");
124 if (tp->
func(ctx, &vps, buf, len, decode_ctx) > 0) {
int fuzzer_common_init(int *argc, char ***argv, bool load_proto)
Perform all bootstrapping for the fuzzer.
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
fr_dict_attr_t const * fr_dict_attr_by_name(fr_dict_attr_err_t *err, fr_dict_attr_t const *parent, char const *attr))
Locate a fr_dict_attr_t by its name.
fr_dict_attr_t const * fr_dict_root(fr_dict_t const *dict)
Return the root attribute of a dictionary.
fr_dict_t const * fr_dict_by_protocol_name(char const *name)
Lookup a protocol by its name.
fr_test_point_proto_decode_t der_tp_decode_proto
int LLVMFuzzerInitialize(int *argc, char ***argv)
static char const * der_root_names[]
int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
static fr_dict_attr_t const * der_roots[NUM_DER_ROOTS]
HIDDEN fr_dict_t const * dict_der
void fr_pair_list_init(fr_pair_list_t *list)
Initialise a pair list header.
static TALLOC_CTX * talloc_init_const(char const *name)
Allocate a top level chunk with a constant name.
fr_tp_proto_decode_t func
Decoder for proto layer.
fr_test_point_ctx_alloc_t test_ctx
Allocate a test ctx for the encoder.
Entry point for protocol decoders.
void fr_pair_list_debug(FILE *fp, fr_pair_list_t const *list)
Dumps a list to the default logging destination - Useful for calling from debuggers.
#define PAIR_LIST_VERIFY_WITH_CTX(_c, _x)
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
void fr_strerror_clear(void)
Clears all pending messages from the talloc pools.