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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sef created this revision.Feb 26 2019, 11:05 PM
cem added a reviewer: jhb.Feb 27 2019, 12:12 AM

Seems unobjectionable to me. Ok by you, John?

tools/tools/crypto/cryptocheck.c
114–129 ↗(On Diff #54440)

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

sef added inline comments.Feb 27 2019, 12:16 AM
tools/tools/crypto/cryptocheck.c
114–129 ↗(On Diff #54440)

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

sef updated this revision to Diff 54442.Feb 27 2019, 12:16 AM

Move the #includes around per cem.

jhb accepted this revision.Feb 27 2019, 6:38 PM
jhb added inline comments.
tools/tools/crypto/cryptocheck.c
129 ↗(On Diff #54442)

Extra blank line is a minor nit.

293 ↗(On Diff #54442)

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 ↗(On Diff #54442)

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

sef updated this revision to Diff 54493.Feb 27 2019, 6:53 PM

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.