Summary: | [Curl] Add an API returns description of verification errors. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Takashi Komori <takashi.komori> | ||||||
Component: | Platform | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, Basuke.Suzuki, chris.reid, darin, don.olmstead, ews-watchlist, galpeter, Hironori.Fujii, ross.kirsling, stephan.szabo, takashi.komori, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Takashi Komori
2020-03-11 05:33:41 PDT
Created attachment 393229 [details]
Patch
(In reply to Takashi Komori from comment #1) > Created attachment 393229 [details] > Patch Added test only tests the situation the error code is 0 (V509_V_OK). This is because we can't set an arbitrary error code without connecting servers for now. We will improve tests for this patch after establishing a method for testing bad certs in another ticket ( https://bugs.webkit.org/show_bug.cgi?id=208806 ). Comment on attachment 393229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393229&action=review > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:369 > + auto certificateInfo = WKProtectionSpaceCopyCertificateInfo(protectionSpace); Don't remove `adoptWK`. It will leak. > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:371 > + auto description = WKCertificateInfoCopyVerificationErrorDescription(certificateInfo); Use adoptWK for the return value of *Copy* API. It will leak. > Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp:93 > + ASSERT_TRUE(WKStringIsEqualToUTF8CString(WKCertificateInfoCopyVerificationErrorDescription(certificateInfo.get()), "ok")); The return value of WKCertificateInfoCopyVerificationErrorDescription leaks. You added a new WK2 API. Added WK2 owners in CC. Created attachment 393965 [details]
Patch
(In reply to Fujii Hironori from comment #3) > Comment on attachment 393229 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=393229&action=review > > > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:369 > > + auto certificateInfo = WKProtectionSpaceCopyCertificateInfo(protectionSpace); > > Don't remove `adoptWK`. It will leak. Fixed. > > > Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:371 > > + auto description = WKCertificateInfoCopyVerificationErrorDescription(certificateInfo); > > Use adoptWK for the return value of *Copy* API. It will leak. Fixed. > > > Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp:93 > > + ASSERT_TRUE(WKStringIsEqualToUTF8CString(WKCertificateInfoCopyVerificationErrorDescription(certificateInfo.get()), "ok")); > > The return value of WKCertificateInfoCopyVerificationErrorDescription leaks. Fixed. New API looks ok to me Committed r258728: <https://trac.webkit.org/changeset/258728> All reviewed patches have been landed. Closing bug and clearing flags on attachment 393965 [details]. |