Skip to content

Conversation

@ColtonWilley
Copy link
Contributor

Add new option to enable unit testing for replace default mode, directly initializing the openssl default provider

…tly initializing the openssl default provider
fi

# Patch libcrypto.num for replace-default-testing mode
if [ "$WOLFPROV_REPLACE_DEFAULT_TESTING" = "1" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also require "$WOLFPROV_REPLACE_DEFAULT" = "1" here?

--replace-default)
WOLFPROV_REPLACE_DEFAULT=1
;;
--enable-replace-default-testing)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should error out if --replace-default is not also set in the cmd line options. Alternatively, force it on whenever this new arg is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now errors if replace default not also set

WOLFPROV_REPLACE_DEFAULT=1
;;
--enable-replace-default-testing)
WOLFPROV_REPLACE_DEFAULT_TESTING=1
Copy link
Contributor

Choose a reason for hiding this comment

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

In the C code this is called WP_ENABLE_REPLACE_DEFAULT_UNIT_TEST. In the scripts, we have WOLFPROV_REPLACE_DEFAULT_TESTING. Can we make the names more closely aligned?

Fwiw: there are no other WP_ENABLE_* defines...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Name updated to be consistent

# Final warning for replace-default-testing builds
if [ "$WOLFPROV_REPLACE_DEFAULT_TESTING" = "1" ]; then
printf "\n"
printf "╔══════════════════════════════════════════════════════════════════════════╗\n"
Copy link
Contributor

@padelsbach padelsbach Nov 13, 2025

Choose a reason for hiding this comment

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

Consider deleting/cleaning the outputs at this point to ensure this version doesn't remain beyond this point. I believe the sole purpose of this build is to run the unit tests.

@padelsbach
Copy link
Contributor

Can we add the new mode to a CI workflow? Maybe simple.yml?

@SparkiDev
Copy link
Contributor

Do we have customers wanting to do this?

@ColtonWilley
Copy link
Contributor Author

Do we have customers wanting to do this?

Well since I came up with replace-default, every single prospective customer has wanted the replace default option. Without this PR, we have no way to unit test wolfProvider against an openssl built with replace default. We are still in early stages with many of them, but they are already starting to ask about testing/verification. I thought this was a decent way to keep our original testing strategy against the openssl that most closely resembles what they will run in production.

@SparkiDev
Copy link
Contributor

Document this then in the README.md then.
Add examples to show customers how to do this.

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.

3 participants