You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new option to enable unit testing for replace default mode (#331)
* Add new option to enable unit testing for replace default mode, directly initializing the openssl default provider
* changes per review comments, name change, consistency checks, documentation.
* Update simple.yml to test with new enable default replace testing option
* Update replace default testing README and script checks
wolfProvider can be configured to replace OpenSSL's default provider, making wolfProvider the default cryptographic provider for all OpenSSL operations. This is useful for applications that want to use wolfSSL's cryptographic implementations without modifying their code.
159
+
160
+
### Replace Default vs. Standard Provider Mode
161
+
162
+
Replace default mode is fundamentally different from the standard provider approach:
163
+
164
+
**Standard Provider Mode:** When wolfProvider is loaded as a standard provider alongside OpenSSL's default provider, applications can still access OpenSSL's native crypto implementations in several ways:
165
+
- When an application explicitly requests a specific provider (e.g., "default") for an algorithm
166
+
- When wolfProvider doesn't implement a particular algorithm, OpenSSL falls back to its built-in implementations
167
+
- If the execution environment does not pick up the specified configuration file enabling
168
+
use of wolfProvider
169
+
170
+
**Replace Default Mode:** This mode patches OpenSSL to disable many of these fallback paths.
171
+
When replace default is enabled:
172
+
- wolfProvider becomes the primary cryptographic provider
173
+
- Requests for the "default" provider are redirected to wolfProvider
174
+
- Requests for the "fips" provider are redirected to wolfProvider
175
+
- Requests for the "wolfProvider" provider are redirected to wolfProvider
176
+
- This ensures maximum use of wolfSSL's cryptographic implementations for testing and validation
177
+
178
+
This makes replace default mode particularly useful for comprehensive testing scenarios where you want to ensure that wolfSSL's implementations are being used throughout the entire system.
179
+
180
+
### Basic Replace Default
181
+
182
+
To build wolfProvider as a replacement for OpenSSL's default provider:
183
+
184
+
```bash
185
+
./scripts/build-wolfprovider.sh --replace-default
186
+
```
187
+
188
+
This patches OpenSSL so that wolfProvider becomes the default provider.
189
+
190
+
### Replace Default with Testing Support
191
+
192
+
For unit testing with replace-default enabled, you need additional support to load the real OpenSSL default provider alongside wolfProvider. This requires both flags:
0 commit comments