FreeRDP/winpr/libwinpr/utils
zihao.jiang a505a6cd27 Winpr/openssl: Fix digests initialization in multi-thread
SSL functions like OpenSSL_add_all_digests should be invoked at very beginning as they are not MT safe.
If not we might meet double free exception as following:

 #0  0x00007f23ddd71c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #1  0x00007f23ddd75028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #2  0x00007f23dddae2a4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #3  0x00007f23dddba55e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #4  0x00007f23dc6ecfcd in CRYPTO_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #5  0x00007f23dc6ef8d1 in OBJ_NAME_add () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #6  0x00007f23dc77dcd8 in EVP_add_digest () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #7  0x00007f23dc782321 in OpenSSL_add_all_digests () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #8  0x00007f23c781da28 in winpr_openssl_get_evp_md (md=4) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:52
 #9  0x00007f23c781dccb in winpr_Digest_Init (ctx=0x7f22d064d470, md=<optimized out>) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:344
 #10 0x00007f23d486139b in security_salted_mac_signature (rdp=0x7f23859f5a20, data=0x7f238542d4fb "\004\204\022\004", length=4743, encryption=<optimized out>, output=0x7
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/security.c:378
 #11 0x00007f23d488d73f in fastpath_send_update_pdu (fastpath=<optimized out>, updateCode=4 '\004', s=0x7f23859f5f40, skipCompression=true)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/fastpath.c:1076
 #12 0x00007f23d4891c4f in update_send_surface_frame_bits (context=0x7f23859f5540, cmd=0x7f22b2ffcc80, first=true, last=true, frameId=6)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/update.c:1041

Related reports: https://rt.openssl.org/Ticket/Display.html?id=2216&user=guest&pass=guest
2016-12-28 03:48:40 +08:00
..
collections Merge branch 'master' of github.com:FreeRDP/FreeRDP 2016-05-11 11:05:17 -04:00
corkscrew Added winpr functions to generate a stacktrace. 2014-08-14 10:36:50 +02:00
lodepng Warning fixes. 2016-10-06 13:43:10 +02:00
test Fixed warnings. 2016-10-06 13:43:10 +02:00
trio Don't disable C99 long double math on non Unix platforms 2015-05-05 21:27:17 +03:00
wlog WLog using C99 compatible variadic macros. 2016-10-07 14:05:27 +02:00
CMakeLists.txt wlog: rework, cleanup and stabilize API 2015-11-09 18:25:45 +01:00
cmdline.c winpr: initial port to Universal Windows Platform (UWP) 2016-02-05 16:28:45 -05:00
debug.c fix segfaults casused by size_t format specifier 2016-05-27 15:55:28 +02:00
image.c Fix png image loading that needed write access 2016-01-27 11:02:16 -08:00
ini.c winpr: fix ini utils leak 2016-03-07 21:21:06 -05:00
ModuleOptions.cmake libwinpr: use ModuleOptions.cmake automatically 2012-10-03 19:50:48 -04:00
ntlm.c winpr/crypt api changes and memory leak fixes 2016-11-24 18:27:29 +01:00
print.c fix segfaults casused by size_t format specifier 2016-05-27 15:55:28 +02:00
sam.c freerdp: add configurable NTLM SAM file option for server-side NLA 2016-07-21 18:58:24 -04:00
ssl.c Winpr/openssl: Fix digests initialization in multi-thread 2016-12-28 03:48:40 +08:00
stream.c winpr/stream: don't allow 0-size streams 2015-10-23 18:38:41 +02:00
winpr.c Added get_build_config functions. 2016-01-28 14:26:50 +01:00