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

shared link libssl / libcrypto #140

Open
xnox opened this issue Mar 28, 2024 · 2 comments
Open

shared link libssl / libcrypto #140

xnox opened this issue Mar 28, 2024 · 2 comments

Comments

@xnox
Copy link
Contributor

xnox commented Mar 28, 2024

I am wondering if it is possible to do a shared linking to libcrypto/libssl at build time, instead of dlopen.

Would something like that be supported or interesting to implement?

Ideally I wish to have go binaries have a shared link on libssl.so.3, rather than them fail at runtime when they fail to dlopen it.

@dagood
Copy link
Collaborator

dagood commented Mar 28, 2024

I feel like this would be feasible, because the implementation of each "bridge" function is driven by macros that I believe could be used to generate direct calls rather than dlopen-based ones: https://github.com/golang-fips/openssl/blob/v2/shims.h#L112. Conceptually, that's interesting.

I'm less sure about how this would be supported in concert with the dlopen implementation. I would be concerned that it might negatively impact maintainability. (I imagine at the very least, a build tag for each dynamic-link-compatible OpenSSL version would be necessary, and each one added to the testing workflow.)

As far as usage within Microsoft goes, there's no known reason someone would need dynamic linking rather than dynamic loading, so strictly from that perspective, it doesn't seem useful.

Side question: would this implementation also happen to support static linking? I think it might just be a matter of changing the C build flags at that point, and although we can't use this inside Microsoft (by policy) it's something that there's been interest for in the past. Whether FIPS compliance could be achieved this way is a different question. 😄

@xnox
Copy link
Contributor Author

xnox commented Jun 18, 2024

I'm not too sure if one can statically link libssl/libcrypto and yet still be able to load fips provider. Or otherwise put the statically linked libssl/libcrypto into FIPS mode for older releases.

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

2 participants