ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/package/kernel/asr-wl/asr-hostapd/asr-hostapd-2023-06-22/tests/fuzzing/fuzzer-common.c b/package/kernel/asr-wl/asr-hostapd/asr-hostapd-2023-06-22/tests/fuzzing/fuzzer-common.c
new file mode 100644
index 0000000..43b91e1
--- /dev/null
+++ b/package/kernel/asr-wl/asr-hostapd/asr-hostapd-2023-06-22/tests/fuzzing/fuzzer-common.c
@@ -0,0 +1,56 @@
+/*
+ * Common helper functions for fuzzing tools
+ * Copyright (c) 2019, Jouni Malinen <j@w1.fi>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#include "utils/includes.h"
+
+#include "utils/common.h"
+
+
+void wpa_fuzzer_set_debug_level(void)
+{
+	static int first = 1;
+
+	if (first) {
+		char *env;
+
+		first = 0;
+		env = getenv("WPADEBUG");
+		if (env)
+			wpa_debug_level = atoi(env);
+		else
+			wpa_debug_level = MSG_ERROR + 1;
+
+		wpa_debug_show_keys = 1;
+	}
+}
+
+
+#ifndef TEST_LIBFUZZER
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int main(int argc, char *argv[])
+{
+	char *data;
+	size_t len;
+
+	if (argc < 2) {
+		printf("usage: %s <file>\n", argv[0]);
+		return -1;
+	}
+
+	data = os_readfile(argv[1], &len);
+	if (!data) {
+		printf("Could not read '%s'\n", argv[1]);
+		return -1;
+	}
+
+	LLVMFuzzerTestOneInput((const uint8_t *) data, len);
+	os_free(data);
+	return 0;
+}
+#endif /* !TEST_LIBFUZZER */