#2317 md5: try the best to use sha256 instead of md5 and ignore FIPS in other parts
Merged by tkopecek. Opened by julian8628.
julian8628/koji issue/2291  into  master

Download 2317.patch

fixes: #2291

db992436 only fixes the issue of web
813ab0f3 uses an MD5 wrapper ignoring FIPS policy for the calls in other components (It might bring some potential risks, but it looks fully disabling FIPS mode on system-wide is also a bad idea)

1 new commit added

  • a wrapper ignoring FIPS for hashlib.md5

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

:thumbsup:

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

For the first commit: sha1 is dangerously close to being broken. Can we use sha256 here instead?

For the second commit: I understand that this gets Koji working with FIPS enabled, but setting kwargs['usedforsecurity'] = False is misleading IMHO. I would argue that we are using md5 for security when we "authenticate" archive uploads/storage/downloads. We would never use those in a modern system, and I think we need to completely remove all uses of md5 and sha1 from Koji.

@ktdreyer I've added a commit which replaces usage of md5 in upload functions. @julian8628 can you look if it looks sane? https://pagure.io/fork/tkopecek/koji/commits/issue2291

rebased onto b59b41b2fc9ddd843e8616c5b658cc1098cb854d

@tkopecek it looks good, thanks!
I've rebased it, and added an arg name change from hash to checksum.

1 new commit added

  • fix flake8 for kojihub.py

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Commit 2778b7ac fixes this pull-request

Pull-Request has been merged by tkopecek

Please note that the checksums in the upload code path are for sanity, not security. This is why adler32 was the default. Clearly adler32 was not intended to provide strong cryptographic protection. In the upload case. Security in the upload call should come from the call connection itself (https and authentication).

The sums in the upload code are not stored. They are simply used as a sanity check on the upload. I'm not sure FIPS applies to this part.

That makes sense Mike. Thanks for explaining.

I think it will make Koji easier to audit for security problems and easier for new developers to understand the code if we can remove the use of md5 and weak sha methods entirely. Also, historically we've not emphasized HTTPS everywhere, eg #2163

Metadata