libdnf
libdnf copied to clipboard
Stop using sha1 (for `dnf_sack_get_rpmdb_version`)
Moving this from https://bugzilla.redhat.com/show_bug.cgi?id=1936664
Basically https://github.com/rpm-software-management/libdnf/blob/dnf-4-master/libdnf/utils/crypto/sha1.hpp is (AFAICS) only used by this code but AFAICS we could switch to e.g. sha256 here, at just the cost of computing a different version.
(It seems like this code should really live in librpm)
We have to change the approach how to check rpmdb version. In DNF5 we will use direct information from RPM whether rpmdb changed or not. Therefore I recommend to skip movement from sha1 to sha256 to not use our own calculation at all.
Note that with latest OpenSSL 3 builds, the unconditional use of SHA-1 seems to cause segfault: https://bugzilla.redhat.com/show_bug.cgi?id=2043476.
In fact, the presence of any algorithm obtained from OpenSSL should be checked in run-time.
I think this can be closed, as the "offending" code has already been removed and replaced (6fd718ba8dff16b93679028ddbc0a4aa87dfade3 and 94ab063a35b67b9940effdcd55936246b46ee0e4) and rpm itself has switched to SHA256 for the cookie value.
Closing as resolved