Skip to content
Open
Show file tree
Hide file tree
Changes from 137 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 Jan 9, 2026
4aa0595
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Jan 12, 2026
579ce87
set HDF5_REQUIRE_SIGNED_PLUGINS to OFF by default
brtnfld Jan 12, 2026
8236cb3
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Jan 20, 2026
f75ccaf
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Jan 28, 2026
5a65c97
Add signature verification caching for HDF5 plugins
brtnfld Jan 29, 2026
7ca70fe
add readme for users and filter developers
brtnfld Jan 29, 2026
5d0b0aa
windows env fix
brtnfld Jan 29, 2026
4a7d6bc
fix compilation
brtnfld Jan 29, 2026
423f370
fix compilation
brtnfld Jan 29, 2026
78c3fd0
fix doxygen
brtnfld Jan 29, 2026
0141a15
Committing clang-format changes
github-actions[bot] Jan 29, 2026
39e70bf
Merge upstream feature/dig_sig_ver branch
brtnfld Jan 29, 2026
1aa0479
test fix
brtnfld Jan 29, 2026
2db79f0
test fix
brtnfld Jan 29, 2026
ca56925
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Feb 3, 2026
e4cc12d
Summary of Implemented Enhancements
brtnfld Feb 4, 2026
a7b4c60
Committing clang-format changes
github-actions[bot] Feb 4, 2026
76646f1
added missing file
brtnfld Feb 4, 2026
6b8ba46
Fix plugin signature verification test failures
brtnfld Feb 4, 2026
71da3c0
fixed H5SIGN-verify-tests test
brtnfld Feb 4, 2026
b6ad544
updated CI parallel tests, windows security, and README
brtnfld Feb 4, 2026
e6920ae
Committing clang-format changes
github-actions[bot] Feb 4, 2026
f68355e
update documentation and tests
brtnfld Feb 4, 2026
5a26387
Committing clang-format changes
github-actions[bot] Feb 4, 2026
3723644
Refactor H5PLsig.c: Replace Scattered #ifdef with HDF5-Style Macros
brtnfld Feb 4, 2026
7ed28c7
Committing clang-format changes
github-actions[bot] Feb 4, 2026
3fa3f2c
code cleanup
brtnfld Feb 5, 2026
6380f95
Committing clang-format changes
github-actions[bot] Feb 5, 2026
3670f58
code clean-up
brtnfld Feb 5, 2026
30083e9
cleanup
brtnfld Feb 5, 2026
dfc01a2
Committing clang-format changes
github-actions[bot] Feb 5, 2026
c3fc3ea
Replace compile-time debug flag with runtime HDF5_DEBUG=PL
brtnfld Feb 5, 2026
22ba83b
Change plugin signature config messages from STATUS to VERBOSE
brtnfld Feb 5, 2026
db5cdd7
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Feb 12, 2026
31ac6ae
Harden signature cache against mtime-preserving plugin replacement
brtnfld Feb 16, 2026
d1ac4cd
Reject plugins from world-writable directories when signatures are en…
brtnfld Feb 16, 2026
6d9ddfa
Simplify plugin signature system to KeyStore-only
brtnfld Feb 17, 2026
702e098
Committing clang-format changes
github-actions[bot] Feb 17, 2026
5b59f9a
Fix H5E_clear_stack calls: remove NULL argument
brtnfld Feb 17, 2026
ff53caa
Replace strcpy/strncpy with safer alternatives
brtnfld Feb 17, 2026
8032f1b
Fix h5sign default algorithm, documentation accuracy, and stale comments
brtnfld Feb 20, 2026
35d12d7
Fix h5sign security issues: TOCTOU, weak keys, permissions, and robus…
brtnfld Feb 20, 2026
794a27a
Further harden h5sign: TOCTOU permission check, rollback, and API fixes
brtnfld Feb 20, 2026
f136368
Fix misleading error message for passphrase-protected private keys
brtnfld Feb 20, 2026
978b7a9
Add passphrase-protected key section to PLUGIN_SIGNATURE_README
brtnfld Feb 20, 2026
a1c5f9c
Committing clang-format changes
github-actions[bot] Feb 20, 2026
ea01580
Fix incorrect comments, test ordering race, and add h5sign --force re…
brtnfld Feb 21, 2026
3461f17
Committing clang-format changes
github-actions[bot] Feb 21, 2026
0726ff0
Merge origin/develop: use extract_lib_pkgconfig_info for pkg-config
brtnfld Feb 21, 2026
7aa91ff
Fix H5SIGN-error_already_signed test race condition
brtnfld Feb 21, 2026
6edf59c
Fix signed-plugins CI grep pattern for H5PLint.c
brtnfld Feb 22, 2026
6c0bf68
Remove runtime keystore lock file mechanism
brtnfld Feb 23, 2026
3307782
Committing clang-format changes
github-actions[bot] Feb 23, 2026
3261b38
Hoist directory permission validation to path-table callers
brtnfld Feb 23, 2026
4f42de0
Hash plugin binary once for multi-key signature verification
brtnfld Feb 23, 2026
25914ff
Use HDsleep() instead of POSIX sleep() for Windows compatibility
brtnfld Feb 23, 2026
36b1311
Fix Windows NULL DACL crash risk in H5PL__validate_directory_permissions
brtnfld Feb 23, 2026
1a89123
Drain oversized lines in revoked-signature blocklist parser
brtnfld Feb 23, 2026
9ac640c
Use HDfree() instead of free() for HDrealpath-allocated canonical paths
brtnfld Feb 23, 2026
b4d3ded
Committing clang-format changes
github-actions[bot] Feb 23, 2026
f094f05
Fix memory leaks, security fail-open, and cache directory permission …
brtnfld Feb 23, 2026
eea1d87
Committing clang-format changes
github-actions[bot] Feb 23, 2026
2c48c1e
Fix dead-code confusion, misleading error message, and unify max sign…
brtnfld Feb 23, 2026
af73195
Remove redundant ret_value assignment before HGOTO_DONE in H5PL__is_s…
brtnfld Feb 23, 2026
2e662c2
Remove unused footer variable in sign_plugin_file
brtnfld Feb 23, 2026
011d989
Fix magic-number offset, unify PSS check, and complete verbose algo s…
brtnfld Feb 23, 2026
3d3ca3d
Remove trivial H5PL__verify_plugin_signature wrapper
brtnfld Feb 23, 2026
f50e7e2
Committing clang-format changes
github-actions[bot] Feb 23, 2026
64bd55d
Fix build errors and warnings in H5PLsig.c
brtnfld Feb 23, 2026
83771a0
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Feb 23, 2026
4323811
Refactor and harden digital signature verification code
brtnfld Feb 24, 2026
f28704b
Committing clang-format changes
github-actions[bot] Feb 24, 2026
bd95a75
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Feb 27, 2026
14208f0
Fix POSIX header guard to include _WIN32 for Intel icx on Windows (#6…
brtnfld Mar 1, 2026
f2f3870
Update documentation for heap ID and vlen data (#6246)
mattjala Mar 1, 2026
ee864bb
Remove concurrency group setting from AOCC workflow (#6254)
jhendersonHDF Mar 3, 2026
ce5263b
Changes release page to 2.1.0 (#6221)
bmribler Mar 4, 2026
6481974
Update release progress badges to use Priority-based categorization (…
brtnfld Mar 4, 2026
0e82711
Remove 'set -e' from Maven testing scripts (#6262)
jhendersonHDF Mar 4, 2026
0e050f7
Update DOI link in README.md (#6271)
gheber Mar 5, 2026
3a381ab
Minor changes for the migration guide (#6266)
loricooperhdf Mar 5, 2026
3190c17
Bump the github-actions group with 9 updates (#6255)
dependabot[bot] Mar 5, 2026
6cd5167
chore: improve help message consistency (#6253)
hyoklee Mar 5, 2026
83c7763
style: update hdf logos (#6265)
hyoklee Mar 6, 2026
2b8472a
docs: add "later versions" to comment in file-locking.dox (#6241)
hyoklee Mar 6, 2026
55f7dcb
chore: fix typos (#6273)
hyoklee Mar 6, 2026
c0e671b
Convert several .txt in release_docs folder to Markdown (#6263)
ajelenak Mar 8, 2026
48a9541
Harden digital signature verification: security fixes and code improv…
brtnfld Mar 9, 2026
39fd1ff
Fix plugin test failures by setting HDF5_PLUGIN_KEYSTORE for test env…
brtnfld Mar 9, 2026
3a2e494
Set HDF5_PLUGIN_KEYSTORE for all plugin tests when signed plugins ena…
brtnfld Mar 9, 2026
655f4fc
Fix H5SIGN test failures on repeated runs by using CTest fixtures
brtnfld Mar 9, 2026
7e9e7d5
Add HDF5_PLUGIN_KEYSTORE to h5copy ERR test macro for signed plugins
brtnfld Mar 9, 2026
c1cd29a
Committing clang-format changes
github-actions[bot] Mar 9, 2026
374d5a4
Fix CI configure failures by generating test keystore for signed plugins
brtnfld Mar 9, 2026
1ac5ac1
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld Mar 9, 2026
ddb16f8
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld Mar 9, 2026
ea9b21f
Remove signed plugins from main CI workflows; tested in signed-plugin…
brtnfld Mar 9, 2026
5f4cbae
Disable zlib/szip on macOS and Windows in signed-plugins CI
brtnfld Mar 9, 2026
f5ad074
Fix Windows build and macOS/Linux test failures in signed-plugins CI
brtnfld Mar 9, 2026
b3252ee
Fix Windows build: replace mode_t with unsigned in test_plugin_signature
brtnfld Mar 9, 2026
b8024cb
Fix Windows build: use HDsetenv/HDunsetenv instead of POSIX setenv/un…
brtnfld Mar 9, 2026
edb17c7
Add OpenSSL to PATH for Windows tests in signed-plugins CI
brtnfld Mar 9, 2026
d0cf2ba
Copy OpenSSL DLLs to build bin directory for Windows tests
brtnfld Mar 9, 2026
26f4d8c
Secure test keystore ACLs on Windows CI runner
brtnfld Mar 9, 2026
2e6976e
Fix Windows test failures: ACL check and shell commands
brtnfld Mar 9, 2026
234a3fe
Fix Windows OPENSSL_Applink error: use BIO instead of FILE* for PEM I/O
brtnfld Mar 9, 2026
f31caf7
Committing clang-format changes
github-actions[bot] Mar 9, 2026
f83fff6
Trigger CI after clang-format
brtnfld Mar 9, 2026
2275bd6
Fix remaining Windows test failures in signed-plugins CI
brtnfld Mar 10, 2026
4f3f3ae
Fix Windows plugin loading: remove plugin path dir permission check
brtnfld Mar 10, 2026
858ad42
Committing clang-format changes
github-actions[bot] Mar 10, 2026
869f8f5
Fix Windows keystore permission check for relative/forward-slash paths
brtnfld Mar 10, 2026
5c1fb03
Committing clang-format changes
github-actions[bot] Mar 10, 2026
e4cfcdf
Remove debugging steps from signed-plugins CI workflow
brtnfld Mar 10, 2026
958939d
Fix potential directory handle leak in H5PL__load_keys_from_directory
brtnfld Mar 10, 2026
5879f79
Refactor: extract helpers to eliminate DRY violations in plugin signa…
brtnfld Mar 10, 2026
8ed21df
Refactor h5sign test dependencies to use CMake fixtures
brtnfld Mar 10, 2026
c2dc58c
Committing clang-format changes
github-actions[bot] Mar 10, 2026
f6b7f58
Remove unused OpenSSL version check from CI workflows
brtnfld Mar 10, 2026
221790f
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Mar 10, 2026
e8e6dec
Fix CTest dependency cycle in h5sign keystore setup
brtnfld Mar 10, 2026
65a4a56
Restore blank lines removed without reason from develop
brtnfld Mar 10, 2026
8b0b7af
Improve error reporting for missing/unsigned filter plugins
brtnfld Mar 17, 2026
ffbcf5a
Merge branch 'develop' into feature/dig_sig_ver
brtnfld Mar 19, 2026
ea3773b
Address PR #6198 review comments from jhendersonHDF
brtnfld Mar 20, 2026
a6ae9ba
Committing clang-format changes
github-actions[bot] Mar 20, 2026
2a237f1
Address follow-up review comments on encode/decode and algorithm IDs
brtnfld Mar 20, 2026
8570ed2
Committing clang-format changes
github-actions[bot] Mar 20, 2026
754d6f8
Trim README to general guidance, remove prescriptive sysadmin commands
brtnfld Mar 20, 2026
71f2204
Reorder PLUGIN_SIGNATURE_README: users section before developers
brtnfld Mar 20, 2026
d9ecf13
Address PR #6198 review comments (March 23)
brtnfld Mar 24, 2026
2d5bf6a
Address remaining PR #6198 review comments
brtnfld Mar 24, 2026
9537775
Add signature revocation test and document revocation file format
brtnfld Mar 24, 2026
5257a35
Committing clang-format changes
github-actions[bot] Mar 24, 2026
30a7a92
Fix revocation test by initializing H5PL package before H5close
brtnfld Mar 24, 2026
b9e7406
Add changelog entries for plugin digital signature feature
brtnfld Mar 24, 2026
1ad8a7d
Address follow-up review comments on decode_footer
brtnfld Mar 25, 2026
e3d2be4
Committing clang-format changes
github-actions[bot] Mar 25, 2026
8481870
Move workflow permissions to job level; remove stale Windows ACL step
brtnfld Mar 25, 2026
b4afd0e
Move MAX_PLUGIN_SIZE check to after signature strip in h5sign
brtnfld Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/signed-plugins.yml
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
82 changes: 82 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,88 @@ if (HDF5_ENABLE_HDFS)
endif ()
endif ()

#-----------------------------------------------------------------------------
# Option to Require Digitally Signed plugins
#-----------------------------------------------------------------------------
option (HDF5_REQUIRE_SIGNED_PLUGINS "Require digitally signed plugins" OFF)

cmake_dependent_option (HDF5_LOCK_PLUGIN_KEYSTORE "Disable HDF5_PLUGIN_KEYSTORE environment variable override (security hardening)" OFF "HDF5_REQUIRE_SIGNED_PLUGINS" OFF)
mark_as_advanced(HDF5_LOCK_PLUGIN_KEYSTORE)

if (HDF5_REQUIRE_SIGNED_PLUGINS)
# KeyStore directory for multiple trusted public keys
set(HDF5_PLUGIN_KEYSTORE_DIR "" CACHE PATH
"Directory containing trusted public keys (.pem files) for plugin verification")
# Find OpenSSL for RSA signature verification
find_package(OpenSSL REQUIRED)
if (NOT OPENSSL_FOUND)
message(FATAL_ERROR "OpenSSL is required for HDF5_REQUIRE_SIGNED_PLUGINS but was not found")
endif ()

# Check minimum OpenSSL version
# The signature verification implementation uses modern EVP API (EVP_DigestVerifyInit,
# EVP_DigestVerifyUpdate, EVP_DigestVerifyFinal) which requires OpenSSL 1.1.0+
if (OPENSSL_VERSION VERSION_LESS "1.1.0")
message(FATAL_ERROR
"OpenSSL 1.1.0 or later is required for HDF5_REQUIRE_SIGNED_PLUGINS\n"
" Found: OpenSSL ${OPENSSL_VERSION}\n"
" Required: OpenSSL 1.1.0 or later\n"
"\n"
"The signature verification implementation uses modern EVP API which is not\n"
"available in OpenSSL 1.0.2 and earlier versions.\n"
"\n"
"Solutions:\n"
" 1. Upgrade to OpenSSL 3.0 or later (recommended)\n"
" - OpenSSL 3.0 is LTS (supported until 2026-09-07)\n"
" - OpenSSL 3.4+ is also supported\n"
" 2. Use LibreSSL 2.7.0 or later (compatible alternative)\n"
" 3. Disable signed plugins: -DHDF5_REQUIRE_SIGNED_PLUGINS=OFF\n"
"\n"
"Note: OpenSSL 1.0.2 reached end-of-life in December 2019\n"
" CentOS 7 users should install openssl11 package")
endif ()

# Informational message for OpenSSL 3.0+ (APIs are compatible, not deprecated)
if (OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
message(STATUS "OpenSSL 3.0+ detected - all EVP_* APIs are compatible (not deprecated)")
endif ()

# KeyStore directory is optional at build time; the HDF5_PLUGIN_KEYSTORE
# environment variable can be used at runtime instead. Require a compile-time
# directory only when the environment variable override is locked out.
if (HDF5_LOCK_PLUGIN_KEYSTORE AND NOT HDF5_PLUGIN_KEYSTORE_DIR)
message(FATAL_ERROR
"HDF5_LOCK_PLUGIN_KEYSTORE=ON requires a compile-time KeyStore directory:\n"
" -DHDF5_PLUGIN_KEYSTORE_DIR=/etc/hdf5/trusted_keys")
endif ()

# Configure KeyStore directory if provided.
# Note: the path is embedded as a string literal in the library binary.
# Use the HDF5_PLUGIN_KEYSTORE environment variable instead if the path
# should not be visible in the binary.
if (HDF5_PLUGIN_KEYSTORE_DIR)
add_compile_definitions(H5PL_KEYSTORE_DIR="${HDF5_PLUGIN_KEYSTORE_DIR}")
else ()
message(NOTICE "No compile-time KeyStore directory configured; "
"set HDF5_PLUGIN_KEYSTORE environment variable at runtime.")
endif ()

# Enable digital signature verification (goes into H5pubconf.h)
set(H5_REQUIRE_DIGITAL_SIGNATURE 1)

# Security: Disable environment variable override if requested
if (HDF5_LOCK_PLUGIN_KEYSTORE)
add_compile_definitions(H5PL_DISABLE_ENV_KEYSTORE)
message(VERBOSE "HDF5_PLUGIN_KEYSTORE environment variable override: DISABLED (security hardening)")
endif ()

# Add OpenSSL to link libraries for the HDF5 library
# Only libcrypto is needed (EVP, PEM, BIO, ERR APIs); libssl (TLS) is not used
list(APPEND LINK_LIBS OpenSSL::Crypto)

message(VERBOSE "Digital signature verification enabled (OpenSSL ${OPENSSL_VERSION})")
endif ()

#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
Expand Down
52 changes: 52 additions & 0 deletions config/cmake/SignPlugin.cmake
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()
7 changes: 6 additions & 1 deletion config/cmake/runExecute.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ macro (STREAM_STRINGS stream strings_out)
endmacro()

macro (EXECUTE_TEST)
cmake_parse_arguments (TEST "" "NOERRDISPLAY;EXPECT;JAVA;CLASSPATH;PROGRAM;FOLDER;OUTPUT;LIBRARY_DIRECTORY;INPUT;ENV_VAR;ENV_VALUE;EMULATOR;ARGS" "TEST_" ${ARGN})
cmake_parse_arguments (TEST "" "NOERRDISPLAY;EXPECT;JAVA;CLASSPATH;PROGRAM;FOLDER;OUTPUT;LIBRARY_DIRECTORY;INPUT;ENV_VAR;ENV_VALUE;KEYSTORE_DIR;EMULATOR;ARGS" "TEST_" ${ARGN})
if (NOT TEST_PROGRAM)
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
Expand Down Expand Up @@ -88,6 +88,11 @@ if (TEST_ENV_VAR)
message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()

if (TEST_KEYSTORE_DIR)
set (ENV{HDF5_PLUGIN_KEYSTORE} "${TEST_KEYSTORE_DIR}")
message (TRACE "ENV:HDF5_PLUGIN_KEYSTORE=$ENV{HDF5_PLUGIN_KEYSTORE}")
endif ()

if (NOT TEST_JAVA)
message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (NOT TEST_INPUT)
Expand Down
1 change: 1 addition & 0 deletions config/cmake/runTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ EXECUTE_TEST (TEST_FOLDER ${TEST_FOLDER}
TEST_LIBRARY_DIRECTORY ${TEST_LIBRARY_DIRECTORY}
TEST_ENV_VAR ${TEST_ENV_VAR}
TEST_ENV_VALUE ${TEST_ENV_VALUE}
TEST_KEYSTORE_DIR ${TEST_KEYSTORE_DIR}
TEST_INPUT ${TEST_INPUT}
TEST_CLASSPATH ${TEST_CLASSPATH}
TEST_NOERRDISPLAY ${TEST_NOERRDISPLAY}
Expand Down
8 changes: 8 additions & 0 deletions release_docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ We would like to thank the many HDF5 community members who contributed to this r

## Library

### Added optional digital signature verification for dynamically loaded plugins

When built with `-DHDF5_REQUIRE_SIGNED_PLUGINS=ON` and OpenSSL, HDF5 will cryptographically verify each plugin before loading it. Plugins are signed with the new `h5sign` tool, which appends an RSA signature and a compact footer to the plugin binary. Verification uses a keystore directory of trusted public keys, configurable at compile time (`-DHDF5_PLUGIN_KEYSTORE_DIR=<path>`) or at runtime via the `HDF5_PLUGIN_KEYSTORE` environment variable. Individual signatures can be revoked without removing the entire public key by listing their SHA-256 hashes in a `revoked_signatures.txt` file in the keystore directory. Supported algorithms include SHA-256, SHA-384, and SHA-512 with both PKCS#1 v1.5 and PSS padding. See `release_docs/PLUGIN_SIGNATURE_README.md` for details.

### Improve performance of H5Ovisit() with deeply nested group structures

`H5Ovisit()` would previously internally traverse each object's path name from the iteration root group in order to retrieve information about that object, causing severe performance degradation with a deeply nested group structure. Modified the algorithm to instead retrieve information directly from the object. To get this benefit, users should use `H5Ovisit3()`, or use `H5Ovisit2()` with neither `H5O_INFO_HDR` nor `H5O_INFO_META_SIZE` selected in the `fields` parameter. Performance of `H5Ocopy()`, `H5Iget_name()`, and external links with a callback set should also improve in similar situations.
Expand All @@ -106,6 +110,10 @@ We would like to thank the many HDF5 community members who contributed to this r

## Tools

### Added `h5sign` tool for signing plugins with RSA digital signatures

The `h5sign` command-line tool signs HDF5 plugin shared libraries by appending an RSA signature and a 12-byte footer. It supports SHA-256, SHA-384, SHA-512, and their PSS variants, and accepts passphrase-protected private keys. Use `-f` / `--force` to strip an existing signature before re-signing. The tool is built automatically when `HDF5_REQUIRE_SIGNED_PLUGINS` is enabled.

## High-Level APIs

## C Packet Table API
Expand Down
Loading
Loading