mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Fix scan-build warnings in gcrypt backend
This commit is contained in:
@@ -51,7 +51,6 @@ static void crypt_hash_test_whirlpool_bug(void)
|
|||||||
{
|
{
|
||||||
struct crypt_hash *h;
|
struct crypt_hash *h;
|
||||||
char buf[2] = "\0\0", hash_out1[64], hash_out2[64];
|
char buf[2] = "\0\0", hash_out1[64], hash_out2[64];
|
||||||
int r;
|
|
||||||
|
|
||||||
if (crypto_backend_whirlpool_bug >= 0)
|
if (crypto_backend_whirlpool_bug >= 0)
|
||||||
return;
|
return;
|
||||||
@@ -61,16 +60,16 @@ static void crypt_hash_test_whirlpool_bug(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* One shot */
|
/* One shot */
|
||||||
if ((r = crypt_hash_write(h, &buf[0], 2)) ||
|
if (crypt_hash_write(h, &buf[0], 2) ||
|
||||||
(r = crypt_hash_final(h, hash_out1, 64))) {
|
crypt_hash_final(h, hash_out1, 64)) {
|
||||||
crypt_hash_destroy(h);
|
crypt_hash_destroy(h);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Split buf (crypt_hash_final resets hash state) */
|
/* Split buf (crypt_hash_final resets hash state) */
|
||||||
if ((r = crypt_hash_write(h, &buf[0], 1)) ||
|
if (crypt_hash_write(h, &buf[0], 1) ||
|
||||||
(r = crypt_hash_write(h, &buf[1], 1)) ||
|
crypt_hash_write(h, &buf[1], 1) ||
|
||||||
(r = crypt_hash_final(h, hash_out2, 64))) {
|
crypt_hash_final(h, hash_out2, 64)) {
|
||||||
crypt_hash_destroy(h);
|
crypt_hash_destroy(h);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user