a7e42752 | 30-Oct-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: perform runtime check for hash/hmac support in gcrypt
gcrypto has the ability to dynamically disable hash/hmac algorithms at runtime, so QEMU must perform a runtime check.
Reviewed-by: Phil
crypto: perform runtime check for hash/hmac support in gcrypt
gcrypto has the ability to dynamically disable hash/hmac algorithms at runtime, so QEMU must perform a runtime check.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
bbd40a0e | 30-Oct-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: fix error check on gcry_md_open
Gcrypt does not return negative values on error, it returns non-zero values. This caused QEMU not to detect failure to open an unsupported hash, resulting in
crypto: fix error check on gcry_md_open
Gcrypt does not return negative values on error, it returns non-zero values. This caused QEMU not to detect failure to open an unsupported hash, resulting in a later crash trying to use a NULL context.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
dde538c9 | 15-Oct-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto/hash: avoid overwriting user supplied result pointer
If the user provides a pre-allocated buffer for the hash result, we must use that rather than re-allocating a new buffer.
Reported-by: Do
crypto/hash: avoid overwriting user supplied result pointer
If the user provides a pre-allocated buffer for the hash result, we must use that rather than re-allocating a new buffer.
Reported-by: Dorjoy Chowdhury <dorjoychy111@gmail.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
95cc223a | 10-Oct-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: drop obsolete back compat logic for old nettle
The nettle 2.x series declared all the hash functions with 'int' for the data size. Since we dropped support for anything older than 3.4 we can
crypto: drop obsolete back compat logic for old nettle
The nettle 2.x series declared all the hash functions with 'int' for the data size. Since we dropped support for anything older than 3.4 we can assume nettle is using 'size_t' and thus avoid the back compat looping logic.
Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
24a6271e | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hashpriv: Remove old hash API function
Remove old hash_bytesv function, as it was replaced by the 4 new functions.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: D
crypto/hashpriv: Remove old hash API function
Remove old hash_bytesv function, as it was replaced by the 4 new functions.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
8a70903b | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-afalg: Remove old hash API functions
Removes the old hash API functions in the afalg driver, and modifies the hmac function to use the new helper functions.
Signed-off-by: Alejandro Zei
crypto/hash-afalg: Remove old hash API functions
Removes the old hash API functions in the afalg driver, and modifies the hmac function to use the new helper functions.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ clg: - Checkpatch fixes ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
7908bf74 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-nettle: Remove old hash API functions
Removes old hash implementation in the nettle hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berr
crypto/hash-nettle: Remove old hash API functions
Removes old hash implementation in the nettle hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ clg: - Fixed spelling in commit log ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
d946043c | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-gnutls: Remove old hash API functions
Removes old hash implementation in the gnutls hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berr
crypto/hash-gnutls: Remove old hash API functions
Removes old hash implementation in the gnutls hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ clg: - Fixed spelling in commit log ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
7dae595e | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-gcrypt: Remove old hash API functions
Removes old hash implementation in the gcrypt hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berr
crypto/hash-gcrypt: Remove old hash API functions
Removes old hash implementation in the gcrypt hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ clg: - Fixed spelling in commit log ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
8d46ede7 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-glib: Remove old hash API functions
Removes old hash implement-ion in the GLib hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé
crypto/hash-glib: Remove old hash API functions
Removes old hash implement-ion in the GLib hash driver.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ clg: - Fixed spelling in commit log ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
e3c07527 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash: Implement and use new hash API
Changes the public hash API implementation to support accumulative hashing.
Implementations for the public functions are added to call the new driver fun
crypto/hash: Implement and use new hash API
Changes the public hash API implementation to support accumulative hashing.
Implementations for the public functions are added to call the new driver functions that implement context creation, updating, finalization, and destruction.
Additionally changes the "shortcut" functions to use these 4 new core functions.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> [ clg: - Reworked qcrypto_hash_bytesv() error handling - Used hash->driver int qcrypto_hash_new(), qcrypto_hash_free() qcrypto_hash_updatev() - Introduced qcrypto_hash_supports() check in qcrypto_hash_new() - Introduced g_autofree variables in qcrypto_hash_finalize_digest() and qcrypto_hash_finalize_base64() - Re-arrranged code in qcrypto_hash_digestv() and qcrypto_hash_digest() - Checkpatch fixes ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
90c3dc60 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-afalg: Implement new hash API
Updates the afalg hash driver to support the new accumulative hashing changes as part of the patch series.
Implements opening/closing of contexts, updating
crypto/hash-afalg: Implement new hash API
Updates the afalg hash driver to support the new accumulative hashing changes as part of the patch series.
Implements opening/closing of contexts, updating hash data and finalizing the hash digest.
In order to support the update function, a flag needs to be passed to the kernel via the socket send call (MSG_MORE) to notify it that more data is to be expected to calculate the hash correctly. As a result, a new function was added to the iov helper utils to allow passing a flag to the socket send call.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> [ clg: - Handled qcrypto_afalg_hash_ctx_new() errors in qcrypto_afalg_hash_new() - Freed alg_name in qcrypto_afalg_hash_new() - Reworked qcrypto_afalg_recv_from_kernel() - Split iov changes from original patch ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
278d5960 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-nettle: Implement new hash API
Implements the new hashing API in the nettle hash driver. Supports creating/destroying a context, updating the context with input data and obtaining an out
crypto/hash-nettle: Implement new hash API
Implements the new hashing API in the nettle hash driver. Supports creating/destroying a context, updating the context with input data and obtaining an output hash.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> [ clg: - Dropped qcrypto_hash_supports() in qcrypto_nettle_hash_new() ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
f4f3d666 | 08-Oct-2024 |
Alejandro Zeise <alejandro.zeise@seagate.com> |
crypto/hash-gnutls: Implement new hash API
Implements the new hashing API in the gnutls hash driver. Supports creating/destroying a context, updating the context with input data and obtaining an out
crypto/hash-gnutls: Implement new hash API
Implements the new hashing API in the gnutls hash driver. Supports creating/destroying a context, updating the context with input data and obtaining an output hash.
Signed-off-by: Alejandro Zeise <alejandro.zeise@seagate.com> [ clg: - Dropped qcrypto_hash_supports() in qcrypto_gnutls_hash_new() - Reworked qcrypto_gnutls_hash_finalize() - Handled gnutls_hash_init() errors in qcrypto_gnutls_hash_new() - Replaced gnutls_hash_deinit() by gnutls_hash_output() in qcrypto_gnutls_hash_finalize() - Freed resources with gnutls_hash_deinit() in qcrypto_gnutls_hash_free() ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|