Skip to content

Conversation

@BillBuilt
Copy link

Use crypto/sha256 instead of crypto/md5 for FIPS compliance.

Update deps

@smithcoin
Copy link

Not only for fips, many linters now suggest avoiding md5 for any reason.

@moorereason
Copy link
Contributor

The comment in line 374 should be updated to not reference md5.

What are the implications of this change? From what I can see, the machine ID is only used here:

resty/util.go

Line 375 in 66256ef

b[4], b[5], b[6] = machineID[0], machineID[1], machineID[2]

Which is only called from here:

resty/request.go

Line 1385 in 66256ef

r.RetryTraceID = newGUID()

@BillBuilt
Copy link
Author

BillBuilt commented Sep 29, 2025

When running go code using GOFIPS140=v1.0.0 GODEBUG=fips140=only, if any package is not compliant (MD5), it will fail to build regardless of how it is used.

https://go.dev/doc/security/fips140

I will update the comment. Thanks!

@BillBuilt BillBuilt mentioned this pull request Sep 29, 2025
@jeevatkm jeevatkm added enhancement v3 For resty v3 labels Nov 8, 2025
@jeevatkm jeevatkm added this to the v3.0.0 Milestone milestone Nov 8, 2025
@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.85%. Comparing base (66256ef) to head (37b7419).
⚠️ Report is 6 commits behind head on v3.

Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #1056      +/-   ##
==========================================
+ Coverage   99.82%   99.85%   +0.02%     
==========================================
  Files          18       18              
  Lines        3919     3360     -559     
==========================================
- Hits         3912     3355     -557     
+ Misses          5        3       -2     
  Partials        2        2              
Flag Coverage Δ
unittests 99.85% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillBuilt Thanks for the PR. I'm sorry for the delayed response, I was occupied with my personal stuff.

Can you please revert the go.{mod, sum} file changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants