Skip to content

Commit

Permalink
Load master encryption key when opening HSM store
Browse files Browse the repository at this point in the history
  • Loading branch information
avranju committed Apr 12, 2019
1 parent b3d74a9 commit 91e0bbc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions edgelet/hsm-sys/azure-iot-hsm-c/src/edge_hsm_client_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,13 @@ static HSM_CLIENT_STORE_HANDLE edge_hsm_client_store_open(const char* store_name
}
else
{
// try loading the master encryption key from the file system into memory; its
// ok if this is not successful because during first run, we expect the file
// to not have been generated yet
if (load_encryption_key_from_file(g_crypto_store, EDGELET_ENC_KEY_NAME) != 0 )
{
LOG_DEBUG("Loading encryption key from file for key %s failed. Assuming first run.", EDGELET_ENC_KEY_NAME);
}
result = (HSM_CLIENT_STORE_HANDLE)g_crypto_store;
}

Expand Down

0 comments on commit 91e0bbc

Please sign in to comment.