-
Notifications
You must be signed in to change notification settings - Fork 28
Initial implementation of seed-src handling for wolfprovider #350
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
Open
ColtonWilley
wants to merge
3
commits into
wolfSSL:master
Choose a base branch
from
ColtonWilley:wp_seed_src
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: SEED-SRC Tests | ||
|
|
||
| # START OF COMMON SECTION | ||
| on: | ||
| push: | ||
| branches: [ 'master', 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| # END OF COMMON SECTION | ||
|
|
||
| jobs: | ||
| seed_src_test: | ||
| name: SEED-SRC Test | ||
| runs-on: ubuntu-22.04 | ||
| timeout-minutes: 20 | ||
| strategy: | ||
| matrix: | ||
| wolfssl_ref: [ | ||
| 'master', | ||
| 'v5.8.4-stable'] | ||
| openssl_ref: [ | ||
| 'openssl-3.5.4', | ||
| 'openssl-3.0.17'] | ||
|
|
||
| steps: | ||
| - name: Checkout wolfProvider | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Build and test wolfProvider with SEED-SRC | ||
| run: | | ||
| # Force wolfSSL to not use getrandom syscall via ac_cv_func_getrandom=no. | ||
| # This ensures /dev/urandom is used as the entropy source, which is | ||
| # required to test the SEED-SRC feature's fork-safe caching behavior. | ||
| WOLFSSL_CONFIG_OPTS="--enable-all-crypto --with-eccminsz=192 --with-max-ecc-bits=1024 --enable-opensslcoexist --enable-sha ac_cv_func_getrandom=no" \ | ||
| OPENSSL_TAG=${{ matrix.openssl_ref }} \ | ||
| WOLFSSL_TAG=${{ matrix.wolfssl_ref }} \ | ||
| ./scripts/build-wolfprovider.sh --enable-seed-src | ||
|
|
||
| - name: Print errors | ||
| if: ${{ failure() }} | ||
| run: | | ||
| if [ -f test-suite.log ] ; then | ||
| cat test-suite.log | ||
| fi | ||
| if [ -f scripts/build-release.log ] ; then | ||
| echo "=== Build Release Log (last 100 lines) ===" | ||
| tail -100 scripts/build-release.log | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,24 @@ typedef struct WOLFPROV_CTX { | |
| BIO_METHOD *coreBioMethod; | ||
| } WOLFPROV_CTX; | ||
|
|
||
| #ifdef WP_HAVE_SEED_SRC | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we also need to gate this with |
||
| /* | ||
| * Global /dev/urandom subsystem functions. | ||
| * | ||
| * These manage a cached file handle to /dev/urandom that is opened lazily | ||
| * on first entropy request (matching OpenSSL's default provider behavior). | ||
| * The file stays open so child processes inherit it and can read even | ||
| * in sandboxed environments that block openat(). | ||
| */ | ||
| int wp_urandom_init(void); | ||
| void wp_urandom_cleanup(void); | ||
| int wp_urandom_read(unsigned char* buf, size_t len); | ||
|
|
||
| #ifndef WP_SINGLE_THREADED | ||
| wolfSSL_Mutex *wp_get_urandom_mutex(void); | ||
| #endif | ||
| #endif /* WP_HAVE_SEED_SRC */ | ||
|
|
||
|
|
||
| WC_RNG* wp_provctx_get_rng(WOLFPROV_CTX* provCtx); | ||
| #ifndef WP_SINGLE_THREADED | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider naming this
WP_HAVE_RANDOM_SEEDor similar for consistency withWP_HAVE_RANDOM