-
Notifications
You must be signed in to change notification settings - Fork 23
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
Encrypt relation's Internal Key in XLog #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I only added a few formatting related comments
src/access/pg_tde_tdemap.c
Outdated
} | ||
if(master_key_info == NULL) | ||
{ | ||
ereport(ERROR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation - it's already there in the original, but now that we move it, it's a good time to fix it
src/access/pg_tde_tdemap.c
Outdated
@@ -394,6 +398,9 @@ pg_tde_xlog_create_fork(XLogReaderState *record) | |||
char *rec = XLogRecGetData(record); | |||
RelFileLocator rlocator; | |||
InternalKey int_key = {0}; | |||
InternalKey int_key_enc = {0}; | |||
uint8 mkey_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like another indentation issue?
src/access/pg_tde_tdemap.c
Outdated
@@ -347,6 +330,27 @@ pg_tde_get_key_file_path(const RelFileLocator *newrlocator) | |||
return key_file_path; | |||
} | |||
|
|||
void | |||
pg_tde_decrypt_internal_key(const InternalKey *in, InternalKey *out, const char *MasterKeyName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MasterKeyName
also seems inconsistent with the other variable/argument names
I reckoned it make sense to run |
@dAdAbird pgIndent is a good idea, but could we do it in a separate PR instead? Maybe even on the entire code? With this now, if you squash and merge, we'll end up with lots of formatting changes and some logic changes in a single commit. |
XLog record with its Internal Key for replication purposes. This commit makes this Key encrypted with the master key. Therefore we have to add also a master key name to XLog. That also means that standbys should have access to the very same master key as the primary. Fix percona#56
674bf4f
to
e0ca0fa
Compare
@dutow I rearranged commits so there are two now - changes and formatting - so we can merge this PR instead of squashing |
e0ca0fa
to
9e699be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
XLog record with its Internal Key for replication purposes. This commit makes this Key encrypted with the master key. Therefore we have to add also a master key name to XLog. That also means that standbys should have access to the very same master key as the primary.
Fix #56