Skip to content

Don't use pointless AAD for WAL keys #511

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
wants to merge 1 commit into
base: TDE_REL_17_STABLE
Choose a base branch
from

Conversation

AndersAstrand
Copy link
Collaborator

@AndersAstrand AndersAstrand commented Aug 8, 2025

Using the type field as additional authentication data when encrypting the WAL keys seems silly. It's better to be explicit about no AAD being used.

I did want to use the wal_start as AAD, but that would have needed some rework of the mechanism to write the lsn to the last key after a written wal segment. If there is time I might try to do it before release, but this will have to do for now.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.14%. Comparing base (87c55e6) to head (1016bd4).
⚠️ Report is 1 commits behind head on TDE_REL_17_STABLE.

❌ Your project status has failed because the head coverage (82.14%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           TDE_REL_17_STABLE     #511      +/-   ##
=====================================================
+ Coverage              82.00%   82.14%   +0.13%     
=====================================================
  Files                     24       25       +1     
  Lines                   3162     3186      +24     
  Branches                 514      518       +4     
=====================================================
+ Hits                    2593     2617      +24     
  Misses                   460      460              
  Partials                 109      109              
Components Coverage Δ
access 83.16% <92.85%> (+0.29%) ⬆️
catalog 87.61% <ø> (ø)
common 77.77% <ø> (ø)
encryption 72.97% <ø> (ø)
keyring 73.21% <ø> (ø)
src 94.15% <ø> (ø)
smgr 95.29% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz
Copy link
Collaborator

jeltz commented Aug 8, 2025

AAD mean "additional authenticated data" not "additional authentication data" so you should fix that in the commit message.

@jeltz
Copy link
Collaborator

jeltz commented Aug 8, 2025

I am not opposed to removing it but just saying it is silly is a bit unclear and you should elaborate on it.

Using the type field as additional authenticated data when encrypting
the WAL keys doesn't add any additional protection as the AAD will be
the same for every valid entry in the file. It's more clear to
explicitly not use any AAD so that there is no risk of confusion over
this.

The best option for AAD we have currently is the wal_start field,
however that will require some reworking of the machinery to update the
wal_start of the last key in the file.
@AndersAstrand AndersAstrand force-pushed the tde/dont-use-useless-aad-for-wal-keys branch from 1016bd4 to d9a6577 Compare August 11, 2025 08:20
@AndersAstrand
Copy link
Collaborator Author

I am not opposed to removing it but just saying it is silly is a bit unclear and you should elaborate on it.

Yeah I think I might abandon this and to it properly instead with using the wal_start as AAD.

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.

3 participants