Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load encryption key from file system before generating it #1082

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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