Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/wininet/http.c | 13 +++++++++++++ dlls/wininet/tests/http.c | 14 ++++++++++++++ 2 files changed, 27 insertions(+)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 8e40a4cee2b..d0150c235a3 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -2330,6 +2330,19 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
*(ULONG*)buffer = hdr->ErrorMask; *size = sizeof(ULONG); + return ERROR_SUCCESS; + case INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT: + TRACE("INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT\n"); + + if (*size < sizeof(PCERT_CHAIN_CONTEXT)) + return ERROR_INSUFFICIENT_BUFFER; + + if(!req->server->cert_chain) + return ERROR_INTERNET_INCORRECT_HANDLE_STATE; + + *((PCERT_CHAIN_CONTEXT*)buffer) = (PCERT_CHAIN_CONTEXT)CertDuplicateCertificateChain(req->server->cert_chain); + *size = sizeof(PCERT_CHAIN_CONTEXT); + return ERROR_SUCCESS; }
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index b3fcc93b704..567f63b9c8a 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -7129,6 +7129,7 @@ static void test_secure_connection(void) INTERNET_CERTIFICATE_INFOW *certificate_structW = NULL; char certstr1[512], certstr2[512]; BOOL ret; + PCCERT_CHAIN_CONTEXT ctx = NULL;
ses = InternetOpenA("Gizmo5", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n"); @@ -7160,6 +7161,14 @@ static void test_secure_connection(void)
test_cert_struct(req, &test_winehq_org_cert);
+ size = sizeof(PCCERT_CHAIN_CONTEXT); + ret = InternetQueryOptionA(req, INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT, &ctx, &size); + ok(ret || GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE /* < IE8*/, "InternetQueryOption failed: %d\n", GetLastError()); + if (ret) + { + CertFreeCertificateChain(ctx); + } + /* Querying the same option through InternetQueryOptionW still results in * ANSI strings being returned. */ @@ -8099,6 +8108,7 @@ static void test_cert_string(void) char actual[512]; DWORD size; BOOL res; + PCCERT_CHAIN_CONTEXT ctx = NULL;
ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" ); @@ -8119,6 +8129,10 @@ static void test_cert_string(void) ok( size == 0, "unexpected size: %u\n", size ); ok( actual[0] == 0x55, "unexpected byte: %02x\n", actual[0] );
+ size = sizeof(PCCERT_CHAIN_CONTEXT); + res = InternetQueryOptionA(req, INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT, &ctx, &size); + ok(!res && (GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_STATE), "InternetQueryOption failed: %d\n", GetLastError()); + InternetCloseHandle( req ); InternetCloseHandle( con ); InternetCloseHandle( ses );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99831
Your paranoid android.
=== w8adm (32 bit report) ===
wininet: http.c:697: Test failed: req_error = 12007 http.c:708: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 1 times, received 0 times http.c:721: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 0 times http.c:722: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 0 times http.c:723: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 0 times http.c:724: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 1 times, received 0 times http.c:733: Test failed: flags = 8, expected 0 http.c:747: Test failed: Expected any header character, got 0x00 http.c:774: Test failed: Expected 0x0000, got 7777 http.c:937: Test failed: Returned zero size in response to request complete http.c:376: Test failed: unexpected status 10 (INTERNET_STATUS_RESOLVING_NAME) http.c:697: Test failed: req_error = 12007 http.c:718: Test failed: expected status 10 (INTERNET_STATUS_RESOLVING_NAME) 0 times, received 1 times http.c:721: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 2 times, received 0 times http.c:722: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 2 times, received 0 times http.c:723: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 2 times, received 0 times http.c:724: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 2 times, received 0 times http.c:726: Test failed: expected status 110 (INTERNET_STATUS_REDIRECT) 1 times, received 0 times http.c:733: Test failed: flags = 8, expected 0 http.c:747: Test failed: Expected any header character, got 0x00 http.c:774: Test failed: Expected 0x0000, got 7777 http.c:797: Test failed: size = 37 http.c:797: Test failed: unexpected URL http://test.winehq.org/tests/redirect, expected http://test.winehq.org/tests/hello.html http.c:937: Test failed: Returned zero size in response to request complete http.c:376: Test failed: unexpected status 10 (INTERNET_STATUS_RESOLVING_NAME) http.c:376: Test failed: unexpected status 11 (INTERNET_STATUS_NAME_RESOLVED) http.c:718: Test failed: expected status 10 (INTERNET_STATUS_RESOLVING_NAME) 0 times, received 1 times http.c:719: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 0 times, received 1 times
=== debiant2 (64 bit WoW report) ===
wininet: http.c:3595: Test failed: got 66