From 0329ccd2ec3b0d7472492a40b173299bc259082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Mon, 23 Jan 2023 19:18:38 +0100 Subject: [PATCH] [crypto] Post-merge review: add sensitive data buffer doc (#24585) Add documentation to SensitiveData[Fixed]Buffer clases. Signed-off-by: Damian Krolik Signed-off-by: Damian Krolik --- src/crypto/CHIPCryptoPAL.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 4b77523a3e0b2a..7a5cb1f191d706 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -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 class SensitiveDataBuffer { @@ -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 class SensitiveDataFixedBuffer {