lib/crypto: Add a sentence about zeroizing raw key structures
Subsystems (3)
PATCH 1/1 lib/crypto: Add a sentence about zeroizing raw key structures
Let's make it clear that raw key material has to be zeroized, too.
Suggested-by Eric Biggers <[email protected]>
Signed-off-by Thomas Huth <[email protected]>
---
Suggested here:
https://lore.kernel.org/linux-crypto/[email protected]/
Documentation/crypto/libcrypto-zeroization.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/crypto/libcrypto-zeroization.rst +3 -1
@@ -47,7 +47,9 @@ The following types of structures hold sensitive material and should be zeroized after use: - **Key structures** (e.g. ``struct aes_key``, ``struct hmac_sha256_key``): - contain expanded round keys or prepared key material. + contain expanded round keys or prepared key material. Note: Arrays and + structures that contain raw key material (e.g. raw AES keys) of course + need to be zeroized as well as soon as the data is not required anymore. - **HMAC/MAC context structures** (e.g. ``struct hmac_sha256_ctx``, ``struct aes_cmac_ctx``): contain inner and outer hash states derived from
Signature · 1 line
2.56.0
Eric Biggers
maintainerQuoted 16 lines · Thomas Huth
Let's make it clear that raw key material has to be zeroized, too.
Suggested-by Eric Biggers <[email protected]>Signed-off-by Thomas Huth <[email protected]>---
Suggested here:
https://lore.kernel.org/linux-crypto/[email protected]/Documentation/crypto/libcrypto-zeroization.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/crypto/libcrypto-zeroization.rst +0
-0
Documentation/crypto/libcrypto-zeroization.rst The following types of structures hold sensitive material and should be · line 52
Quoted 7 lines
Documentation/crypto/libcrypto-zeroization.rst +3
-1@@ -47,7 +47,9 @@ The following types of structures hold sensitive material and should be zeroized after use: - **Key structures** (e.g. ``struct aes_key``, ``struct hmac_sha256_key``): - contain expanded round keys or prepared key material. + contain expanded round keys or prepared key material. Note: Arrays and + structures that contain raw key material (e.g. raw AES keys) of course + need to be zeroized as well as soon as the data is not required anymore.
It's better than nothing, but it reads kind of like an afterthought. Might be worth its own paragraph before the one beginning with "The following types of structures".
- Eric