Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Various minor fixes #412

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

Merged
merged 4 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions contrib/pg_tde/src/catalog/tde_principal_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ pg_tde_verify_provider_keys_in_use(GenericKeyring *modified_provider)
static bool
pg_tde_is_same_principal_key(TDEPrincipalKey *a, TDEPrincipalKey *b)
{
return a != NULL && b != NULL && strncmp(a->keyInfo.name, b->keyInfo.name, PRINCIPAL_KEY_NAME_LEN) == 0 && a->keyInfo.keyringId == b->keyInfo.keyringId;
return a != NULL && b != NULL && strcmp(a->keyInfo.name, b->keyInfo.name) == 0 && a->keyInfo.keyringId == b->keyInfo.keyringId;
}

static void
Expand All @@ -1018,7 +1018,6 @@ pg_tde_rotate_default_key_for_database(TDEPrincipalKey *oldKey, TDEPrincipalKey
*newKey = *newKeyTemplate;
newKey->keyInfo.databaseId = oldKey->keyInfo.databaseId;

/* key rotation */
pg_tde_perform_rotate_key(oldKey, newKey, true);

clear_principal_key_cache(oldKey->keyInfo.databaseId);
Expand Down
4 changes: 1 addition & 3 deletions contrib/pg_tde/src/include/access/pg_tde_tdemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ typedef struct WALKeyCacheRec
} WALKeyCacheRec;

extern InternalKey *pg_tde_read_last_wal_key(void);

extern WALKeyCacheRec *pg_tde_get_last_wal_key(void);
extern WALKeyCacheRec *pg_tde_fetch_wal_keys(XLogRecPtr start_lsn);
extern WALKeyCacheRec *pg_tde_get_wal_cache_keys(void);
extern void pg_tde_wal_last_key_set_lsn(XLogRecPtr lsn, const char *keyfile_path);

extern void pg_tde_create_wal_key(InternalKey *rel_key_data, const RelFileLocator *newrlocator, TDEMapEntryType flags);
extern void pg_tde_create_wal_key(InternalKey *rel_key_data, const RelFileLocator *newrlocator, TDEMapEntryType entry_type);

#define PG_TDE_MAP_FILENAME "%d_keys"

Expand Down
3 changes: 1 addition & 2 deletions contrib/pg_tde/src/keyring/keyring_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

CURL *keyringCurl = NULL;

static
size_t
static size_t
write_func(void *ptr, size_t size, size_t nmemb, struct CurlString *s)
{
size_t new_len = s->len + size * nmemb;
Expand Down