qemu-e2k/crypto
Akihiko Odaki 55a01cab83 crypto: Always initialize splitkeylen
When _FORTIFY_SOURCE=2, glibc version is 2.35, and GCC version is
12.1.0, the compiler complains as follows:

In file included from /usr/include/string.h:535,
                 from /home/alarm/q/var/qemu/include/qemu/osdep.h:99,
                 from ../crypto/block-luks.c:21:
In function 'memset',
    inlined from 'qcrypto_block_luks_store_key' at ../crypto/block-luks.c:843:9:
/usr/include/bits/string_fortified.h:59:10: error: 'splitkeylen' may be used uninitialized [-Werror=maybe-uninitialized]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
../crypto/block-luks.c: In function 'qcrypto_block_luks_store_key':
../crypto/block-luks.c:699:12: note: 'splitkeylen' was declared here
  699 |     size_t splitkeylen;
      |            ^~~~~~~~~~~

It seems the compiler cannot see that splitkeylen will not be used
when splitkey is NULL. Suppress the warning by initializing splitkeylen
even when splitkey stays NULL.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-07-25 17:15:59 +01:00
..
aes.c crypto: Unexport AES_*_rot, AES_TeN, AES_TdN 2023-07-09 13:48:23 +01:00
afalg.c win32: replace closesocket() with close() wrapper 2023-03-13 15:39:31 +04:00
afalgpriv.h
afsplit.c
akcipher-gcrypt.c.inc crypto: Implement RSA algorithm by gcrypt 2022-05-26 11:41:53 +01:00
akcipher-nettle.c.inc test/crypto: Add test suite for crypto akcipher 2022-05-26 11:41:54 +01:00
akcipher.c crypto: Support export akcipher to pkcs8 2022-11-02 06:56:32 -04:00
akcipherpriv.h crypto: Introduce akcipher crypto class 2022-05-26 11:41:47 +01:00
block-luks-priv.h crypto: Clean up includes 2023-02-08 07:16:23 +01:00
block-luks.c crypto: Always initialize splitkeylen 2023-07-25 17:15:59 +01:00
block-luks.h
block-qcow.c
block-qcow.h
block.c crypto: Make block callbacks return 0 on success 2022-07-12 12:14:55 +02:00
blockpriv.h
cipher-afalg.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
cipher-builtin.c.inc
cipher-gcrypt.c.inc crypto: replace 'des-rfb' cipher with 'des' 2021-07-14 14:15:52 +01:00
cipher-gnutls.c.inc crypto: add gnutls cipher provider 2021-07-14 14:15:52 +01:00
cipher-nettle.c.inc crypto: replace 'des-rfb' cipher with 'des' 2021-07-14 14:15:52 +01:00
cipher.c crypto: add gnutls cipher provider 2021-07-14 14:15:52 +01:00
cipherpriv.h
der.c crypto: Support DER encodings 2022-11-02 06:56:32 -04:00
der.h crypto: Support DER encodings 2022-11-02 06:56:32 -04:00
hash-afalg.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
hash-gcrypt.c
hash-glib.c
hash-gnutls.c crypto: add gnutls hash provider 2021-07-14 14:15:52 +01:00
hash-nettle.c
hash.c
hashpriv.h
hmac-gcrypt.c
hmac-glib.c
hmac-gnutls.c crypto: add gnutls hmac provider 2021-07-14 14:15:52 +01:00
hmac-nettle.c
hmac.c
hmacpriv.h
init.c
ivgen-essiv.c
ivgen-essiv.h
ivgen-plain64.c
ivgen-plain64.h
ivgen-plain.c
ivgen-plain.h Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
ivgen.c
ivgenpriv.h
meson.build crypto: Implement RSA algorithm by hogweed 2022-05-26 11:41:51 +01:00
pbkdf-gcrypt.c
pbkdf-gnutls.c crypto: add gnutls pbkdf provider 2021-07-14 14:15:52 +01:00
pbkdf-nettle.c
pbkdf-stub.c
pbkdf.c crypto/luks: Support creating LUKS image on Darwin 2022-10-26 13:32:08 +01:00
random-gcrypt.c
random-gnutls.c
random-none.c
random-platform.c
rsakey-builtin.c.inc crypto: Implement RSA algorithm by hogweed 2022-05-26 11:41:51 +01:00
rsakey-nettle.c.inc crypto: Implement RSA algorithm by hogweed 2022-05-26 11:41:51 +01:00
rsakey.c crypto: Support export akcipher to pkcs8 2022-11-02 06:56:32 -04:00
rsakey.h crypto: Support export akcipher to pkcs8 2022-11-02 06:56:32 -04:00
secret_common.c crypto: make loaded property read-only 2022-05-14 12:33:44 +02:00
secret_keyring.c
secret.c
sm4.c crypto: move sm4_sbox from target/arm 2022-04-29 10:47:45 +10:00
tls-cipher-suites.c
tlscreds.c
tlscredsanon.c crypto: make loaded property read-only 2022-05-14 12:33:44 +02:00
tlscredspriv.h
tlscredspsk.c crypto: check for and report errors setting PSK credentials 2022-10-27 11:55:41 +01:00
tlscredsx509.c crypto: make loaded property read-only 2022-05-14 12:33:44 +02:00
tlssession.c crypto: TLS: introduce check_pending 2023-02-15 11:01:03 -05:00
trace-events
trace.h
xts.c