PG-1892 Move InternalKey to common file

This structure seems generally useful and doesn't belong with the
relation key code.
pull/238/head
Anders Åstrand 2 weeks ago committed by AndersAstrand
parent e9e9266d03
commit ca48e7fb7a
  1. 3
      contrib/pg_tde/src/include/access/pg_tde_keys_common.h
  2. 7
      contrib/pg_tde/src/include/access/pg_tde_tdemap.h
  3. 1
      contrib/pg_tde/src/include/access/pg_tde_xlog_keys.h
  4. 9
      contrib/pg_tde/src/include/encryption/enc_tde.h

@ -3,9 +3,6 @@
#include "catalog/tde_principal_key.h"
#define INTERNAL_KEY_LEN 16
#define INTERNAL_KEY_IV_LEN 16
#define MAP_ENTRY_IV_SIZE 16
#define MAP_ENTRY_AEAD_TAG_SIZE 16

@ -4,12 +4,7 @@
#include "storage/relfilelocator.h"
#include "access/pg_tde_keys_common.h"
typedef struct InternalKey
{
uint8 key[INTERNAL_KEY_LEN];
uint8 base_iv[INTERNAL_KEY_IV_LEN];
} InternalKey;
#include "encryption/enc_tde.h"
extern void pg_tde_save_smgr_key(RelFileLocator rel, const InternalKey *key);
extern bool pg_tde_has_smgr_key(RelFileLocator rel);

@ -4,6 +4,7 @@
#include "access/xlog_internal.h"
#include "access/pg_tde_keys_common.h"
#include "access/pg_tde_tdemap.h"
typedef enum
{

@ -5,7 +5,14 @@
#ifndef ENC_TDE_H
#define ENC_TDE_H
#include "access/pg_tde_tdemap.h"
#define INTERNAL_KEY_LEN 16
#define INTERNAL_KEY_IV_LEN 16
typedef struct InternalKey
{
uint8 key[INTERNAL_KEY_LEN];
uint8 base_iv[INTERNAL_KEY_IV_LEN];
} InternalKey;
extern void pg_tde_generate_internal_key(InternalKey *int_key);
extern void pg_tde_stream_crypt(const char *iv_prefix,

Loading…
Cancel
Save