|
|
|
@ -42,12 +42,12 @@ PGTDE::psql($node, 'postgres', |
|
|
|
|
|
|
|
|
|
PGTDE::psql($node, 'postgres', 'INSERT INTO test_enc (k) VALUES (5), (6);'); |
|
|
|
|
|
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
# Rotate key |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT pg_tde_set_key_using_database_key_provider('rotated-key1');"); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
PGTDE::append_to_result_file("-- server restart"); |
|
|
|
|
$node->restart; |
|
|
|
@ -58,13 +58,13 @@ PGTDE::psql($node, 'postgres', |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT key_provider_id, key_provider_name, key_name FROM pg_tde_server_key_info();" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
# Again rotate key |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT pg_tde_set_key_using_database_key_provider('rotated-key2', 'file-2');" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
PGTDE::append_to_result_file("-- server restart"); |
|
|
|
|
$node->restart; |
|
|
|
@ -75,13 +75,13 @@ PGTDE::psql($node, 'postgres', |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT key_provider_id, key_provider_name, key_name FROM pg_tde_server_key_info();" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
# Again rotate key |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT pg_tde_set_key_using_global_key_provider('rotated-key', 'file-3', false);" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
PGTDE::append_to_result_file("-- server restart"); |
|
|
|
|
$node->restart; |
|
|
|
@ -92,7 +92,7 @@ PGTDE::psql($node, 'postgres', |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT key_provider_id, key_provider_name, key_name FROM pg_tde_server_key_info();" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
# TODO: add method to query current info |
|
|
|
|
# And maybe debug tools to show what's in a file keyring? |
|
|
|
@ -101,7 +101,7 @@ PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT pg_tde_set_key_using_global_key_provider('rotated-keyX', 'file-2', false);" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
PGTDE::append_to_result_file("-- server restart"); |
|
|
|
|
$node->restart; |
|
|
|
@ -112,10 +112,10 @@ PGTDE::psql($node, 'postgres', |
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
"SELECT key_provider_id, key_provider_name, key_name FROM pg_tde_server_key_info();" |
|
|
|
|
); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id ASC;'); |
|
|
|
|
PGTDE::psql($node, 'postgres', 'SELECT * FROM test_enc ORDER BY id;'); |
|
|
|
|
|
|
|
|
|
PGTDE::psql($node, 'postgres', |
|
|
|
|
'ALTER SYSTEM SET pg_tde.inherit_global_providers = OFF;'); |
|
|
|
|
'ALTER SYSTEM SET pg_tde.inherit_global_providers = off;'); |
|
|
|
|
|
|
|
|
|
# Things still work after a restart |
|
|
|
|
PGTDE::append_to_result_file("-- server restart"); |
|
|
|
|