summaryrefslogtreecommitdiff
path: root/lib/libcrypt
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2013-06-24 04:21:19 +0000
committerriastradh <riastradh@NetBSD.org>2013-06-24 04:21:19 +0000
commitadfdcceb8aad478bc3c5692fb3aff045c0c8ef37 (patch)
treeee62fd1d002750ee339715e953885019cf401475 /lib/libcrypt
parent8fcb059d64019ef3a03b90cb11f6c6d47aeeb6b9 (diff)
Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.
consttime_memequal is the same as the old consttime_bcmp. explicit_memset is to memset as explicit_bzero was to bcmp. Passes amd64 release and i386/ALL, but I'm sure I missed some spots, so please let me know.
Diffstat (limited to 'lib/libcrypt')
-rw-r--r--lib/libcrypt/bcrypt.c6
-rw-r--r--lib/libcrypt/crypt-sha1.c6
-rw-r--r--lib/libcrypt/md5crypt.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/libcrypt/bcrypt.c b/lib/libcrypt/bcrypt.c
index 106b1edb61d..82a8df363bc 100644
--- a/lib/libcrypt/bcrypt.c
+++ b/lib/libcrypt/bcrypt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bcrypt.c,v 1.17 2012/08/30 12:16:49 drochner Exp $ */
+/* $NetBSD: bcrypt.c,v 1.18 2013/06/24 04:21:20 riastradh Exp $ */
/* $OpenBSD: bcrypt.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */
/*
@@ -46,7 +46,7 @@
*
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: bcrypt.c,v 1.17 2012/08/30 12:16:49 drochner Exp $");
+__RCSID("$NetBSD: bcrypt.c,v 1.18 2013/06/24 04:21:20 riastradh Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -314,7 +314,7 @@ __bcrypt(const char *key, const char *salt)
encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT);
encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext,
4 * BCRYPT_BLOCKS - 1);
- __explicit_bzero(&state, sizeof(state));
+ __explicit_memset(&state, 0, sizeof(state));
return encrypted;
}
diff --git a/lib/libcrypt/crypt-sha1.c b/lib/libcrypt/crypt-sha1.c
index 4b6c095e674..5c3c4934f6c 100644
--- a/lib/libcrypt/crypt-sha1.c
+++ b/lib/libcrypt/crypt-sha1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: crypt-sha1.c,v 1.5 2012/08/30 12:16:49 drochner Exp $ */
+/* $NetBSD: crypt-sha1.c,v 1.6 2013/06/24 04:21:20 riastradh Exp $ */
/*
* Copyright (c) 2004, Juniper Networks, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: crypt-sha1.c,v 1.5 2012/08/30 12:16:49 drochner Exp $");
+__RCSID("$NetBSD: crypt-sha1.c,v 1.6 2013/06/24 04:21:20 riastradh Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -190,7 +190,7 @@ __crypt_sha1 (const char *pw, const char *salt)
*ep = '\0';
/* Don't leave anything around in vm they could use. */
- __explicit_bzero(hmac_buf, sizeof hmac_buf);
+ __explicit_memset(hmac_buf, 0, sizeof hmac_buf);
return passwd;
}
diff --git a/lib/libcrypt/md5crypt.c b/lib/libcrypt/md5crypt.c
index 74f9352ac8e..38ec76726c5 100644
--- a/lib/libcrypt/md5crypt.c
+++ b/lib/libcrypt/md5crypt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: md5crypt.c,v 1.12 2012/08/30 12:16:49 drochner Exp $ */
+/* $NetBSD: md5crypt.c,v 1.13 2013/06/24 04:21:20 riastradh Exp $ */
/*
* ----------------------------------------------------------------------------
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: md5crypt.c,v 1.12 2012/08/30 12:16:49 drochner Exp $");
+__RCSID("$NetBSD: md5crypt.c,v 1.13 2013/06/24 04:21:20 riastradh Exp $");
#endif /* not lint */
#include <unistd.h>
@@ -143,6 +143,6 @@ __md5crypt(const char *pw, const char *salt)
*p = '\0';
/* Don't leave anything around in vm they could use. */
- __explicit_bzero(final, sizeof(final));
+ __explicit_memset(final, 0, sizeof(final));
return (passwd);
}