Unverified Commit 788f07de authored by kladko's avatar kladko

SKALE-3228

parent db1f7bd9
...@@ -146,6 +146,8 @@ void gen_SEK() { ...@@ -146,6 +146,8 @@ void gen_SEK() {
carray2Hex(encrypted_SEK.data(), enc_len, hexEncrKey.data(), 2 * enc_len + 1); carray2Hex(encrypted_SEK.data(), enc_len, hexEncrKey.data(), 2 * enc_len + 1);
spdlog::info(string("Encrypted storage encryption key:") + hexEncrKey.data());
ofstream sek_file(BACKUP_PATH); ofstream sek_file(BACKUP_PATH);
sek_file.clear(); sek_file.clear();
...@@ -173,6 +175,13 @@ void gen_SEK() { ...@@ -173,6 +175,13 @@ void gen_SEK() {
create_test_key(); create_test_key();
validate_SEK(); validate_SEK();
shared_ptr <string> encrypted_SEK_ptr = LevelDB::getLevelDb()->readString("SEK");
setSEK(encrypted_SEK_ptr);
validate_SEK();
} }
void setSEK(shared_ptr <string> hex_encrypted_SEK) { void setSEK(shared_ptr <string> hex_encrypted_SEK) {
...@@ -195,8 +204,10 @@ void setSEK(shared_ptr <string> hex_encrypted_SEK) { ...@@ -195,8 +204,10 @@ void setSEK(shared_ptr <string> hex_encrypted_SEK) {
HANDLE_TRUSTED_FUNCTION_ERROR(status, err_status, errMsg.data()); HANDLE_TRUSTED_FUNCTION_ERROR(status, err_status, errMsg.data());
validate_SEK(); validate_SEK();
} }
#include "experimental/filesystem" #include "experimental/filesystem"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment