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

Implement version check functions in Go using special tags #261

Open
wants to merge 5 commits into
base: v2
Choose a base branch
from

Conversation

qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented Mar 5, 2025

This PR removes all C code from goopenssl.c (the only remaining non-autogenerated C file!) and implement it in Go, with the main benefit of duplicating C's go_openssl_fips_enabled in favor of Go's FIPS().

This is now possible thanks to have a more flexible mechanism to define and load OpenSSL function. Particularly, this PR added some new functions to shims.h, used when initializing the library, that were previously manually defined and loaded due to not having a valid library handle or not knowing the OpenSSL version at the time they were needed. We now can easily load functions on demand, and even mark them as optional, so implementing the backend initialization logic in Go is trivial.

@qmuntal qmuntal marked this pull request as ready for review March 5, 2025 17:39
Copy link
Collaborator

@dagood dagood left a comment

Choose a reason for hiding this comment

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

I like the approach, just a small naming and an edge case suggestion.

Co-authored-by: Davis Goodin <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants