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

[crypto] Post-merge review: add sensitive data buffer doc #24585

Merged
merged 1 commit into from
Jan 23, 2023
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
12 changes: 12 additions & 0 deletions src/crypto/CHIPCryptoPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ class ECPKey
const Sig & signature) const = 0;
};

/**
* @brief Helper class for holding sensitive data that should be erased from memory after use.
*
* The sensitive data buffer is a variable-length, fixed-capacity buffer class that securely erases
* the contents of a buffer when the buffer is destroyed.
*/
template <size_t kCapacity>
class SensitiveDataBuffer
{
Expand Down Expand Up @@ -291,6 +297,12 @@ class SensitiveDataBuffer
size_t mLength = 0;
};

/**
* @brief Helper class for holding fixed-sized sensitive data that should be erased from memory after use.
*
* The sensitive data buffer is a fixed-length, fixed-capacity buffer class that securely erases
* the contents of a buffer when the buffer is destroyed.
*/
template <size_t kCapacity>
class SensitiveDataFixedBuffer
{
Expand Down