diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:34:38 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:34:38 +0000 |
commit | 7576c27563a3e43c0a276bf222244bcaf220a6fa (patch) | |
tree | ad96fd1f1b9b57a50005db7803f6b79e748bb820 /crypt/sha512-crypt.c | |
parent | ab5f5211585bf0f33bbfa2d4aaf17e4f0d1fa564 (diff) | |
parent | 064374be911f72dfaec8a75f06da1f9fc1827712 (diff) |
Merge branch 't/hurdsig-global-dispositions' into refs/top-bases/t/hurdsig-SA_SIGINFO
Diffstat (limited to 'crypt/sha512-crypt.c')
-rw-r--r-- | crypt/sha512-crypt.c | 20 |
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); |