Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    3753dbd5
    DRTVWR-476: Use OpenSSL API suitable for 64-bit pointers. · 3753dbd5
    Nat Goodspeed authored
    In three different places we use the same pattern: an ssl_thread_id_callback()
    function (a static member of LLCrashLogger, in that case) that used to be
    passed to CRYPTO_set_id_callback() and therefore returned an unsigned long
    representing the ID of the current thread.
    
    But GetCurrentThread() is a HANDLE, an alias for a pointer, and you can't
    uniquely cram a 64-bit pointer into an unsigned long.
    
    Fortunately OpenSSL has a more modern API for retrieving thread ID. Pass
    each ssl_thread_id_callback() function to CRYPTO_THREADID_set_callback()
    instead, converting it to accept CRYPTO_THREADID* and call
    CRYPTO_THREADID_set_pointer() or CRYPTO_THREADID_set_numeric() as appropriate().
    3753dbd5
    History
    DRTVWR-476: Use OpenSSL API suitable for 64-bit pointers.
    Nat Goodspeed authored
    In three different places we use the same pattern: an ssl_thread_id_callback()
    function (a static member of LLCrashLogger, in that case) that used to be
    passed to CRYPTO_set_id_callback() and therefore returned an unsigned long
    representing the ID of the current thread.
    
    But GetCurrentThread() is a HANDLE, an alias for a pointer, and you can't
    uniquely cram a 64-bit pointer into an unsigned long.
    
    Fortunately OpenSSL has a more modern API for retrieving thread ID. Pass
    each ssl_thread_id_callback() function to CRYPTO_THREADID_set_callback()
    instead, converting it to accept CRYPTO_THREADID* and call
    CRYPTO_THREADID_set_pointer() or CRYPTO_THREADID_set_numeric() as appropriate().
Code owners
Assign users and groups as approvers for specific file changes. Learn more.