mirror of
https://github.com/libssh2/libssh2.git
synced 2025-12-08 03:42:13 +03:00
bcrypt_pbkdf.c: fix clang10 false positive warning (#563)
File: bcrypt_pbkdf.c
Notes:
blf_enc() takes a number of 64-bit blocks to encrypt, but using
sizeof(uint64_t) in the calculation triggers a warning with
clang 10 because the actual data type is uint32_t. Pass
BCRYPT_BLOCKS / 2 for the number of blocks like libc bcrypt(3)
does.
Ref: 04a2240bd8
Fixes #562
Credit:
Viktor Szakats
This commit is contained in:
@@ -81,7 +81,7 @@ bcrypt_hash(uint8_t *sha2pass, uint8_t *sha2salt, uint8_t *out)
|
||||
cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext),
|
||||
&j);
|
||||
for(i = 0; i < 64; i++)
|
||||
blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t));
|
||||
blf_enc(&state, cdata, BCRYPT_BLOCKS / 2);
|
||||
|
||||
/* copy out */
|
||||
for(i = 0; i < BCRYPT_BLOCKS; i++) {
|
||||
|
||||
Reference in New Issue
Block a user