Implement version check functions in Go using special tags #261
+283
−237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'sgo_openssl_fips_enabled
in favor of Go'sFIPS()
.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.