Skip to content
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

Removes usages of SHA1 for non-cryptographic reasons #38

Open
Radisovik opened this issue Sep 2, 2022 · 3 comments
Open

Removes usages of SHA1 for non-cryptographic reasons #38

Radisovik opened this issue Sep 2, 2022 · 3 comments

Comments

@Radisovik
Copy link

I'm not sure if this can be solved with the current approach. What about cases where protocols demand the usage of SHA-1 for non-cryptographic reasons, for example WebSockets:

https://www.rfc-editor.org/rfc/rfc6455#section-10.8

The WebSocket handshake described in this document doesn't depend on
   any security properties of SHA-1, such as collision resistance or
   resistance to the second pre-image attack (as described in
   [[RFC4270](https://www.rfc-editor.org/rfc/rfc4270)]).

Does that then mean we have to roll a custom SHA-1 code that won't get caught by this patch?

@simo5
Copy link
Collaborator

simo5 commented Sep 5, 2022

SHA-1 should work for non-cryptographic reasons, we should be hard-blocking SHA-1 only in signature generation/verification.

@Radisovik
Copy link
Author

Radisovik commented Sep 6, 2022

hmm.. this call: (https://github.com/gorilla/websocket/blob/af47554f343b4675b30172ac301638d350db34a5/util.go#L20)
h := sha1.New()
Seems to take the boringssl branch and panic..

sha_locl.h(128): OpenSSL internal error, assertion failed: Low level API call to digest SHA1 forbidden in FIPS mode!
SIGABRT: abort
PC=0x7fb19ab34ce1 m=14 sigcode=18446744073709551610
signal...

This is when using golang-fips and FIPS mode is enabled in openssl.

@jjlin
Copy link

jjlin commented Nov 16, 2022

@Radisovik This probably means you're using a (non-RHEL) OpenSSL that forbids use of the low-level APIs in FIPS mode. This should be resolved whenever golang-fips/openssl#27 gets merged into mainline, as that PR switches to using the (high-level) EVP APIs for hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants