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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants