mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Get rid of unused variables.
copied_key and copied_salt are assigned with NULL and never used otherwise. Remove the two variables and related code. Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16314
This commit is contained in:
parent
66bdf50fac
commit
a7e92a77da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336540
|
@ -68,13 +68,10 @@ crypt_sha256(const char *key, const char *salt, char *buffer)
|
||||||
uint8_t alt_result[32], temp_result[32];
|
uint8_t alt_result[32], temp_result[32];
|
||||||
SHA256_CTX ctx, alt_ctx;
|
SHA256_CTX ctx, alt_ctx;
|
||||||
size_t salt_len, key_len, cnt, rounds;
|
size_t salt_len, key_len, cnt, rounds;
|
||||||
char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
|
char *cp, *p_bytes, *s_bytes, *endp;
|
||||||
const char *num;
|
const char *num;
|
||||||
bool rounds_custom;
|
bool rounds_custom;
|
||||||
|
|
||||||
copied_key = NULL;
|
|
||||||
copied_salt = NULL;
|
|
||||||
|
|
||||||
/* Default number of rounds. */
|
/* Default number of rounds. */
|
||||||
rounds = ROUNDS_DEFAULT;
|
rounds = ROUNDS_DEFAULT;
|
||||||
rounds_custom = false;
|
rounds_custom = false;
|
||||||
|
@ -244,10 +241,6 @@ crypt_sha256(const char *key, const char *salt, char *buffer)
|
||||||
memset(s_bytes, '\0', salt_len);
|
memset(s_bytes, '\0', salt_len);
|
||||||
memset(&ctx, '\0', sizeof(ctx));
|
memset(&ctx, '\0', sizeof(ctx));
|
||||||
memset(&alt_ctx, '\0', sizeof(alt_ctx));
|
memset(&alt_ctx, '\0', sizeof(alt_ctx));
|
||||||
if (copied_key != NULL)
|
|
||||||
memset(copied_key, '\0', key_len);
|
|
||||||
if (copied_salt != NULL)
|
|
||||||
memset(copied_salt, '\0', salt_len);
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,13 +68,10 @@ crypt_sha512(const char *key, const char *salt, char *buffer)
|
||||||
uint8_t alt_result[64], temp_result[64];
|
uint8_t alt_result[64], temp_result[64];
|
||||||
SHA512_CTX ctx, alt_ctx;
|
SHA512_CTX ctx, alt_ctx;
|
||||||
size_t salt_len, key_len, cnt, rounds;
|
size_t salt_len, key_len, cnt, rounds;
|
||||||
char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
|
char *cp, *p_bytes, *s_bytes, *endp;
|
||||||
const char *num;
|
const char *num;
|
||||||
bool rounds_custom;
|
bool rounds_custom;
|
||||||
|
|
||||||
copied_key = NULL;
|
|
||||||
copied_salt = NULL;
|
|
||||||
|
|
||||||
/* Default number of rounds. */
|
/* Default number of rounds. */
|
||||||
rounds = ROUNDS_DEFAULT;
|
rounds = ROUNDS_DEFAULT;
|
||||||
rounds_custom = false;
|
rounds_custom = false;
|
||||||
|
@ -256,10 +253,6 @@ crypt_sha512(const char *key, const char *salt, char *buffer)
|
||||||
memset(s_bytes, '\0', salt_len);
|
memset(s_bytes, '\0', salt_len);
|
||||||
memset(&ctx, '\0', sizeof(ctx));
|
memset(&ctx, '\0', sizeof(ctx));
|
||||||
memset(&alt_ctx, '\0', sizeof(alt_ctx));
|
memset(&alt_ctx, '\0', sizeof(alt_ctx));
|
||||||
if (copied_key != NULL)
|
|
||||||
memset(copied_key, '\0', key_len);
|
|
||||||
if (copied_salt != NULL)
|
|
||||||
memset(copied_salt, '\0', salt_len);
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue