aboutsummaryrefslogtreecommitdiff
path: root/lib/libcrypt/crypt-md5.c
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2024-10-10 09:08:35 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2024-10-29 15:45:31 +0000
commit1af027e583ec725ae772a4cc0b128652553fa7ec (patch)
tree1eb581df5c55c8980289b494de62b9f9314a16ae /lib/libcrypt/crypt-md5.c
parent1d271ba05fceb1ef6246e8079bc19e3b6416a833 (diff)
Diffstat (limited to 'lib/libcrypt/crypt-md5.c')
-rw-r--r--lib/libcrypt/crypt-md5.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcrypt/crypt-md5.c b/lib/libcrypt/crypt-md5.c
index 3fb80c1ba540..5313f59a4098 100644
--- a/lib/libcrypt/crypt-md5.c
+++ b/lib/libcrypt/crypt-md5.c
@@ -33,6 +33,7 @@
#include <md5.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "crypt.h"
@@ -85,7 +86,7 @@ crypt_md5(const char *pw, const char *salt, char *buffer)
(u_int)(pl > MD5_SIZE ? MD5_SIZE : pl));
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ explicit_bzero(final, sizeof(final));
/* Then something really weird... */
for (i = strlen(pw); i; i >>= 1)
@@ -141,7 +142,7 @@ crypt_md5(const char *pw, const char *salt, char *buffer)
*buffer = '\0';
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ explicit_bzero(final, sizeof(final));
return (0);
}