-
-
Notifications
You must be signed in to change notification settings - Fork 337
Feature: Digital Signature Verification for HDF5 Plugins #6198
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
brtnfld
wants to merge
141
commits into
develop
Choose a base branch
from
feature/dig_sig_ver
base: develop
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.
+5,431
−3
Open
Changes from 130 commits
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
9740094
Move Digital Signature Feature to Feature Branch (#6154)
glennsong09 4aa0595
Merge branch 'develop' into feature/dig_sig_ver
brtnfld 579ce87
set HDF5_REQUIRE_SIGNED_PLUGINS to OFF by default
brtnfld 8236cb3
Merge branch 'develop' into feature/dig_sig_ver
brtnfld f75ccaf
Merge branch 'develop' into feature/dig_sig_ver
brtnfld 5a65c97
Add signature verification caching for HDF5 plugins
brtnfld 7ca70fe
add readme for users and filter developers
brtnfld 5d0b0aa
windows env fix
brtnfld 4a7d6bc
fix compilation
brtnfld 423f370
fix compilation
brtnfld 78c3fd0
fix doxygen
brtnfld 0141a15
Committing clang-format changes
github-actions[bot] 39e70bf
Merge upstream feature/dig_sig_ver branch
brtnfld 1aa0479
test fix
brtnfld 2db79f0
test fix
brtnfld ca56925
Merge branch 'develop' into feature/dig_sig_ver
brtnfld e4cc12d
Summary of Implemented Enhancements
brtnfld a7b4c60
Committing clang-format changes
github-actions[bot] 76646f1
added missing file
brtnfld 6b8ba46
Fix plugin signature verification test failures
brtnfld 71da3c0
fixed H5SIGN-verify-tests test
brtnfld b6ad544
updated CI parallel tests, windows security, and README
brtnfld e6920ae
Committing clang-format changes
github-actions[bot] f68355e
update documentation and tests
brtnfld 5a26387
Committing clang-format changes
github-actions[bot] 3723644
Refactor H5PLsig.c: Replace Scattered #ifdef with HDF5-Style Macros
brtnfld 7ed28c7
Committing clang-format changes
github-actions[bot] 3fa3f2c
code cleanup
brtnfld 6380f95
Committing clang-format changes
github-actions[bot] 3670f58
code clean-up
brtnfld 30083e9
cleanup
brtnfld dfc01a2
Committing clang-format changes
github-actions[bot] c3fc3ea
Replace compile-time debug flag with runtime HDF5_DEBUG=PL
brtnfld 22ba83b
Change plugin signature config messages from STATUS to VERBOSE
brtnfld db5cdd7
Merge branch 'develop' into feature/dig_sig_ver
brtnfld 31ac6ae
Harden signature cache against mtime-preserving plugin replacement
brtnfld d1ac4cd
Reject plugins from world-writable directories when signatures are en…
brtnfld 6d9ddfa
Simplify plugin signature system to KeyStore-only
brtnfld 702e098
Committing clang-format changes
github-actions[bot] 5b59f9a
Fix H5E_clear_stack calls: remove NULL argument
brtnfld ff53caa
Replace strcpy/strncpy with safer alternatives
brtnfld 8032f1b
Fix h5sign default algorithm, documentation accuracy, and stale comments
brtnfld 35d12d7
Fix h5sign security issues: TOCTOU, weak keys, permissions, and robus…
brtnfld 794a27a
Further harden h5sign: TOCTOU permission check, rollback, and API fixes
brtnfld f136368
Fix misleading error message for passphrase-protected private keys
brtnfld 978b7a9
Add passphrase-protected key section to PLUGIN_SIGNATURE_README
brtnfld a1c5f9c
Committing clang-format changes
github-actions[bot] ea01580
Fix incorrect comments, test ordering race, and add h5sign --force re…
brtnfld 3461f17
Committing clang-format changes
github-actions[bot] 0726ff0
Merge origin/develop: use extract_lib_pkgconfig_info for pkg-config
brtnfld 7aa91ff
Fix H5SIGN-error_already_signed test race condition
brtnfld 6edf59c
Fix signed-plugins CI grep pattern for H5PLint.c
brtnfld 6c0bf68
Remove runtime keystore lock file mechanism
brtnfld 3307782
Committing clang-format changes
github-actions[bot] 3261b38
Hoist directory permission validation to path-table callers
brtnfld 4f42de0
Hash plugin binary once for multi-key signature verification
brtnfld 25914ff
Use HDsleep() instead of POSIX sleep() for Windows compatibility
brtnfld 36b1311
Fix Windows NULL DACL crash risk in H5PL__validate_directory_permissions
brtnfld 1a89123
Drain oversized lines in revoked-signature blocklist parser
brtnfld 9ac640c
Use HDfree() instead of free() for HDrealpath-allocated canonical paths
brtnfld b4d3ded
Committing clang-format changes
github-actions[bot] f094f05
Fix memory leaks, security fail-open, and cache directory permission …
brtnfld eea1d87
Committing clang-format changes
github-actions[bot] 2c48c1e
Fix dead-code confusion, misleading error message, and unify max sign…
brtnfld af73195
Remove redundant ret_value assignment before HGOTO_DONE in H5PL__is_s…
brtnfld 2e662c2
Remove unused footer variable in sign_plugin_file
brtnfld 011d989
Fix magic-number offset, unify PSS check, and complete verbose algo s…
brtnfld 3d3ca3d
Remove trivial H5PL__verify_plugin_signature wrapper
brtnfld f50e7e2
Committing clang-format changes
github-actions[bot] 64bd55d
Fix build errors and warnings in H5PLsig.c
brtnfld 83771a0
Merge branch 'develop' into feature/dig_sig_ver
brtnfld 4323811
Refactor and harden digital signature verification code
brtnfld f28704b
Committing clang-format changes
github-actions[bot] bd95a75
Merge branch 'develop' into feature/dig_sig_ver
brtnfld 14208f0
Fix POSIX header guard to include _WIN32 for Intel icx on Windows (#6…
brtnfld f2f3870
Update documentation for heap ID and vlen data (#6246)
mattjala ee864bb
Remove concurrency group setting from AOCC workflow (#6254)
jhendersonHDF ce5263b
Changes release page to 2.1.0 (#6221)
bmribler 6481974
Update release progress badges to use Priority-based categorization (…
brtnfld 0e82711
Remove 'set -e' from Maven testing scripts (#6262)
jhendersonHDF 0e050f7
Update DOI link in README.md (#6271)
gheber 3a381ab
Minor changes for the migration guide (#6266)
loricooperhdf 3190c17
Bump the github-actions group with 9 updates (#6255)
dependabot[bot] 6cd5167
chore: improve help message consistency (#6253)
hyoklee 83c7763
style: update hdf logos (#6265)
hyoklee 2b8472a
docs: add "later versions" to comment in file-locking.dox (#6241)
hyoklee 55f7dcb
chore: fix typos (#6273)
hyoklee c0e671b
Convert several .txt in release_docs folder to Markdown (#6263)
ajelenak 48a9541
Harden digital signature verification: security fixes and code improv…
brtnfld 39fd1ff
Fix plugin test failures by setting HDF5_PLUGIN_KEYSTORE for test env…
brtnfld 3a2e494
Set HDF5_PLUGIN_KEYSTORE for all plugin tests when signed plugins ena…
brtnfld 655f4fc
Fix H5SIGN test failures on repeated runs by using CTest fixtures
brtnfld 7e9e7d5
Add HDF5_PLUGIN_KEYSTORE to h5copy ERR test macro for signed plugins
brtnfld c1cd29a
Committing clang-format changes
github-actions[bot] 374d5a4
Fix CI configure failures by generating test keystore for signed plugins
brtnfld 1ac5ac1
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld ddb16f8
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld ea9b21f
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld 5f4cbae
Disable zlib/szip on macOS and Windows in signed-plugins CI
brtnfld f5ad074
Fix Windows build and macOS/Linux test failures in signed-plugins CI
brtnfld b3252ee
Fix Windows build: replace mode_t with unsigned in test_plugin_signature
brtnfld b8024cb
Fix Windows build: use HDsetenv/HDunsetenv instead of POSIX setenv/un…
brtnfld edb17c7
Add OpenSSL to PATH for Windows tests in signed-plugins CI
brtnfld d0cf2ba
Copy OpenSSL DLLs to build bin directory for Windows tests
brtnfld 26f4d8c
Secure test keystore ACLs on Windows CI runner
brtnfld 2e6976e
Fix Windows test failures: ACL check and shell commands
brtnfld 234a3fe
Fix Windows OPENSSL_Applink error: use BIO instead of FILE* for PEM I/O
brtnfld f31caf7
Committing clang-format changes
github-actions[bot] f83fff6
Trigger CI after clang-format
brtnfld 2275bd6
Fix remaining Windows test failures in signed-plugins CI
brtnfld 4f3f3ae
Fix Windows plugin loading: remove plugin path dir permission check
brtnfld 858ad42
Committing clang-format changes
github-actions[bot] 869f8f5
Fix Windows keystore permission check for relative/forward-slash paths
brtnfld 5c1fb03
Committing clang-format changes
github-actions[bot] e4cfcdf
Remove debugging steps from signed-plugins CI workflow
brtnfld 958939d
Fix potential directory handle leak in H5PL__load_keys_from_directory
brtnfld 5879f79
Refactor: extract helpers to eliminate DRY violations in plugin signa…
brtnfld 8ed21df
Refactor h5sign test dependencies to use CMake fixtures
brtnfld c2dc58c
Committing clang-format changes
github-actions[bot] f6b7f58
Remove unused OpenSSL version check from CI workflows
brtnfld 221790f
Merge branch 'develop' into feature/dig_sig_ver
brtnfld e8e6dec
Fix CTest dependency cycle in h5sign keystore setup
brtnfld 65a4a56
Restore blank lines removed without reason from develop
brtnfld 8b0b7af
Improve error reporting for missing/unsigned filter plugins
brtnfld ffbcf5a
Merge branch 'develop' into feature/dig_sig_ver
brtnfld ea3773b
Address PR #6198 review comments from jhendersonHDF
brtnfld a6ae9ba
Committing clang-format changes
github-actions[bot] 2a237f1
Address follow-up review comments on encode/decode and algorithm IDs
brtnfld 8570ed2
Committing clang-format changes
github-actions[bot] 754d6f8
Trim README to general guidance, remove prescriptive sysadmin commands
brtnfld 71f2204
Reorder PLUGIN_SIGNATURE_README: users section before developers
brtnfld d9ecf13
Address PR #6198 review comments (March 23)
brtnfld 2d5bf6a
Address remaining PR #6198 review comments
brtnfld 9537775
Add signature revocation test and document revocation file format
brtnfld 5257a35
Committing clang-format changes
github-actions[bot] 30a7a92
Fix revocation test by initializing H5PL package before H5close
brtnfld b9e7406
Add changelog entries for plugin digital signature feature
brtnfld 1ad8a7d
Address follow-up review comments on decode_footer
brtnfld e3d2be4
Committing clang-format changes
github-actions[bot] 8481870
Move workflow permissions to job level; remove stale Windows ACL step
brtnfld b4afd0e
Move MAX_PLUGIN_SIZE check to after signature strip in h5sign
brtnfld 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,141 @@ | ||
| name: Test Signed Plugins | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ develop ] | ||
| pull_request: | ||
| branches: [ develop ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CTEST_OUTPUT_ON_FAILURE: 1 | ||
|
|
||
| jobs: | ||
| # Test signature verification across platforms and configurations | ||
| test-signed-plugins: | ||
| name: "${{ matrix.config.name }}" | ||
| runs-on: ${{ matrix.config.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| config: | ||
| # Linux configurations | ||
| - name: "Linux Serial (Debug + Shared)" | ||
| os: ubuntu-latest | ||
| build_type: Debug | ||
| shared: ON | ||
| parallel: OFF | ||
| generator: "" | ||
|
|
||
| - name: "Linux Serial (Release + Static)" | ||
| os: ubuntu-latest | ||
| build_type: Release | ||
| shared: OFF | ||
| parallel: OFF | ||
| generator: "" | ||
|
|
||
| - name: "Linux Parallel (Debug + Shared)" | ||
| os: ubuntu-latest | ||
| build_type: Debug | ||
| shared: ON | ||
| parallel: ON | ||
| generator: "" | ||
|
|
||
| # macOS configuration | ||
| - name: "macOS Serial (Release + Shared)" | ||
| os: macos-latest | ||
| build_type: Release | ||
| shared: ON | ||
| parallel: OFF | ||
| generator: "" | ||
|
|
||
| # Windows configuration | ||
| - name: "Windows Serial (Release + Shared)" | ||
| os: windows-latest | ||
| build_type: Release | ||
| shared: ON | ||
| parallel: OFF | ||
| generator: "-A x64" | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libssl-dev \ | ||
| zlib1g-dev \ | ||
| libaec-dev | ||
|
|
||
| - name: Install MPI dependencies (Linux) | ||
| if: runner.os == 'Linux' && matrix.config.parallel == 'ON' | ||
| run: | | ||
| sudo apt-get install -y \ | ||
| libopenmpi-dev \ | ||
| openmpi-bin | ||
|
|
||
| - name: Install dependencies (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| brew install openssl@3 | ||
|
|
||
| - name: Generate test RSA key pair (Unix) | ||
| if: runner.os != 'Windows' | ||
| run: | | ||
| openssl genrsa -out ci-test-private.pem 2048 | ||
| openssl rsa -in ci-test-private.pem -pubout -out ci-test-public.pem | ||
| mkdir -p ci-keystore | ||
| cp ci-test-public.pem ci-keystore/ | ||
|
|
||
| - name: Generate test RSA key pair (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| & openssl genrsa -out ci-test-private.pem 2048 | ||
| & openssl rsa -in ci-test-private.pem -pubout -out ci-test-public.pem | ||
| New-Item -ItemType Directory -Force -Path ci-keystore | ||
| Copy-Item ci-test-public.pem ci-keystore/ | ||
|
|
||
| - name: Configure CMake | ||
| shell: bash | ||
| run: | | ||
| EXTRA_FLAGS="" | ||
| if [ "${{ matrix.config.parallel }}" == "ON" ]; then | ||
| EXTRA_FLAGS="-DMPIEXEC_PREFLAGS=--oversubscribe" | ||
| fi | ||
| cmake -B build \ | ||
| ${{ matrix.config.generator }} \ | ||
| -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ | ||
| -DHDF5_REQUIRE_SIGNED_PLUGINS:BOOL=ON \ | ||
| -DHDF5_PLUGIN_KEYSTORE_DIR="${PWD}/ci-keystore" \ | ||
| -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.config.parallel }} \ | ||
| -DBUILD_SHARED_LIBS:BOOL=${{ matrix.config.shared }} \ | ||
| -DBUILD_STATIC_LIBS:BOOL=ON \ | ||
| -DBUILD_TESTING:BOOL=ON \ | ||
| -DHDF5_BUILD_TOOLS:BOOL=ON \ | ||
| -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=${{ runner.os == 'Linux' }} \ | ||
| -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=${{ runner.os == 'Linux' }} \ | ||
| $EXTRA_FLAGS | ||
|
|
||
| - name: Build | ||
| run: cmake --build build --parallel 4 --config ${{ matrix.config.build_type }} | ||
|
|
||
| - name: Copy OpenSSL DLLs (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| Copy-Item "C:\Program Files\OpenSSL\bin\libcrypto-3-x64.dll" build\bin\${{ matrix.config.build_type }}\ | ||
| Copy-Item "C:\Program Files\OpenSSL\bin\libssl-3-x64.dll" build\bin\${{ matrix.config.build_type }}\ | ||
| # Restrict test keystore ACLs so permission check passes | ||
| icacls build\test_keystore /inheritance:r /grant "${env:USERNAME}:(OI)(CI)F" /grant "Administrators:(OI)(CI)F" | ||
|
|
||
| - name: Run Tests | ||
| shell: bash | ||
| run: | | ||
| cd build | ||
| ctest --build-config ${{ matrix.config.build_type }} --parallel 4 --output-on-failure |
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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # | ||
| # Copyright by The HDF Group. | ||
| # All rights reserved. | ||
| # | ||
| # This file is part of HDF5. The full HDF5 copyright notice, including | ||
| # terms governing use, modification, and redistribution, is contained in | ||
| # the COPYING file, which can be found at the root of the source code | ||
| # distribution tree, or in https://www.hdfgroup.org/licenses. | ||
| # If you do not have access to either file, you may request a copy from | ||
| # help@hdfgroup.org. | ||
| # | ||
|
|
||
| #[=======================================================================[.rst: | ||
| SignPlugin | ||
| ---------- | ||
|
|
||
| Provides a CMake function to sign plugin libraries when HDF5_REQUIRE_SIGNED_PLUGINS is enabled. | ||
|
|
||
| .. command:: sign_plugin_target | ||
|
|
||
| Signs a plugin target using the h5sign tool. | ||
|
|
||
| .. code-block:: cmake | ||
|
|
||
| sign_plugin_target(<target> <plugin_dir>) | ||
|
|
||
| ``target`` | ||
| The CMake target to sign (must be a shared library plugin) | ||
|
|
||
| ``plugin_dir`` | ||
| The directory where the plugin will be located after build | ||
|
|
||
| This function adds a post-build command that: | ||
| - Signs the plugin using the h5sign tool | ||
| - Uses the test private key (${CMAKE_BINARY_DIR}/private.pem) | ||
| - Only executes if HDF5_REQUIRE_SIGNED_PLUGINS is enabled | ||
|
|
||
| #]=======================================================================] | ||
|
|
||
| function(sign_plugin_target TARGET PLUGIN_DIR) | ||
| if (HDF5_REQUIRE_SIGNED_PLUGINS) | ||
| add_dependencies(${TARGET} h5sign) | ||
| add_custom_command( | ||
| TARGET ${TARGET} | ||
| POST_BUILD | ||
| COMMAND $<TARGET_FILE:h5sign> | ||
| ARGS -p "${PLUGIN_DIR}/$<TARGET_FILE_NAME:${TARGET}>" | ||
| -k "${CMAKE_BINARY_DIR}/private.pem" | ||
| COMMENT "Signing test plugin ${TARGET} for signature verification" | ||
| ) | ||
| endif() | ||
| endfunction() |
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.
Uh oh!
There was an error while loading. Please reload this page.