From 94b5fd4fb9370f3f5e0094f5fbe98c7edbe34295 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 20 Jul 2018 07:16:28 +0000 Subject: [PATCH] libcrypt: There is no need to clear message digest context after they are finialized after r336539, so do not do it. Submitted by: David CARLIER MFC after: 1 month (after r336539) Differential Revision: https://reviews.freebsd.org/D16059 --- lib/libcrypt/crypt-sha256.c | 2 -- lib/libcrypt/crypt-sha512.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/libcrypt/crypt-sha256.c b/lib/libcrypt/crypt-sha256.c index d5b586789692..56a6fab58ae4 100644 --- a/lib/libcrypt/crypt-sha256.c +++ b/lib/libcrypt/crypt-sha256.c @@ -239,8 +239,6 @@ crypt_sha256(const char *key, const char *salt, char *buffer) 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 (0); } diff --git a/lib/libcrypt/crypt-sha512.c b/lib/libcrypt/crypt-sha512.c index e692ac5b2e4c..8b23c6b224e7 100644 --- a/lib/libcrypt/crypt-sha512.c +++ b/lib/libcrypt/crypt-sha512.c @@ -251,8 +251,6 @@ crypt_sha512(const char *key, const char *salt, char *buffer) 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 (0); }