-
Notifications
You must be signed in to change notification settings - Fork 22
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
Renamed master key to principal key #228
Conversation
dd15e3b
to
6ee4ea4
Compare
This commit contains lots of changes, but it's just a repeated execution of find <...> -exec sed <...>, so everything should work as before.
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.
I made a couple of comments marking not renamed entities. But there are quite a bit of them.
I think patterns MasterKey and masterKey were omitted.
Plus there is a variable mastere_key_info
(a misspelling and a snake case) in load_latest_versioned_key_name() (src/catalog/tde_principal_key.c)
src/access/pg_tde_tdemap.c
Outdated
@@ -63,7 +63,7 @@ | |||
typedef struct TDEFileHeader | |||
{ | |||
int32 file_version; | |||
TDEMasterKeyInfo master_key_info; | |||
TDEMasterKeyInfo principal_key_info; |
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.
It makes sense to rename the type as well
src/access/pg_tde_tdemap.c
Outdated
XLogRelKey xlrec; | ||
|
||
master_key = GetMasterKey(newrlocator->dbOid, newrlocator->spcOid, NULL); | ||
if (master_key == NULL) | ||
principal_key = GetMasterKey(newrlocator->dbOid, newrlocator->spcOid, NULL); |
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.
and the function
src/access/pg_tde_tdemap.c
Outdated
@@ -260,12 +260,12 @@ tde_encrypt_rel_key(TDEMasterKey *master_key, RelKeyData *rel_key_data, const Re | |||
* Decrypts a given key and returns the decrypted one. | |||
*/ | |||
RelKeyData * | |||
tde_decrypt_rel_key(TDEMasterKey *master_key, RelKeyData *enc_rel_key_data, const RelFileLocator *rlocator) | |||
tde_decrypt_rel_key(TDEMasterKey *principal_key, RelKeyData *enc_rel_key_data, const RelFileLocator *rlocator) |
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.
TDEMasterKey
src/catalog/tde_global_catalog.c
Outdated
@@ -215,7 +215,7 @@ init_gl_catalog_keys(void) | |||
} | |||
|
|||
static TDEMasterKey * | |||
create_master_key(const char *key_name, GenericKeyring * keyring, | |||
create_principal_key(const char *key_name, GenericKeyring * keyring, | |||
Oid dbOid, Oid spcOid, bool ensure_new_key) | |||
{ | |||
TDEMasterKey *masterKey; |
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.
The variable name (along with the type)
src/catalog/tde_principal_key.c
Outdated
/* parameter for the master key info shared hash */ | ||
static dshash_parameters master_key_dsh_params = { | ||
/* parameter for the principal key info shared hash */ | ||
static dshash_parameters principal_key_dsh_params = { | ||
sizeof(Oid), | ||
sizeof(TDEMasterKey), | ||
dshash_memcmp, /* TODO use int compare instead */ | ||
dshash_memhash}; | ||
|
||
TdeMasterKeylocalState masterKeyLocalState; |
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.
Both the type and variable
@dAdAbird yes, I only searched for master.key, not [mM]aster[k]Key. Fixed now. |
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.
Found a couple more
src/access/pg_tde_tdemap.c
Outdated
@@ -1021,12 +1021,12 @@ pg_tde_get_key_from_file(const RelFileLocator *rlocator, GenericKeyring *keyring | |||
LWLockAcquire(lock_files, LW_SHARED); | |||
|
|||
/* Get/generate a master, create the key for relation and get the encrypted key with bytes to write */ |
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.
/* Get/generate a master, create the key for relation and get the encrypted key with bytes to write */ | |
/* Get/generate a principal key, create the key for relation and get the encrypted key with bytes to write */ |
src/catalog/tde_principal_key.c
Outdated
* If ensure_new_key is true, then we will keep on incrementing the version number | ||
* till we get a key name that is not present in the keyring | ||
*/ | ||
keyInfo * | ||
load_latest_versioned_key_name(TDEMasterKeyInfo *mastere_key_info, GenericKeyring *keyring, bool ensure_new_key) | ||
load_latest_versioned_key_name(TDEPrincipalKeyInfo *mastere_key_info, GenericKeyring *keyring, bool ensure_new_key) |
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.
mastere_key_info
here and all over the func body + in the function prototype, in src/include/catalog/tde_principal_key.h
Hello Team, When I try to install and configure TDE I am getting create_principal_key don't exists. |
This commit contains lots of changes, but it's just a repeated
execution of find <...> -exec sed <...>, so everything should
work as before.
Note: PR also contains changes from the SMGR branch merge, as it is based on that, please only check the latest commit: 9c08d95