2
0

extra.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From a53a6a67dc121b45d611318e2a37815cc209839c Mon Sep 17 00:00:00 2001
  2. From: Juliusz Sosinowicz <juliusz@wolfssl.com>
  3. Date: Fri, 19 Apr 2024 16:41:38 +0200
  4. Subject: [PATCH] Fixes for running tests under UML
  5. - Apply commit ID fix from more recent commit
  6. - priv_sz and pub_sz are checked and fail on UML. Probably because stack is zeroed out.
  7. ---
  8. src/crypto/crypto_wolfssl.c | 2 +-
  9. tests/hwsim/run-all.sh | 8 +++++++-
  10. 2 files changed, 8 insertions(+), 2 deletions(-)
  11. diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
  12. index 00ecf61352..a57fa50697 100644
  13. --- a/src/crypto/crypto_wolfssl.c
  14. +++ b/src/crypto/crypto_wolfssl.c
  15. @@ -785,7 +785,7 @@ int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey,
  16. int ret = -1;
  17. WC_RNG rng;
  18. DhKey *dh = NULL;
  19. - word32 priv_sz, pub_sz;
  20. + word32 priv_sz = prime_len, pub_sz = prime_len;
  21. if (TEST_FAIL())
  22. return -1;
  23. diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
  24. index ee48cd0581..75c3a58b52 100755
  25. --- a/tests/hwsim/run-all.sh
  26. +++ b/tests/hwsim/run-all.sh
  27. @@ -15,7 +15,13 @@ export LOGDIR
  28. if [ -z "$DBFILE" ]; then
  29. DB=""
  30. else
  31. - DB="-S $DBFILE --commit $(git rev-parse HEAD)"
  32. + DB="-S $DBFILE"
  33. + if [ -z "$COMMITID" ]; then
  34. + COMMITID="$(git rev-parse HEAD)"
  35. + fi
  36. + if [ -n "$COMMITID" ]; then
  37. + DB="$DB --commit $COMMITID"
  38. + fi
  39. if [ -n "$BUILD" ]; then
  40. DB="$DB -b $BUILD"
  41. fi
  42. --
  43. 2.34.1