Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101993677
D47037.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47037.id.diff
View Options
diff --git a/lib/libcrypt/crypt-md5.c b/lib/libcrypt/crypt-md5.c
--- a/lib/libcrypt/crypt-md5.c
+++ b/lib/libcrypt/crypt-md5.c
@@ -32,6 +32,7 @@
#include <md5.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "crypt.h"
@@ -84,7 +85,7 @@
(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)
@@ -140,7 +141,7 @@
*buffer = '\0';
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ explicit_bzero(final, sizeof(final));
return (0);
}
diff --git a/lib/libcrypt/crypt-sha256.c b/lib/libcrypt/crypt-sha256.c
--- a/lib/libcrypt/crypt-sha256.c
+++ b/lib/libcrypt/crypt-sha256.c
@@ -41,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "crypt.h"
@@ -234,9 +235,9 @@
* the SHA256 implementation as well. */
SHA256_Init(&ctx);
SHA256_Final(alt_result, &ctx);
- memset(temp_result, '\0', sizeof(temp_result));
- memset(p_bytes, '\0', key_len);
- memset(s_bytes, '\0', salt_len);
+ explicit_bzero(temp_result, sizeof(temp_result));
+ explicit_bzero(p_bytes, key_len);
+ explicit_bzero(s_bytes, salt_len);
return (0);
}
diff --git a/lib/libcrypt/crypt-sha512.c b/lib/libcrypt/crypt-sha512.c
--- a/lib/libcrypt/crypt-sha512.c
+++ b/lib/libcrypt/crypt-sha512.c
@@ -41,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "crypt.h"
@@ -246,9 +247,9 @@
* the SHA512 implementation as well. */
SHA512_Init(&ctx);
SHA512_Final(alt_result, &ctx);
- memset(temp_result, '\0', sizeof(temp_result));
- memset(p_bytes, '\0', key_len);
- memset(s_bytes, '\0', salt_len);
+ explicit_bzero(temp_result, sizeof(temp_result));
+ explicit_bzero(p_bytes, key_len);
+ explicit_bzero(s_bytes, salt_len);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 7:38 AM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14506959
Default Alt Text
D47037.id.diff (1 KB)
Attached To
Mode
D47037: lib/libcrypt: use explicit_bzero() to clear sensitive buffers
Attached
Detach File
Event Timeline
Log In to Comment