Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
34b3a642
Commit
34b3a642
authored
Sep 03, 2016
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some warnigns for nettle-hash and nettle-pbkdf.
parent
76da9500
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
ChangeLog
ChangeLog
+4
-2
tools/nettle-hash.c
tools/nettle-hash.c
+1
-1
tools/nettle-pbkdf2.c
tools/nettle-pbkdf2.c
+8
-7
No files found.
ChangeLog
View file @
34b3a642
...
...
@@ -15,9 +15,10 @@
keys. Overlooked in 2016-08-16 change.
* testsuite/yarrow-test.c (test_main): Fix pointer
signednesss warning.
signednesss warning
s
.
* testsuite/sexp-format-test.c (test_main): Likewise.
* testsuite/rsa-encrypt-test.c (test_main): Likewise.
* tools/nettle-lfib-stream.c (main): Likewise.
* testsuite/testutils.c (test_armor): Change ascii argument to
const char *.
...
...
@@ -25,7 +26,8 @@
argument to test_armor.
* testsuite/base64-test.c (test_main): Likewise.
* tools/nettle-lfib-stream.c (main): Fix pointer signedness warning.
* tools/nettle-pbkdf2.c (main): Fix some pointer signedness warning.
* tools/nettle-hash.c (hash_file): Likewise.
2016-08-29 Niels Möller <nisse@lysator.liu.se>
...
...
tools/nettle-hash.c
View file @
34b3a642
...
...
@@ -79,7 +79,7 @@ hash_file(const struct nettle_hash *hash, void *ctx, FILE *f)
{
for
(;;)
{
char
buffer
[
BUFSIZE
];
uint8_t
buffer
[
BUFSIZE
];
size_t
res
=
fread
(
buffer
,
1
,
sizeof
(
buffer
),
f
);
if
(
ferror
(
f
))
return
0
;
...
...
tools/nettle-pbkdf2.c
View file @
34b3a642
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment