Page MenuHomeFreeBSD

Have cryptocheck toggle kern.cryptodevallowsoft as needed
ClosedPublic

Authored by sef on Feb 26 2019, 11:05 PM.

Details

Summary

If '-d soft' is given, have it set kern.cryptodevallowsoft to 1 if needed (and use atexit to set it back to 0 if that's how it started out).

I did not set up any signal handlers, however.

Test Plan

sysctl kern.cryptodevallowsoft
sudo cryptocheck -A 0 -a aes-gcm -d soft 100
sysctl kern.cryptodevallowsoft

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Seems unobjectionable to me. Ok by you, John?

tools/tools/crypto/cryptocheck.c
115–130

sys/ includes sort to the top; sys/types.h is redundant due to sys/param.h, per style(9).

tools/tools/crypto/cryptocheck.c
115–130

Ok, but that's straight out of the man page for sysctlbyname(3).

Move the #includes around per cem.

jhb added inline comments.
tools/tools/crypto/cryptocheck.c
129

Extra blank line is a minor nit.

293

Maybe call this 'enable_user_soft' instead of 'check'.

This revision is now accepted and ready to land.Feb 27 2019, 6:38 PM
sef marked an inline comment as done.Feb 27 2019, 6:52 PM
sef added inline comments.
tools/tools/crypto/cryptocheck.c
129

Ah, caused by when I move the <sys/> line around. Fixed :).

Feedback from jhb. (Just uploaded for completeness sake; I'll be checking it in after I update my svn source, apply the patch, and do a buildworld just to make sure I didn't do anything stupid again.)

This revision now requires review to proceed.Feb 27 2019, 6:53 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 27 2019, 7:27 PM
This revision was automatically updated to reflect the committed changes.