Changeset 278178 in webkit


Ignore:
Timestamp:
May 27, 2021 2:35:51 PM (3 years ago)
Author:
don.olmstead@sony.com
Message:

[CMake] Add check for timingsafe_bcmp
https://bugs.webkit.org/show_bug.cgi?id=226347

Reviewed by Chris Dumez.

.:

Adds a symbol check for timingsafe_bcmp and sets HAVE_TIMINGSAFE_BCMP accordingly in the
cmakeconfig.h.

  • Source/cmake/OptionsCommon.cmake:

Source/WTF:

Use HAVE(TIMINGSAFE_BCMP) in CryptographicUtilities code. Set its value in PlatformHave for
platforms not using CMake.

  • wtf/CryptographicUtilities.cpp:
  • wtf/CryptographicUtilities.h:
  • wtf/PlatformHave.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r278170 r278178  
     12021-05-27  Don Olmstead  <don.olmstead@sony.com>
     2
     3        [CMake] Add check for timingsafe_bcmp
     4        https://bugs.webkit.org/show_bug.cgi?id=226347
     5
     6        Reviewed by Chris Dumez.
     7
     8        Adds a symbol check for timingsafe_bcmp and sets HAVE_TIMINGSAFE_BCMP accordingly in the
     9        cmakeconfig.h.
     10
     11        * Source/cmake/OptionsCommon.cmake:
     12
    1132021-05-27  Adrian Perez de Castro  <aperez@igalia.com>
    214
  • trunk/Source/WTF/ChangeLog

    r278177 r278178  
     12021-05-27  Don Olmstead  <don.olmstead@sony.com>
     2
     3        [CMake] Add check for timingsafe_bcmp
     4        https://bugs.webkit.org/show_bug.cgi?id=226347
     5
     6        Reviewed by Chris Dumez.
     7
     8        Use HAVE(TIMINGSAFE_BCMP) in CryptographicUtilities code. Set its value in PlatformHave for
     9        platforms not using CMake.
     10
     11        * wtf/CryptographicUtilities.cpp:
     12        * wtf/CryptographicUtilities.h:
     13        * wtf/PlatformHave.h:
     14
    1152021-05-27  Mikhail R. Gadelha  <mikhail.ramalho@gmail.com>
    216
  • trunk/Source/WTF/wtf/CryptographicUtilities.cpp

    r278144 r278178  
    2929namespace WTF {
    3030
    31 #if !PLATFORM(COCOA) && !OS(OPENBSD) && !OS(FREEBSD)
     31#if !HAVE(TIMINGSAFE_BCMP)
    3232NEVER_INLINE int constantTimeMemcmp(const void* voidA, const void* voidB, size_t length)
    3333{
  • trunk/Source/WTF/wtf/CryptographicUtilities.h

    r278144 r278178  
    3131
    3232// Returns zero if arrays are equal, and non-zero otherwise. Execution time does not depend on array contents.
    33 #if PLATFORM(COCOA) || OS(OPENBSD) || OS(FREEBSD)
     33#if HAVE(TIMINGSAFE_BCMP)
    3434inline int constantTimeMemcmp(const void* voidA, const void* voidB, size_t length)
    3535{
  • trunk/Source/WTF/wtf/PlatformHave.h

    r278176 r278178  
    9494#endif
    9595
     96#if !defined(HAVE_TIMINGSAFE_BCMP) && (PLATFORM(COCOA) || OS(OPENBSD) || OS(FREEBSD))
     97#define HAVE_TIMINGSAFE_BCMP 1
     98#endif
     99
    96100#if !defined(HAVE_STD_FILESYSTEM)
    97101#if __has_include(<filesystem>)
  • trunk/Source/cmake/OptionsCommon.cmake

    r278027 r278178  
    145145WEBKIT_CHECK_HAVE_SYMBOL(HAVE_REGEX_H regexec regex.h)
    146146if (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin"))
    147 WEBKIT_CHECK_HAVE_SYMBOL(HAVE_PTHREAD_MAIN_NP pthread_main_np pthread_np.h)
     147    WEBKIT_CHECK_HAVE_SYMBOL(HAVE_PTHREAD_MAIN_NP pthread_main_np pthread_np.h)
    148148endif ()
     149WEBKIT_CHECK_HAVE_SYMBOL(HAVE_TIMINGSAFE_BCMP timingsafe_bcmp string.h)
    149150# Windows has signal.h but is missing symbols that are used in calls to signal.
    150151WEBKIT_CHECK_HAVE_SYMBOL(HAVE_SIGNAL_H SIGTRAP signal.h)
Note: See TracChangeset for help on using the changeset viewer.