Problem
The "PDV: Master KEK" status-report check (RequirementsHook::masterKeyIsUsable()) hardcodes the local-wrap test strlen(getKeyValue()) === 32. A Master KEK handled by a non-local wrap -- e.g. the vault_transit (OpenBao/Vault Transit) wrap, whose key value is the Transit key name and not 32 raw bytes -- always fails it, so the report shows "N of N tenant Master KEK(s) unusable" even when sealing/unsealing works fine. (Confirmed: a vault_transit Master KEK has a 10-byte value, so both tenants are wrongly flagged.)
Fix
- Add
isUsable(string $masterKeyId): booltoMasterKeyWrapInterface, with a default inMasterKeyWrapBase(the key resolves), overridden by Local (32-byte check) and VaultTransit (Transit key reachable) -- so genuine "backend unreachable" detection is kept, but per wrap. RequirementsHookresolves the wrap by the Master KEK's key type (reusing the existing wrap selection) and delegates toisUsable()instead of hardcoding 32 bytes.
Test coverage
The gap that let this through: no test exercised the check with a non-local wrap. Add a kernel test using the existing TestRecordingWrap (which claims a non-local key type whose key is not 32 bytes), asserting the check reports OK for it and Error when the wrap reports unusable.
Issue fork pdv-3595619
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mably commented