summaryrefslogtreecommitdiff
path: root/tools/nettle-pbkdf2.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2016-09-03 20:10:28 +0200
committerNiels Möller <nisse@lysator.liu.se>2016-09-03 20:10:28 +0200
commit34b3a642e9e3e884a9fcd7d6dca760b728994baa (patch)
treeda5f3aa16ebc3f8a42518201cfc0fb25170acbb3 /tools/nettle-pbkdf2.c
parent76da9500024a9abf716f96ce23ec0b0afdeead2c (diff)
downloadnettle-34b3a642e9e3e884a9fcd7d6dca760b728994baa.tar.gz
Fix some warnigns for nettle-hash and nettle-pbkdf.
Diffstat (limited to 'tools/nettle-pbkdf2.c')
-rw-r--r--tools/nettle-pbkdf2.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/nettle-pbkdf2.c b/tools/nettle-pbkdf2.c
index 16040c38..e2e8c782 100644
--- a/tools/nettle-pbkdf2.c
+++ b/tools/nettle-pbkdf2.c
@@ -71,9 +71,9 @@ main (int argc, char **argv)
unsigned output_length = DEFAULT_LENGTH;
char password[MAX_PASSWORD];
size_t password_length;
- char *output;
+ uint8_t *output;
size_t salt_length;
- char *salt;
+ uint8_t *salt;
int raw = 0;
int hex_salt = 0;
int c;
@@ -141,8 +141,8 @@ main (int argc, char **argv)
return EXIT_FAILURE;
}
- salt = strdup (argv[0]);
- salt_length = strlen(salt);
+ salt = (uint8_t *) strdup (argv[0]);
+ salt_length = strlen(argv[0]);
if (hex_salt)
{
@@ -150,8 +150,8 @@ main (int argc, char **argv)
base16_decode_init (&base16);
if (!base16_decode_update (&base16,
- &salt_length,
- salt, salt_length, salt)
+ &salt_length, salt,
+ salt_length, salt)
|| !base16_decode_final (&base16))
die ("Invalid salt (expecting hex encoding).\n");
}
@@ -164,7 +164,8 @@ main (int argc, char **argv)
die ("Reading password input failed: %s.\n", strerror (errno));
output = xalloc (output_length);
- pbkdf2_hmac_sha256 (password_length, password, iterations, salt_length, salt,
+ pbkdf2_hmac_sha256 (password_length, (const uint8_t *) password,
+ iterations, salt_length, salt,
output_length, output);
free (salt);