Page MenuHomeFreeBSD

Enable soft crypto device support when testing soft crypto devices
AbandonedPublic

Authored by markj on Sep 5 2025, 6:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 7:36 AM
Unknown Object (File)
Fri, Oct 10, 7:36 AM
Unknown Object (File)
Fri, Oct 10, 7:36 AM
Unknown Object (File)
Fri, Oct 10, 1:39 AM
Unknown Object (File)
Tue, Oct 7, 6:13 AM
Unknown Object (File)
Sat, Oct 4, 5:44 AM
Unknown Object (File)
Sun, Sep 28, 4:16 AM
Unknown Object (File)
Thu, Sep 25, 4:43 PM
Subscribers

Details

Summary

The cryptocheck utility only enables software crypto when testing with the soft crypto device.

Since ossl(4) is gated behind the same kern.cryptodevallowsoft sysctl, cryptocheck should also enable soft crypto support when using the ossl crypto device. If this is not done, a cryptic series of generic "Invalid argument" messages are printed when testing with the ossl(4) device.

Test Plan

cryptocheck -a aes-gcm -d ossl0 -z

echo $?
0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think this is ok, but aesni and armv8crypto need the same treatment. And, if one is running as a non-root user, we won't toggle the sysctl and will end up with same errors anyway.

tpearson_raptorengineering.com retitled this revision from Enable soft crypto device support when testing the ossl crypto device to Enable soft crypto device support when testing soft crypto devices.

Added aesni and armv8crypto alongside ossl

I just went ahead and uploaded an extended diff, I hope that's ok: https://reviews.freebsd.org/D52490

tools/tools/crypto/cryptocheck.c
382

4 is not the right length to use for the other strings.

I just went ahead and uploaded an extended diff, I hope that's ok: https://reviews.freebsd.org/D52490

No problem, I consider most of this a trivial change. Was just a landmine I stepped on while trying to get the test framework up and running with near zero documentation.

markj edited reviewers, added: tpearson_raptorengineering.com; removed: markj.

Closing this since a similar change landed in commit e63bf6aa523eb9a865b7ce34d01e75a13818b367