Skip to content
Snippets Groups Projects
  1. Jul 25, 2023
    • Akihiko Odaki's avatar
      crypto: Always initialize splitkeylen · 55a01cab
      Akihiko Odaki authored
      
      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: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      55a01cab
  2. Jul 09, 2023
  3. Jul 08, 2023
  4. Mar 13, 2023
  5. Feb 15, 2023
  6. Feb 08, 2023
  7. Jan 19, 2023
  8. Dec 14, 2022
  9. Nov 02, 2022
  10. Oct 27, 2022
  11. Oct 26, 2022
    • Jungmin Park's avatar
      crypto/luks: Support creating LUKS image on Darwin · bf98afc7
      Jungmin Park authored
      
      When the user creates a LUKS-encrypted qcow2 image using the qemu-img
      program, the passphrase is hashed using PBKDF2 with a dynamic
      number of iterations. The number of iterations is determined by
      measuring thread cpu time usage, such that it takes approximately
      2 seconds to compute the hash.
      
      Because Darwin doesn't implement getrusage(RUSAGE_THREAD), we get an
      error message:
      > qemu-img: test.qcow2: Unable to calculate thread CPU usage on this platform
      for this command:
      > qemu-img create --object secret,id=key,data=1234 -f qcow2 -o 'encrypt.format=luks,encrypt.key-secret=key' test.qcow2 100M
      
      This patch implements qcrypto_pbkdf2_get_thread_cpu() for Darwin so that
      the above command works.
      
      Signed-off-by: default avatarJungmin Park <pjm0616@gmail.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      bf98afc7
  12. Jul 12, 2022
  13. May 26, 2022
  14. May 14, 2022
    • Paolo Bonzini's avatar
      crypto: make loaded property read-only · 0310641c
      Paolo Bonzini authored
      
      The ``loaded=on`` option in the command line or QMP ``object-add`` either had
      no effect (if ``loaded`` was the last option) or caused options to be
      effectively ignored as if they were not given.  The property is therefore
      useless and was deprecated in 6.0; make it read-only now.
      
      The patch is best reviewed with "-b".
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0310641c
  15. May 11, 2022
Loading