Page MenuHomeFreeBSD

libmd, kern, stand: consolidate md5 implementations (NFC)
ClosedPublic

Authored by kevans on Mar 9 2022, 3:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 12:35 AM
Unknown Object (File)
Oct 5 2024, 3:27 PM
Unknown Object (File)
Sep 30 2024, 7:03 PM
Unknown Object (File)
Sep 30 2024, 3:36 AM
Unknown Object (File)
Sep 11 2024, 4:01 PM
Unknown Object (File)
Sep 8 2024, 8:36 AM
Unknown Object (File)
Sep 4 2024, 11:28 AM
Unknown Object (File)
Aug 29 2024, 4:37 PM

Details

Summary

Reduce the number of md5c.c between the three of these from two to one
by just reaching into the kernel build for both userland builds. The
precedent for this already exists for sha2 in both cases.

_libmd_ symbol privatization bits have been moved to sys/md5.h and
md5.h remains to #include <sys/md5.h> for compatibility.

This stops exporting MD5Pad() in the process because the kernel stopped
exporting it in 502a35d60f4c. soversion is bumped accordingly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Mar 9 2022, 3:34 AM

Interesting, there are many other copies of libmd around (other BSDs, embedded in various software) that include MD5Pad, but checking Debian Code Search I see (unsurprisingly) no users. I am a little torn as our shlib guidelines desire avoiding version bumps, but it would also be silly to restore MD5Pad just to satisfy that.

Interesting, there are many other copies of libmd around (other BSDs, embedded in various software) that include MD5Pad, but checking Debian Code Search I see (unsurprisingly) no users. I am a little torn as our shlib guidelines desire avoiding version bumps, but it would also be silly to restore MD5Pad just to satisfy that.

Yeah; I did a couple other things later in the stack to try and help justify it, as well. I think the *Transform symbols are in the same boat and they keep causing problems with various compiler/linker/flag combos because the implementation symbols should be exported as well.

This revision is now accepted and ready to land.Mar 9 2022, 6:42 PM
ObsoleteFiles.inc
55

Is there a reason this library isn't versioned?

sys/kern/md5c.c
130

These shouldn't have spaces, if you're changing anyway...

ObsoleteFiles.inc
55

It is, but a function is being removed

sys/kern/md5c.c
130

should probably do a style/K&R pass over this whole file first

ObsoleteFiles.inc
55

There's a later change in this stack that introduces symbol versioning