1620092196.v18-2-gee1dfed.sss-use-bn-set-word-x-0-instead-of-bn-zero.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Subject: Sss: use BN_set_word(x, 0) instead of BN_zero()
  2. Origin: v18-2-gee1dfed <https://github.com/latchset/clevis/commit/v18-2-gee1dfed>
  3. Upstream-Author: Sergio Correia <scorreia@redhat.com>
  4. Date: Mon May 3 22:36:36 2021 -0300
  5. Different OpenSSL versions define BN_zero() differently -- sometimes
  6. returning an integer, sometimes as void --, so let's use instead
  7. BN_set_word() instead, not to have issues when building with these
  8. different versions.
  9. --- a/src/pins/sss/sss.c
  10. +++ b/src/pins/sss/sss.c
  11. @@ -214,7 +214,7 @@
  12. if (BN_rand_range(xx, pp) <= 0)
  13. return NULL;
  14. - if (BN_zero(yy) <= 0)
  15. + if (BN_set_word(yy, 0) <= 0)
  16. return NULL;
  17. for (size_t i = 0; i < json_array_size(e); i++) {
  18. @@ -272,7 +272,7 @@
  19. if (!ctx || !pp || !acc || !tmp || !k)
  20. return NULL;
  21. - if (BN_zero(k) <= 0)
  22. + if (BN_set_word(k, 0) <= 0)
  23. return NULL;
  24. len = jose_b64_dec(p, NULL, 0);
  25. @@ -303,7 +303,7 @@
  26. /* acc *= (0 - xi) / (xo - xi) */
  27. - if (BN_zero(tmp) <= 0)
  28. + if (BN_set_word(tmp, 0) <= 0)
  29. return NULL;
  30. if (BN_mod_sub(tmp, tmp, xi, pp, ctx) <= 0)