[PATCH 15/15] libcrypt: There is no need to clear message digest

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Sep 8 13:27:32 UTC 2022


From: Xin LI <delphij at FreeBSD.org>

context after they are finialized after r336539, so do not do it.

Submitted by:	David CARLIER <devnexen gmail com>
MFC after:	1 month (after r336539)
Differential Revision:	https://reviews.freebsd.org/D16059
---
 cpukit/libcrypt/crypt-sha256.c | 2 --
 cpukit/libcrypt/crypt-sha512.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/cpukit/libcrypt/crypt-sha256.c b/cpukit/libcrypt/crypt-sha256.c
index f6d510219e..24373680f7 100644
--- a/cpukit/libcrypt/crypt-sha256.c
+++ b/cpukit/libcrypt/crypt-sha256.c
@@ -257,8 +257,6 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data)
 	memset(temp_result, '\0', sizeof(temp_result));
 	memset(p_bytes, '\0', key_len);
 	memset(s_bytes, '\0', salt_len);
-	memset(&ctx, '\0', sizeof(ctx));
-	memset(&alt_ctx, '\0', sizeof(alt_ctx));
 
 	return buffer;
 }
diff --git a/cpukit/libcrypt/crypt-sha512.c b/cpukit/libcrypt/crypt-sha512.c
index 6d680348a6..da8acd7790 100644
--- a/cpukit/libcrypt/crypt-sha512.c
+++ b/cpukit/libcrypt/crypt-sha512.c
@@ -269,8 +269,6 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data)
 	memset(temp_result, '\0', sizeof(temp_result));
 	memset(p_bytes, '\0', key_len);
 	memset(s_bytes, '\0', salt_len);
-	memset(&ctx, '\0', sizeof(ctx));
-	memset(&alt_ctx, '\0', sizeof(alt_ctx));
 
 	return buffer;
 }
-- 
2.35.3



More information about the devel mailing list