Skip to content

Commit

Permalink
secure erase the key_desc in case it's a pkcs11 uri with pin
Browse files Browse the repository at this point in the history
  • Loading branch information
embetrix committed Dec 19, 2024
1 parent 3c90bf8 commit bd0367f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stm32mp-sign-tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,5 +564,10 @@ int main(int argc, char* argv[]) {
std::memset(static_cast<void*>(const_cast<char*>(passphrase)), 0, std::strlen(passphrase));
}

// Securely erase the key_desc in case it's a pkcs11 uri with pin
if (key_desc) {
std::memset(static_cast<void*>(const_cast<char*>(key_desc)), 0, std::strlen(key_desc));
}

return 0;
}

0 comments on commit bd0367f

Please sign in to comment.