Skip to content

Commit

Permalink
Load encryption key from file system before generating it (#1082) (#1086
Browse files Browse the repository at this point in the history
)
  • Loading branch information
myagley authored Apr 12, 2019
1 parent 22816bb commit 9174a89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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 @@ -2676,6 +2676,12 @@ static int edge_hsm_client_store_insert_encryption_key
LOG_DEBUG("HSM store already has encryption key set %s", key_name);
result = 0;
}
else if ((load_encryption_key_from_file(g_crypto_store, key_name) == 0) &&
key_exists((CRYPTO_STORE*)handle, HSM_KEY_ENCRYPTION, key_name))
{
LOG_DEBUG("HSM store already has encryption key set %s", key_name);
result = 0;
}
else
{
size_t key_size = 0;
Expand Down

0 comments on commit 9174a89

Please sign in to comment.