Tested on FreeBSD 14.2:
uname -rsm
FreeBSD 14.2-RELEASE amd64cd ~/
git clone https://github.com/wolfSSL/wolfssl.git
cd ~/wolfssl
./autogen.sh
./configure --enable-freebsdkm --enable-cryptonly --enable-crypttests --enable-all-crypto && make
file bsdkm/libwolfssl.koLoad the kernel module:
sudo kldload bsdkm/libwolfssl.koIn dmesg output you should see something like:
dmesg | tail -n10
PKCS7enveloped test passed!
PKCS7authenveloped test passed!
mp test passed!
prime test passed!
logging test passed!
mutex test passed!
crypto callback test passed!
Test complete
wolfCrypt self-test passed.
info: wolfkmod init goodand kldstat:
kldstat
Id Refs Address Size Name
1 20 0xffffffff80200000 1f3c6c0 kernel
2 1 0xffffffff82818000 3220 intpm.ko
3 1 0xffffffff8281c000 2178 smbus.ko
4 1 0xffffffff8281f000 430c virtio_console.ko
5 1 0xffffffff82824000 3360 uhid.ko
6 1 0xffffffff82828000 3360 wmt.ko
17 1 0xffffffff8282c000 154520 libwolfssl.kowolfssl will also appear in vmstat entries:
vmstat -m | grep wolf
wolfssl 0 0 1275500 16,32,64,128,256,384,512,1024,2048,4096,8192,16384From this example dir:
make && file bsd_example.koLoad it:
sudo kldload ./bsd_example.kodmesg should show:
dmesg | tail -n5
Test complete
wolfCrypt self-test passed.
info: wolfkmod init good
info: bsdkm_example: running wc_aes_test()
info: bsdkm_example: wc_aes_test goodand kldstat:
kldstat
Id Refs Address Size Name
1 22 0xffffffff80200000 1f3c6c0 kernel
2 1 0xffffffff82818000 3220 intpm.ko
3 1 0xffffffff8281c000 2178 smbus.ko
4 1 0xffffffff8281f000 430c virtio_console.ko
5 1 0xffffffff82824000 3360 uhid.ko
6 1 0xffffffff82828000 3360 wmt.ko
17 2 0xffffffff8282c000 154520 libwolfssl.ko
18 1 0xffffffff82981000 2188 bsd_example.koNotice libwolfssl.ko reference count has incremented.
Unload in the opposite order as loading:
sudo kldunload bsd_example.ko
sudo kldunload libwolfssl.ko
kldstat
Id Refs Address Size Name
1 18 0xffffffff80200000 1f3c6c0 kernel
2 1 0xffffffff82818000 3220 intpm.ko
3 1 0xffffffff8281c000 2178 smbus.ko
4 1 0xffffffff8281f000 430c virtio_console.ko
5 1 0xffffffff82824000 3360 uhid.ko
6 1 0xffffffff82828000 3360 wmt.kowolfssl should now have disappeared from the vmstat listing:
# returns nothing
vmstat -m | grep wolf