[systemd-devel] Preferred library for hash functions

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Aug 9 07:21:43 UTC 2021


On Sun, Aug 08, 2021 at 03:17:40PM -0500, Daniel Parks wrote:
> I'd like to add a feature to systemd-cryptsetup that requires computing
> a sha256 hash. Currently, systemd links to several different crypto
> libraries, and I'm a bit confused what the preferred implementation
> would be.
> 
> Currently I'm thinking about adding a dependency on libopenssl to
> systemd-cryptsetup and falling back to khash if openssl is not
> available at compile time, similar to the design in 
> src/libsystemd/sd-id128/sd-id128.c#L285.
> 
> I do think it's slightly concerning that I would be adding another
> shared library dependency to systemd-cryptsetup, but given that it
> already indirectly depends on libopenssl through libsystemd-shared, I
> think it should be fine.
> 
> What do other people think about this idea?

We plan to switch everything to openssl (now that openssl 3 is coming
out) and require it a hard dependency for libsystemd-shared. So please
just use openssl.

Zbyszek


More information about the systemd-devel mailing list