⬢ DragonFlyBSD Kernel Audit
DF-3566 / trigger.c
← back to finding ↓ download raw
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <crypto/siphash/siphash.h>

static int
siphashtest_modevent(module_t mod, int type, void *unused)
{
	switch (type) {
	case MOD_LOAD:
		kprintf("siphashtest: calling SipHash24_TestVectors()\n");
		int r = SipHash24_TestVectors();
		kprintf("siphashtest: result=%d (no panic)\n", r);
		return (0);
	case MOD_UNLOAD:
		return (0);
	default:
		return (EOPNOTSUPP);
	}
}

static moduledata_t siphashtest_mod = {
	"siphashtest",
	siphashtest_modevent,
	NULL
};
DECLARE_MODULE(siphashtest, siphashtest_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);