Fix misleading key_available in inno comply --encryption-audit - #212
Merged
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
inno comply --encryption-auditderivedkey_availablefromencryption_info().is_some(), which is exactly whatis_encrypted()returns - both read the same page-0 encryption info. So the report showedkey available: yesfor any encrypted tablespace even when no--keyringwas passed, giving the opposite of a useful signal in a forensic/compliance context.Fix
Tablespace::has_decryption_key(), which returns whether a decryption context was actually installed viaset_decryption_context()(i.e. a usable key is present).key_availableinencryption_audit().Now an encrypted tablespace reports
key available: nountil a working--keyringis supplied, andyesonce decryption is set up. Plaintext behavior is unchanged (stillno).Testing
cargo fmt --check, release build, and clippy clean on the changed files.--encryption-auditon the plaintext fixture reportsKey available: noas expected.This was surfaced during review of #211 and left as a follow-up because it needed a new accessor on
tablespace.rs.