summaryrefslogtreecommitdiff
path: root/crypt/sha512-crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypt/sha512-crypt.c')
-rw-r--r--crypt/sha512-crypt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/crypt/sha512-crypt.c b/crypt/sha512-crypt.c
index c42e5b785d..bd099cd0e0 100644
--- a/crypt/sha512-crypt.c
+++ b/crypt/sha512-crypt.c
@@ -1,5 +1,5 @@
/* One way encryption based on SHA512 sum.
- Copyright (C) 2007-2016 Free Software Foundation, Inc.
+ Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2007.
@@ -318,8 +318,8 @@ __sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
if (rounds_custom)
{
- int n = snprintf (cp, MAX (0, buflen), "%s%zu$",
- sha512_rounds_prefix, rounds);
+ int n = __snprintf (cp, MAX (0, buflen), "%s%zu$",
+ sha512_rounds_prefix, rounds);
cp += n;
buflen -= n;
}
@@ -393,16 +393,16 @@ __sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
#ifndef USE_NSS
__sha512_init_ctx (&ctx);
__sha512_finish_ctx (&ctx, alt_result);
- memset (&ctx, '\0', sizeof (ctx));
- memset (&alt_ctx, '\0', sizeof (alt_ctx));
+ explicit_bzero (&ctx, sizeof (ctx));
+ explicit_bzero (&alt_ctx, sizeof (alt_ctx));
#endif
- 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);
if (copied_key != NULL)
- memset (copied_key, '\0', key_len);
+ explicit_bzero (copied_key, key_len);
if (copied_salt != NULL)
- memset (copied_salt, '\0', salt_len);
+ explicit_bzero (copied_salt, salt_len);
free (free_key);
free (free_pbytes);