-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/rsa: can generate digital signature when hash algorithm (digest method) is set to MD5 in FIPS mode #45565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @FiloSottile |
I checked, my binary uses boringcrypto instead of native boringcrypto ` 4016b0 T _cgo_18935346a3e2_Cfunc__goboringcrypto_BN_bin2bn also I executed my binary with below command. Still digital signature is generated with MD5 digest Note -- |
It's true that the boringcrypto branch allows MD5: go/src/crypto/internal/boring/rsa.go Lines 305 to 314 in b397e0c
go/src/crypto/internal/boring/hmac.go Lines 41 to 44 in b397e0c
|
Also, the only FIPS 140-2 approved[1,2,3] hash functions are SHA-1, SHA-224, SHA-256, SHA-384 SHA-512, SHA-512/224, and SHA-512/256. |
AFAIK, Go+BoringCrypto will not actively stop you from using unapproved algorithms, and the Security Policy mentions it. It's up to the application to operate within the SP requirements. @agl can you confirm this is working as intended? |
I am able to generate signature with md5 hash algorithm in FIPS mode. According to FIPS 140-2 md5 should not be use for digital signature.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not checked
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTOS="linux"
OS=redhat 7.5
What did you do?
below code I'm using to generate digital signature
I have build this code with go-toolset
GOOS=linux GOARCH=amd64 scl enable go-toolset-1.14 'go build -v -o fips-compliance-check'
When I run generated go binary in FIPS enabled host it should fail but unfortunately code is generating signature
I don't know whether is this issue or not.
Or am I lacking some understanding here?
The text was updated successfully, but these errors were encountered: