mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
cryptocheck: Be friendlier when testing software crypto backends
- Fail loudly if we can't change the kern.crypto.allow_soft sysctl. - Add more drivers to the list. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52490
This commit is contained in:
1 parent
79042fd7ed
commit
e63bf6aa52
1 file changed
+7
-2
@@ -362,9 +362,11 @@ enable_user_soft(void)
|
||||
size_t cursize = sizeof(curstate);
|
||||
|
||||
if (sysctlbyname(CRYPT_SOFT_ALLOW, &curstate, &cursize,
|
||||
&on, sizeof(on)) == 0) {
|
||||
&on, sizeof(on)) == 0) {
|
||||
if (curstate == 0)
|
||||
atexit(reset_user_soft);
|
||||
} else {
|
||||
err(1, "sysctl(%s)", CRYPT_SOFT_ALLOW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +375,10 @@ crlookup(const char *devname)
|
||||
{
|
||||
struct crypt_find_op find;
|
||||
|
||||
if (strncmp(devname, "soft", 4) == 0) {
|
||||
if (strncmp(devname, "soft", 4) == 0 ||
|
||||
strncmp(devname, "ossl", 4) == 0 ||
|
||||
strncmp(devname, "aesni", 5) == 0 ||
|
||||
strncmp(devname, "armv8crypto", 11) == 0) {
|
||||
enable_user_soft();
|
||||
return CRYPTO_FLAG_SOFTWARE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user