hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest15 patches 22 repliesIn review
- v312 patches 3 repliesSuperseded
- v22 patches 6 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 2 patches | 1 reply | Superseded |
Changes in v4 from the cover letter
* Restructured patches so unit tests pass for each independently.
* Freeing hash context is now a void function.
* Added autoptr cleanup function definition for qcrypto_hash_free.
* Separated qcrypto_hash_update into qcrypto_hash_update and qcrypto_hash_updatev.
* Changed public hash functions to use afalg implementation correctly if support is enabled.
* Fixed accumulative hashing in afalg driver (pass MSG_MORE socket flag).
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | crypto: accumulative hashing APIcrypto/ include/ | +132 | 2 replies | |
| 2/15 | crypto/hash-glib: Implement new hash APIcrypto/ | +76 | 1 reply | |
| 3/15 | crypto/hash-gcrypt: Implement new hash APIcrypto/ | +79 | 5 replies | |
| 4/15 | crypto/hash-gnutls: Implement new hash APIcrypto/ | +73 | 1 reply | |
| 5/15 | crypto/hash-nettle: Implement new hash APIcrypto/ | +77 | 0 replies | |
| 6/15 | crypto/hash-afalg: Implement new hash APIcrypto/ include/ util/ | +167 | 1 reply | |
| 7/15 | crypto/hash: Implement and use new hash APIcrypto/ | +128 | 1 reply | |
| 8/15 | tests/unit/test-crypto-hash: accumulative hashingtests/ | +48 | 1 reply | |
| 9/15 | crypto/hash-glib: Remove old hash API functionscrypto/ | +0 | 1 reply | |
| 10/15 | crypto/hash-gcrypt: Remove old hash API functionscrypto/ | +0 | 1 reply | |
| 11/15 | crypto/hash-gnutls: Remove old hash API functionscrypto/ | +0 | 1 reply | |
| 12/15 | crypto/hash-nettle: Remove old hash API functionscrypto/ | +0 | 1 reply | |
| 13/15 | crypto/hash-afalg: Remove old hash API functionscrypto/ | +3 | 1 reply | |
| 14/15 | crypto/hashpriv: Remove old hash API functioncrypto/ | +0 | 1 reply | |
| 15/15 | hw/misc/aspeed_hace: Fix SG Accumulative hashinghw/ include/ | +54 | 1 reply |
Reviews trailers per patch
6 of 15 patches have a Reviewed-by or Acked-by.
| Patch | Daniel P. Berrangé |
|---|---|
| 1/15 | |
| 2/15 | |
| 3/15 | |
| 4/15 | |
| 5/15 | |
| 6/15 | |
| 7/15 | |
| 8/15 | |
| 9/15 | R-b |
| 10/15 | R-b |
| 11/15 | R-b |
| 12/15 | R-b |
| 13/15 | R-b |
| 14/15 | R-b |
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/15] hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations
The goal of this patch series is to fix accumulative hashing support in the Aspeed HACE module. The issue that stemmed this patch was a failure to boot an OpenBMC image using the "ast2600-evb" machine. The U-boot
2019.04 loader failed to verify image hashes.
These incorrect image hashes given by the HACE to the U-boot guest are due to an oversight in the HACE module. Previously when operating in scatter-gather accumulative mode, the HACE would cache the address provided by the guest which contained the source data. However, there was no deep copy, so when HACE generated the digest upon the reception of the final accumulative chunk the digest was incorrect, as the addresses provided had their regions overwritten by that time.
This fix consists of two main steps:
* Add an accumulative hashing function to the qcrypto library
* Modify the HACE module to use the accumulative hashing functions
All the crypto library backends (nettle, gnutls, etc.) support accumulative hashing, so it was trivial to create wrappers for those functions.
Changes in V4:
* Restructured patches so unit tests pass for each independently.
* Freeing hash context is now a void function.
* Added autoptr cleanup function definition for qcrypto_hash_free.
* Separated qcrypto_hash_update into qcrypto_hash_update and qcrypto_hash_updatev.
* Changed public hash functions to use afalg implementation correctly if support is enabled.
* Fixed accumulative hashing in afalg driver (pass MSG_MORE socket flag).
Changes in V3:
* Reworked crypto hash API with comments from Daniel
* Creation/Deletion of contexts, updating, and finalizing
* Modified existing API functions to use the new 4 main core functions
* Added test for accumulative hashing
* Added afalg driver implementation
* Fixed bug in HACE module where hash context fails to allocate, causing the HACE internal state to be incorrect and segfault.
Changes in V2:
* Fixed error checking bug in libgcrypt crypto backend of accumulate_bytesv
Alejandro Zeise (15):
crypto: accumulative hashing API crypto/hash-glib: Implement new hash API crypto/hash-gcrypt: Implement new hash API crypto/hash-gnutls: Implement new hash API crypto/hash-nettle: Implement new hash API crypto/hash-afalg: Implement new hash API crypto/hash: Implement and use new hash API tests/unit/test-crypto-hash: accumulative hashing crypto/hash-glib: Remove old hash API functions crypto/hash-gcrypt: Remove old hash API functions crypto/hash-gnutls: Remove old hash API functions crypto/hash-nettle: Remove old hash API functions crypto/hash-afalg: Remove old hash API functions crypto/hashpriv: Remove old hash API function hw/misc/aspeed_hace: Fix SG Accumulative hashing
crypto/hash-afalg.c | 171 ++++++++++++++++++++++++---------- crypto/hash-gcrypt.c | 110 ++++++++++++---------- crypto/hash-glib.c | 96 ++++++++++++------- crypto/hash-gnutls.c | 92 +++++++++++------- crypto/hash-nettle.c | 78 ++++++++++------ crypto/hash.c | 163 +++++++++++++++++++++++++------- crypto/hashpriv.h | 13 ++- hw/misc/aspeed_hace.c | 94 ++++++++++--------- include/crypto/hash.h | 119 +++++++++++++++++++++++ include/hw/misc/aspeed_hace.h | 4 + include/qemu/iov.h | 26 ++++++ tests/unit/test-crypto-hash.c | 48 ++++++++++ util/iov.c | 22 +++-- 13 files changed, 753 insertions(+), 283 deletions(-)
Signature · 1 line
2.34.1