Fix Maven packages not working on FIPS kernels
On a FIPS kernel with a non-FIPS GitLab build, Maven package uploads previously would fail with 422 Unprocessible Entity errors. This occurred because Workhorse was generating an MD5 sum for the accelerated upload, but the Rails API rejects any use of MD5 in FIPS mode. Workhorse was generating an MD5 sum because its on check for FIPS involves more conditions: 1. The binary has been compiled with the `fips` build tag. 2. The platform is amd64 running on a Linux runtime. 3. The kernel has FIPS enabled (e.g. `/proc/sys/crypto/fips_enabled` is 1). 4. A system OpenSSL can be dynamically loaded via ldopen(). On a standard GitLab installation, 1 is not true, so Workhorse believed it was working in a standard environment. However, GitLab Rails only checks whether the OpenSSL library is FIPS-enabled. To resolve this discrepancy, we now: 1. Pass `UploadHashFunctions` to indicate which hashes should be used in the Workhorse `/authorize` response. 2. Workhorse will use this list to determine which hashes to compute. If the list is empty, Workhorse will assume all hashes can be used. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/380559 Changelog: fixed
显示
- .gitlab/ci/workhorse.gitlab-ci.yml 0 个添加, 1 个删除.gitlab/ci/workhorse.gitlab-ci.yml
- app/uploaders/object_storage.rb 1 个添加, 0 个删除app/uploaders/object_storage.rb
- spec/uploaders/object_storage_spec.rb 12 个添加, 0 个删除spec/uploaders/object_storage_spec.rb
- workhorse/internal/api/api.go 2 个添加, 0 个删除workhorse/internal/api/api.go
- workhorse/internal/upload/body_uploader_test.go 2 个添加, 10 个删除workhorse/internal/upload/body_uploader_test.go
- workhorse/internal/upload/destination/destination.go 1 个添加, 1 个删除workhorse/internal/upload/destination/destination.go
- workhorse/internal/upload/destination/destination_test.go 2 个添加, 10 个删除workhorse/internal/upload/destination/destination_test.go
- workhorse/internal/upload/destination/multi_hash.go 18 个添加, 21 个删除workhorse/internal/upload/destination/multi_hash.go
- workhorse/internal/upload/destination/multi_hash_test.go 52 个添加, 0 个删除workhorse/internal/upload/destination/multi_hash_test.go
- workhorse/internal/upload/destination/upload_opts.go 14 个添加, 11 个删除workhorse/internal/upload/destination/upload_opts.go
- workhorse/internal/upload/uploads_test.go 1 个添加, 8 个删除workhorse/internal/upload/uploads_test.go
- workhorse/upload_test.go 95 个添加, 68 个删除workhorse/upload_test.go
加载中
想要评论请 注册 或 登录