Percona-Lab / pg_tde

MIT License
107 stars 19 forks source link

Store proper name with version in fork file #95

Closed dutow closed 8 months ago

dutow commented 9 months ago

Currently the fork file stores just the string "master-key", which is incorrect, as it does not contain the version information. To counteract this, at read time it loads the latest master key, but that can be different than the version which was used to encrypt it.

These getLatestKey calls also lead to postgres making many unneccessary calls to vault, making this bug partially responsible for #90.

The fix is simple, from now on we correctly write the entire string including the version number, and read the specified version at read time.

Fixes #94.