Ticket #17944: timingsafe_memcmp.diff

File timingsafe_memcmp.diff, 797 bytes (added by logan, 4 years ago)
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index ad86f76..a47cee6 100644
    a b AC_CHECK_FUNCS( 
    381381        backtrace_symbols_fd \
    382382        clock_gettime \
    383383        eventfd \
     384        timingsafe_memcmp \
    384385        flock \
    385386        ftime \
    386387        getaddrinfo \
  • src/common/di_ops.c

    diff --git a/src/common/di_ops.c b/src/common/di_ops.c
    index c9d1350..4335a97 100644
    a b  
    2525int
    2626tor_memcmp(const void *a, const void *b, size_t len)
    2727{
     28
     29#ifdef HAVE_TIMINGSAFE_MEMCMP
     30        return timingsafe_memcmp(a, b, len);
     31#else
    2832  const uint8_t *x = a;
    2933  const uint8_t *y = b;
    3034  size_t i = len;
    tor_memcmp(const void *a, const void *b, size_t len) 
    8387  }
    8488
    8589  return retval;
     90#endif /* timingsafe_memcmp */
    8691}
    8792
    8893/**