140-disable_assert.patch 585 B

123456789101112131415
  1. --- a/dbutil.h
  2. +++ b/dbutil.h
  3. @@ -78,7 +78,11 @@ int m_str_to_uint(const char* str, unsig
  4. #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL}
  5. /* Dropbear assertion */
  6. -#define dropbear_assert(X) do { if (!(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0)
  7. +#ifndef DROPBEAR_ASSERT_ENABLED
  8. +#define DROPBEAR_ASSERT_ENABLED 0
  9. +#endif
  10. +
  11. +#define dropbear_assert(X) do { if (DROPBEAR_ASSERT_ENABLED && !(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0)
  12. /* Returns 0 if a and b have the same contents */
  13. int constant_time_memcmp(const void* a, const void *b, size_t n);