Page MenuHomeFreeBSD

Break up opencrypto/xform.c so it can be reused piecemeal
ClosedPublic

Authored by allanjude on Dec 22 2015, 12:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 16, 11:30 PM
Unknown Object (File)
Sun, Jun 16, 11:30 PM
Unknown Object (File)
Sun, Jun 16, 11:29 PM
Unknown Object (File)
Sun, Jun 16, 11:29 PM
Unknown Object (File)
Sun, Jun 16, 11:29 PM
Unknown Object (File)
Sun, Jun 16, 11:10 PM
Unknown Object (File)
Thu, Jun 6, 4:47 AM
Unknown Object (File)
Apr 30 2024, 6:42 PM
Subscribers

Details

Summary

Keep xform.c as a meta-file including the broken up bits, so that existing code that includes it continues to work
Individual algorithms can now be reused elsewhere, including outside of the kernel (malloc/free macros)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude retitled this revision from to Break up opencrypto/xform.c so it can be reused piecemeal.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
bapt added a reviewer: bapt.
This revision is now accepted and ready to land.Dec 26 2015, 8:41 PM
delphij added a subscriber: delphij.

Add additional reviewers, consider their approval secteam@ reviews as well.

delphij requested changes to this revision.Dec 27 2015, 5:37 PM
delphij added a reviewer: delphij.

The removal of many 'static's in the change doesn't seem right to me (let me know if I'm wrong though). The reason behind them is that we do not want to export the symbols and instead the old code wrapped them in various struct enc_xform's as methods.

Also, the new xform.c have included some other .c files -- is this needed? (The usage is rare; needed sometimes but I think it's not really needed as long as the structs are exported, just like device methods).

This revision now requires changes to proceed.Dec 27 2015, 5:37 PM

The removal of many 'static's in the change doesn't seem right to me (let me know if I'm wrong though). The reason behind them is that we do not want to export the symbols and instead the old code wrapped them in various struct enc_xform's as methods.

Yes, I was doing it wrong. I had to remove the statics to use the functions. What I should have done (and do now) is access them via the exported struct enc_xform

Also, the new xform.c have included some other .c files -- is this needed? (The usage is rare; needed sometimes but I think it's not really needed as long as the structs are exported, just like device methods).

This file exists for compatibility. A number of other places in the tree use xform.c, the 'new' xform.c is just a bunch of #include statements of the various bits, basically glues it back together. I can remove that and update the other components if you think that makes more sense.

allanjude edited edge metadata.

Updated to put the 'static' back

allanjude edited edge metadata.

Fix some more static definitions

Rebase the new .h files for a smaller diff

gnn edited edge metadata.
delphij edited edge metadata.

A quick note (harmless and no action required): the $FreeBSD$ changes -- you seem to keep the contents after colon (:) for the new files, and they can be changed to just $FreeBSD$ or left as-is. Changing these manually would create some surprises and make reviews harder.

Thanks very much for working on modularizing the stuff by the way.

This revision is now accepted and ready to land.Dec 30 2015, 7:48 PM

A quick note (harmless and no action required): the $FreeBSD$ changes -- you seem to keep the contents after colon (:) for the new files, and they can be changed to just $FreeBSD$ or left as-is. Changing these manually would create some surprises and make reviews harder.

Thanks very much for working on modularizing the stuff by the way.

That was actually SVN that did that, because I used 'svn copy', and because I totally rebased the xform_*.h files. Originally, the diff was smaller when they were based off of xform.c, but then you pointed out what I was doing wrong, and the diff was smaller (and the history would make sense) for them to be based on xform.h

Anyway, sorry about the confusion.

This revision was automatically updated to reflect the committed changes.