Jacek Caban jacek@codeweavers.com writes:
The following patch makes winhttp use schannel instead of OpenSSL for SSL (HTTPS) connections. It is made to be as minimal change as possible (but complete enough to replace all OpenSSL functionality) to limit the scope for potential regressions. Further changes and improvements are left for later.
It doesn't work here:
../../../tools/runtest -q -P wine -M winhttp.dll -T ../../.. -p winhttp_test.exe.so winhttp.c && touch winhttp.ok net.c:607: read_ssl_chunk: Assertion `bufs[0].cbBuffer < ssl_buf_size' failed. wine: Assertion failed at address 0x68000822 (thread 0028), starting debugger... Unhandled exception: assertion failed in 32-bit code (0x68000822). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:68000822 ESP:0032f29c EBP:0032f2a8 EFLAGS:00000206( - -- I - -P- ) EAX:00000000 EBX:000057a6 ECX:000057a6 EDX:00000006 ESI:682e429f EDI:68308ff4 Stack dump: 0x0032f29c: 681d4941 68308ff4 0032f3c8 0032f3d0 0x0032f2ac: 681d7d72 00000006 0032f348 00000000 0x0032f2bc: 0032f2f0 682208ed 00000068 00000058 0x0032f2cc: 0032f3e0 0032f30c 00000068 00000058 0x0032f2dc: 00000050 7d99bd70 68308ff4 00000050 0x0032f2ec: 0000004f 0032f3b8 6820fa92 7d99bd78 Backtrace: =>0 0x68000822 GLIBC_2+0x822() in ld-linux.so.2 (0x0032f2a8) 1 0x681d7d72 abort+0x181() in libc.so.6 (0x0032f3d0) 2 0x681cdb58 __assert_fail+0xf7() in libc.so.6 (0x0032f418) 3 0x68510524 netconn_recv+0x7c3(conn=0x12e98c, buf=0x32fc8d, len=0x13, flags=0x100, recvd=0x32f508) [/home/julliard/wine/wine/dlls/winhttp/net.c:607] in winhttp (0x0032f4c8) 4 0x68513b91 receive_data_chunked+0x80(request=0x12e938, buffer=0x32fc8d, size=0x20, read=0x32fb14, async=0) [/home/julliard/wine/wine/dlls/winhttp/request.c:1733] in winhttp (0x0032fad8) 5 0x685186ed read_data+0x18c(request=0x12e938, buffer=0x32fc80, to_read=0x20, read=0x32fc6c, async=0) [/home/julliard/wine/wine/dlls/winhttp/request.c:1799] in winhttp (0x0032fb68) 6 0x6851a0c2 WinHttpReadData+0x81(hrequest=<couldn't compute location>, buffer=<couldn't compute location>, to_read=<couldn't compute location>, read=<couldn't compute location>) [/home/julliard/wine/wine/dlls/winhttp/request.c:2097] in winhttp (0x0032fbb8) 7 0x684ef626 func_winhttp+0xdd5() [/home/julliard/wine/wine/dlls/winhttp/tests/winhttp.c:879] in winhttp_test (0x0032fd38) 8 0x684de037 main+0x386(argc=<is not available>, argv=<is not available>) [/home/julliard/wine/wine/dlls/winhttp/tests/../../../include/wine/test.h:557] in winhttp_test (0x0032fe08) 9 0x684f2e60 __wine_spec_exe_entry+0x7f(peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/winecrt0/exe_entry.c:36] in winhttp_test (0x0032fe58) 10 0x7b8602bc call_process_entry+0xb() in kernel32 (0x0032fe78) 11 0x7b86149b start_process+0x6a(peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/kernel32/process.c:1084] in kernel32 (0x0032feb8) 12 0x7bc7a2e0 call_thread_func_wrapper+0xb() in ntdll (0x0032fed8) 13 0x7bc7d09d call_thread_func+0x7c(entry=0x7b861430, arg=0x7ffdf000, frame=0x32ffc8) [/home/julliard/wine/wine/dlls/ntdll/signal_i386.c:2522] in ntdll (0x0032ffa8) 14 0x7bc7a2be call_thread_entry_point+0x11() in ntdll (0x0032ffc8) 15 0x7bc4fc4e start_process+0x1d(kernel_start=0x7b861430) [/home/julliard/wine/wine/dlls/ntdll/loader.c:2691] in ntdll (0x0032ffe8) 16 0x6802947d wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000) 17 0x6802953b wine_switch_to_stack+0x2a(func=0x7bc4fc30, arg=0x7b861430, stack=0x330000) [/home/julliard/wine/wine/libs/wine/port.c:59] in libwine.so.1 (0xfffe93e8) 18 0x7bc5573f LdrInitializeThunk+0x3be(kernel_start=<couldn't compute location>, unknown2=<couldn't compute location>, unknown3=<couldn't compute location>, unknown4=<couldn't compute location>) [/home/julliard/wine/wine/dlls/ntdll/loader.c:2747] in ntdll (0xfffe9458) 19 0x7b867a78 __wine_kernel_init+0xbe7() [/home/julliard/wine/wine/dlls/kernel32/process.c:1257] in kernel32 (0xfffea368) 20 0x7bc55e13 __wine_process_init+0x182() [/home/julliard/wine/wine/dlls/ntdll/loader.c:2956] in ntdll (0xfffea3f8) 21 0x680270c2 wine_init+0x2a1(argc=0x3, argv=0xfffea944, error="", error_size=0x400) [/home/julliard/wine/wine/libs/wine/loader.c:841] in libwine.so.1 (0xfffea458) 22 0x7bf00e7b main+0x7a(argc=<is not available>, argv=<is not available>) [/home/julliard/wine/wine/loader/main.c:237] in <wine-loader> (0xfffea898)