diff options
author | Niels Möller <nisse@lysator.liu.se> | 2017-08-27 20:45:21 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2017-08-27 20:45:21 +0200 |
commit | f2da403135e2b2f641cf0f8219ad5b72083b7dfd (patch) | |
tree | e3df313301bd15c5009305e5b30501fb14e4758f /tools | |
parent | 0bf64256ecf10af974c1970d87ffad19cbce7b51 (diff) | |
download | nettle-f2da403135e2b2f641cf0f8219ad5b72083b7dfd.tar.gz |
Change type of base16- and base64-encoded data from uint8_t to char.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/input.c | 2 | ||||
-rw-r--r-- | tools/nettle-pbkdf2.c | 8 | ||||
-rw-r--r-- | tools/output.c | 6 | ||||
-rw-r--r-- | tools/pkcs1-conv.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/tools/input.c b/tools/input.c index 18a9dff5..90e41a29 100644 --- a/tools/input.c +++ b/tools/input.c @@ -90,7 +90,7 @@ sexp_get_char(struct sexp_input *input) * character at a time. */ if (!input->coding->decode_update(&input->state, &done, &input->c, - 1, &input->c)) + 1, (const char*) &input->c)) die("Invalid coded data.\n"); if (done) diff --git a/tools/nettle-pbkdf2.c b/tools/nettle-pbkdf2.c index c9e4d11c..1f0a3015 100644 --- a/tools/nettle-pbkdf2.c +++ b/tools/nettle-pbkdf2.c @@ -73,7 +73,7 @@ main (int argc, char **argv) size_t password_length; uint8_t *output; size_t salt_length; - uint8_t *salt; + char *salt; int raw = 0; int hex_salt = 0; int c; @@ -141,7 +141,7 @@ main (int argc, char **argv) return EXIT_FAILURE; } - salt = (uint8_t *) strdup (argv[0]); + salt = strdup (argv[0]); salt_length = strlen(argv[0]); if (hex_salt) @@ -150,7 +150,7 @@ main (int argc, char **argv) base16_decode_init (&base16); if (!base16_decode_update (&base16, - &salt_length, salt, + &salt_length, (uint8_t *) salt, salt_length, salt) || !base16_decode_final (&base16)) die ("Invalid salt (expecting hex encoding).\n"); @@ -165,7 +165,7 @@ main (int argc, char **argv) output = xalloc (output_length); pbkdf2_hmac_sha256 (password_length, (const uint8_t *) password, - iterations, salt_length, salt, + iterations, salt_length, (const uint8_t*) salt, output_length, output); free (salt); diff --git a/tools/output.c b/tools/output.c index 02e43d58..80a44a97 100644 --- a/tools/output.c +++ b/tools/output.c @@ -114,7 +114,7 @@ sexp_put_char(struct sexp_output *output, uint8_t c) if (output->coding) { /* Two is enough for both base16 and base64. */ - uint8_t encoded[2]; + char encoded[2]; unsigned done; unsigned i; @@ -183,7 +183,7 @@ void sexp_put_code_end(struct sexp_output *output) { /* Enough for both hex and base64 */ - uint8_t encoded[BASE64_ENCODE_FINAL_LENGTH]; + char encoded[BASE64_ENCODE_FINAL_LENGTH]; unsigned done; assert(output->coding); @@ -194,7 +194,7 @@ sexp_put_code_end(struct sexp_output *output) output->coding = NULL; - sexp_put_data(output, done, encoded); + sexp_put_data(output, done, (const uint8_t*) encoded); } void diff --git a/tools/pkcs1-conv.c b/tools/pkcs1-conv.c index 9e346858..c8697c44 100644 --- a/tools/pkcs1-conv.c +++ b/tools/pkcs1-conv.c @@ -255,7 +255,7 @@ decode_base64(struct nettle_buffer *buffer, /* Decode in place */ if (base64_decode_update(&ctx, length, buffer->contents + start, - *length, buffer->contents + start) + *length, (const char *) buffer->contents + start) && base64_decode_final(&ctx)) return 1; |