Skip to content

Fix misleading key_available in inno comply --encryption-audit - #212

Merged
ringo380 merged 1 commit into
masterfrom
fix/encryption-audit-key-available
Jul 18, 2026
Merged

Fix misleading key_available in inno comply --encryption-audit#212
ringo380 merged 1 commit into
masterfrom
fix/encryption-audit-key-available

Conversation

@ringo380

Copy link
Copy Markdown
Owner

Summary

inno comply --encryption-audit derived key_available from encryption_info().is_some(), which is exactly what is_encrypted() returns - both read the same page-0 encryption info. So the report showed key available: yes for any encrypted tablespace even when no --keyring was passed, giving the opposite of a useful signal in a forensic/compliance context.

Fix

  • Add Tablespace::has_decryption_key(), which returns whether a decryption context was actually installed via set_decryption_context() (i.e. a usable key is present).
  • Use it for key_available in encryption_audit().

Now an encrypted tablespace reports key available: no until a working --keyring is supplied, and yes once decryption is set up. Plaintext behavior is unchanged (still no).

Testing

  • cargo fmt --check, release build, and clippy clean on the changed files.
  • Existing compliance/comply tests pass (13 lib + 17 integration).
  • --encryption-audit on the plaintext fixture reports Key available: no as expected.

This was surfaced during review of #211 and left as a follow-up because it needed a new accessor on tablespace.rs.

encryption_audit() derived key_available from encryption_info().is_some(),
which is identical to is_encrypted() - so --encryption-audit reported
"key available: yes" for any encrypted tablespace even when no --keyring
was supplied. Add Tablespace::has_decryption_key(), which reflects whether
a decryption context was actually installed, and use it instead.
@ringo380
ringo380 merged commit ad05103 into master Jul 18, 2026
6 of 12 checks passed
@ringo380
ringo380 deleted the fix/encryption-audit-key-available branch July 18, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant