Page MenuHomeFreeBSD

Use const with some read-only buffers in opencrypto APIs.
ClosedPublic

Authored by jhb on Apr 27 2017, 12:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 15, 3:35 PM
Unknown Object (File)
Mon, Apr 13, 8:42 AM
Unknown Object (File)
Sat, Apr 11, 9:48 PM
Unknown Object (File)
Sat, Apr 11, 3:25 AM
Unknown Object (File)
Sun, Apr 5, 8:11 PM
Unknown Object (File)
Mar 17 2026, 6:47 AM
Unknown Object (File)
Mar 17 2026, 12:47 AM
Unknown Object (File)
Mar 10 2026, 8:50 AM
Subscribers

Details

Summary

Use const with some read-only buffers in opencrypto APIs.

  • Mark the source buffer for a copyback operation as const in the kernel API.
  • Use const with input-only buffers in crypto ioctl structures used with /dev/crypto.
Test Plan
  • passes make tinderbox
  • have tested IPSec + /dev/crypto access (via a testing tool that compares the results of crypto operations on /dev/crypto against OpenSSL's software implementation) against cryptosoft, aesni(4), and a driver for the Chelsio T6 crypto engine

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 8927
Build 9317: arc lint + arc unit

Event Timeline

looks fine, have you verified that the tests in tests/sys/opencrypto pass? they are not present in your test plan.

Also, is your testing tool in the tree?

The testing tool is in the branch https://github.com/freebsd/freebsd/compare/master...bsdjhb:cryptocheck. (These changes are also in that branch, and my intention is to pull smaller bits out one at a time for review.) I will run the other tests, though they are currently still hardcoded for aesni0.

No objection from secteam@ (if we were blocking).

This revision was automatically updated to reflect the committed changes.