Unverified Commit a6bd1e04 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #348 from skalenetwork/bug/SKALE-4522-cleanup-decrypted-key

SKALE-4522 cleanup decrypted key on error
parents dbf61f5f bdb15e6d
...@@ -616,6 +616,9 @@ void trustedDecryptKey(int *errStatus, char *errString, uint8_t *encryptedPrivat ...@@ -616,6 +616,9 @@ void trustedDecryptKey(int *errStatus, char *errString, uint8_t *encryptedPrivat
&type, &exportable); &type, &exportable);
if (exportable != EXPORTABLE) { if (exportable != EXPORTABLE) {
while (*key != '\0') {
*key++ = '0';
}
*errStatus = -11; *errStatus = -11;
snprintf(errString, BUF_LEN, "Key is not exportable"); snprintf(errString, BUF_LEN, "Key is not exportable");
LOG_ERROR(errString); LOG_ERROR(errString);
......
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