summaryrefslogtreecommitdiff
path: root/libexec/login_passwd
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-10-05 17:31:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-10-05 17:31:18 +0000
commitc57928ea02f1c43d3d3a4725f2e8c2fba14f77ea (patch)
tree6051d3384840364c2af13a819ddcade38a040fc0 /libexec/login_passwd
parent7f3e6c2703ec9106ba052b198e062311e333e012 (diff)
Use explicit_bzero() instead of memset() for zeroing out secrets.
OK deraadt@
Diffstat (limited to 'libexec/login_passwd')
-rw-r--r--libexec/login_passwd/login.c4
-rw-r--r--libexec/login_passwd/login_passwd.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/libexec/login_passwd/login.c b/libexec/login_passwd/login.c
index 6548178e001..8d208e03381 100644
--- a/libexec/login_passwd/login.c
+++ b/libexec/login_passwd/login.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login.c,v 1.11 2015/01/16 06:39:50 deraadt Exp $ */
+/* $OpenBSD: login.c,v 1.12 2015/10/05 17:31:17 millert Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -158,7 +158,7 @@ main(int argc, char **argv)
#endif
if (password != NULL)
- memset(password, 0, strlen(password));
+ explicit_bzero(password, strlen(password));
if (ret != AUTH_OK)
fprintf(back, BI_REJECT "\n");
diff --git a/libexec/login_passwd/login_passwd.c b/libexec/login_passwd/login_passwd.c
index f646d891043..d769bdc0735 100644
--- a/libexec/login_passwd/login_passwd.c
+++ b/libexec/login_passwd/login_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_passwd.c,v 1.10 2014/09/16 22:07:02 tedu Exp $ */
+/* $OpenBSD: login_passwd.c,v 1.11 2015/10/05 17:31:17 millert Exp $ */
/*-
* Copyright (c) 2001 Hans Insulander <hin@openbsd.org>.
@@ -54,7 +54,7 @@ pwd_login(char *username, char *password, char *wheel, int lastchance,
if (crypt_checkpass(password, goodhash) == 0)
passok = 1;
plen = strlen(password);
- memset(password, 0, plen);
+ explicit_bzero(password, plen);
if (!passok)
return (AUTH_FAILED);