WebKit Bugzilla
Attachment 373699 Details for
Bug 191498
: [Curl] implement CertificateInfo::summaryInfo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-191498-20190709130219.patch (text/plain), 23.21 KB, created by
Takashi Komori
on 2019-07-08 21:06:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-07-08 21:06:15 PDT
Size:
23.21 KB
patch
obsolete
>Subversion Revision: 247246 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 52a21cdcad0cb0951b54bdf4fd8753663cf06e11..e39bd3613b2fd02bab50290fbbe46a446112165f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,73 @@ >+2019-07-08 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] implement CertificateInfo::summaryInfo >+ https://bugs.webkit.org/show_bug.cgi?id=191498 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement CertificaeInfo::SummaryInfo. >+ This patch makes WebInspector show summary of certificates. >+ >+ Tests: http/tests/inspector/network/resource-security-certificate.html >+ http/tests/inspector/network/getSerializedCertificate.html >+ >+ * platform/network/curl/CertificateInfo.h: >+ (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): >+ (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): >+ (WebCore::CertificateInfo::summaryInfo const): Deleted. >+ * platform/network/curl/CertificateInfoCurl.cpp: >+ (WebCore::getCommonName): >+ (WebCore::getSubjectName): >+ (WebCore::convertASN1TimeToSeconds): >+ (WebCore::getSubjectAltName): >+ (WebCore::CertificateInfo::summaryInfo const): >+ * platform/network/curl/CurlSSLVerifier.cpp: >+ (WebCore::CurlSSLVerifier::collectInfo): >+ (WebCore::CurlSSLVerifier::verifyCallback): >+ (WebCore::pemDataFromCtx): >+ (WebCore::StackOfX509::StackOfX509): Deleted. >+ (WebCore::StackOfX509::~StackOfX509): Deleted. >+ (WebCore::StackOfX509::count): Deleted. >+ (WebCore::StackOfX509::item): Deleted. >+ (): Deleted. >+ (WebCore::BIOHolder::BIOHolder): Deleted. >+ (WebCore::BIOHolder::~BIOHolder): Deleted. >+ (WebCore::BIOHolder::write): Deleted. >+ (WebCore::BIOHolder::asCertificate): Deleted. >+ * platform/network/curl/OpenSSLHelper.h: Added. >+ (OpenSSL::X509Ref::X509Ref): >+ (OpenSSL::X509Ref::~X509Ref): >+ (OpenSSL::X509Ref::operator const ::X509* const): >+ (OpenSSL::X509Ref::operator ::X509*): >+ (OpenSSL::StackOfGeneralName::StackOfGeneralName): >+ (OpenSSL::StackOfGeneralName::~StackOfGeneralName): >+ (OpenSSL::StackOfGeneralName::operator bool): >+ (OpenSSL::StackOfGeneralName::count): >+ (OpenSSL::StackOfGeneralName::item): >+ (OpenSSL::StackOfX509::StackOfX509): >+ (OpenSSL::StackOfX509::~StackOfX509): >+ (OpenSSL::StackOfX509::count): >+ (OpenSSL::StackOfX509::item): >+ (OpenSSL::BIO::BIO): >+ (OpenSSL::BIO::~BIO): >+ (OpenSSL::BIO::write): >+ (OpenSSL::BIO::readX509): >+ (OpenSSL::BIO::getMemData const): >+ (OpenSSL::BIO::get): >+ (OpenSSL::BufMem::~BufMem): >+ (OpenSSL::BufMem::operator const BUF_MEM* const): >+ (OpenSSL::BufMem::operator BUF_MEM* ): >+ (OpenSSL::BufMem::get): >+ (OpenSSL::Ptr::Ptr): >+ (OpenSSL::Ptr::~Ptr): >+ (OpenSSL::Ptr::adopt): >+ (OpenSSL::Ptr::get const): >+ (OpenSSL::Ptr::get): >+ (OpenSSL::Ptr::operator const T* const): >+ (OpenSSL::Ptr::operator T*): >+ (OpenSSL::Ptr::operator bool): >+ (OpenSSL::Ptr::operator &): >+ > 2019-07-08 Chris Dumez <cdumez@apple.com> > > Make Document::postTask() safe to call from a background thread >diff --git a/Source/WebCore/platform/network/curl/CertificateInfo.h b/Source/WebCore/platform/network/curl/CertificateInfo.h >index e57f3bd0a48908e53fe58c9ae4d4af5601fa0e00..4861e0d438da028aa18eb9227cb57d2669eba381 100644 >--- a/Source/WebCore/platform/network/curl/CertificateInfo.h >+++ b/Source/WebCore/platform/network/curl/CertificateInfo.h >@@ -49,7 +49,7 @@ public: > > bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; } > >- Optional<SummaryInfo> summaryInfo() const { notImplemented(); return WTF::nullopt; } >+ Optional<SummaryInfo> summaryInfo() const; > > bool isEmpty() const { return m_certificateChain.isEmpty(); } > >@@ -71,15 +71,43 @@ namespace WTF { > namespace Persistence { > > template<> struct Coder<WebCore::CertificateInfo> { >- static void encode(Encoder&, const WebCore::CertificateInfo&) >+ static void encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo) > { >- notImplemented(); >+ auto certificateChain = certificateInfo.certificateChain(); >+ >+ encoder << certificateInfo.verificationError(); >+ encoder << certificateChain.size(); >+ for (auto certificate : certificateChain) { >+ encoder << certificate.size(); >+ encoder.encodeFixedLengthData(certificate.data(), certificate.size()); >+ } > } > >- static bool decode(Decoder&, WebCore::CertificateInfo&) >+ static bool decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo) > { >- notImplemented(); >- return false; >+ int verificationError; >+ if (!decoder.decode(verificationError)) >+ return false; >+ >+ size_t numOfCert = 0; >+ if (!decoder.decode(numOfCert)) >+ return false; >+ >+ WebCore::CertificateInfo::CertificateChain certificateChain; >+ for (size_t i = 0; i < numOfCert; i++) { >+ size_t certSize = 0; >+ if (!decoder.decode(certSize)) >+ return false; >+ >+ WebCore::CertificateInfo::Certificate certificate(certSize); >+ if (!decoder.decodeFixedLengthData(certificate.data(), certificate.size())) >+ return false; >+ >+ certificateChain.append(WTFMove(certificate)); >+ } >+ >+ certificateInfo = WebCore::CertificateInfo(verificationError, WTFMove(certificateChain)); >+ return true; > } > }; > >diff --git a/Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp b/Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp >index 0a5339f5c5523494238fa509d24ff91108a93e17..0880195999a2fb260c9f7b2ddd73b37bd3177bc7 100644 >--- a/Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp >+++ b/Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * Copyright (C) 2019 Sony Interactive Entertainment Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,8 +25,11 @@ > > #include "config.h" > #include "CertificateInfo.h" >+#include "OpenSSLHelper.h" > > #include <wtf/CrossThreadCopier.h> >+#include <wtf/Seconds.h> >+#include <wtf/text/StringBuilder.h> > > #if USE(CURL) > >@@ -50,6 +53,165 @@ CertificateInfo::Certificate CertificateInfo::makeCertificate(const uint8_t* buf > return certificate; > } > >+static Optional<String> getCommonName(const X509* x509) >+{ >+ auto subjectName = X509_get_subject_name(x509); >+ if (!subjectName) >+ return WTF::nullopt; >+ >+ auto index = X509_NAME_get_index_by_NID(subjectName, NID_commonName, -1); >+ if (index < 0) >+ return WTF::nullopt; >+ >+ auto commonNameEntry = X509_NAME_get_entry(subjectName, index); >+ if (commonNameEntry < 0) >+ return WTF::nullopt; >+ >+ auto commonNameEntryData = X509_NAME_ENTRY_get_data(commonNameEntry); >+ if (commonNameEntryData < 0) >+ return WTF::nullopt; >+ >+ OpenSSL::Ptr<uint8_t> commonName; >+ auto commonNameLength = ASN1_STRING_to_UTF8(&commonName, commonNameEntryData); >+ if (commonNameLength <= 0) >+ return WTF::nullopt; >+ >+ return String(commonName, commonNameLength); >+} >+ >+static Optional<String> getSubjectName(const X509* x509) >+{ >+ static const unsigned long flags = (ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_DN_REV | XN_FLAG_FN_NONE | XN_FLAG_SPC_EQ) & ~ASN1_STRFLGS_ESC_MSB; >+ >+ auto subjectName = X509_get_subject_name(x509); >+ if (!subjectName) >+ return WTF::nullopt; >+ >+ OpenSSL::BIO bio; >+ auto length = X509_NAME_print_ex(bio.get(), subjectName, 0, flags); >+ if (length <= 0) >+ return WTF::nullopt; >+ >+ OpenSSL::BufMem bufMem; >+ BIO_get_mem_ptr(bio.get(), &bufMem); >+ BIO_set_close(bio.get(), BIO_NOCLOSE); >+ >+ return String(bufMem.get()->data, bufMem.get()->length); >+} >+ >+static Optional<Seconds> convertASN1TimeToSeconds(const ASN1_TIME* ans1Time) >+{ >+ if (!ans1Time) >+ return WTF::nullopt; >+ >+ if ((ans1Time->type != V_ASN1_UTCTIME && ans1Time->type != V_ASN1_GENERALIZEDTIME) || !ans1Time->data) >+ return WTF::nullopt; >+ >+ // UTCTIME : YYmmddHHMM[SS] >+ // GENERALIZEDTIME : YYYYmmddHHMM[SS] >+ int digitLength = ans1Time->type == V_ASN1_UTCTIME ? 10 : 12; >+ if (ans1Time->length < digitLength) >+ return WTF::nullopt; >+ >+ auto data = ans1Time->data; >+ for (int i = 0; i < digitLength; i++) { >+ if (!isASCIIDigit(data[i])) >+ return WTF::nullopt; >+ } >+ >+ struct tm time { 0 }; >+ >+ if (ans1Time->type == V_ASN1_UTCTIME) { >+ time.tm_year = (data[0] - '0') * 10 + (data[1] - '0'); >+ if (time.tm_year < 50) >+ time.tm_year += 100; >+ } else { >+ time.tm_year = (data[0] - '0') * 1000 + (data[1] - '0') * 100 + (data[2] - '0') * 10 + (data[3] - '0'); >+ time.tm_year -= 1900; >+ } >+ >+ data += ans1Time->type == V_ASN1_UTCTIME ? 2 : 4; >+ >+ time.tm_mon = (data[0] - '0') * 10 + (data[1] - '0') - 1; >+ if (time.tm_mon < 0 || time.tm_mon > 11) >+ return WTF::nullopt; >+ time.tm_mday = (data[2] - '0') * 10 + (data[3] - '0'); >+ time.tm_hour = (data[4] - '0') * 10 + (data[5] - '0'); >+ time.tm_min = (data[6] - '0') * 10 + (data[7] - '0'); >+ >+ if ((ans1Time->length >= digitLength + 2) && isASCIIDigit(data[8]) && isASCIIDigit(data[9])) >+ time.tm_sec = (data[8] - '0') * 10 + (data[9] - '0'); >+ >+ return Seconds(mktime(&time)); >+} >+ >+static void getSubjectAltName(const OpenSSL::X509Ref& x509, Vector<String>& dnsNames, Vector<String>& ipAddresses) >+{ >+ OpenSSL::StackOfGeneralName sanList(x509, NID_subject_alt_name); >+ if (!sanList) >+ return; >+ >+ auto num = sanList.count(); >+ for (auto i = 0; i < num; i++) { >+ auto* value = sanList.item(i); >+ if (!value) >+ continue; >+ >+ if (value->type == GEN_DNS) { >+ OpenSSL::Ptr<uint8_t> dnsName; >+ int dnsLength = ASN1_STRING_to_UTF8(&dnsName, value->d.dNSName); >+ if (dnsLength >= 0 && dnsName) >+ dnsNames.append(String(dnsName, dnsLength)); >+ } else if (value->type == GEN_IPADD) { >+ auto data = value->d.iPAddress->data; >+ if (value->d.iPAddress->length == 4) { >+ char buf[256] { 0 }; >+ snprintf(buf, sizeof(buf), "%d.%d.%d.%d", data[0], data[1], data[2], data[3]); >+ ipAddresses.append(String(buf)); >+ } else if (value->d.iPAddress->length == 16) { >+ StringBuilder ipAddress; >+ char buf[256] { 0 }; >+ for (int i = 0; i < 8; i++) { >+ snprintf(buf, sizeof(buf), "%04X", data[0] << 8 | data[1]); >+ ipAddress.append(buf); >+ if (i != 7) >+ ipAddress.append(":"); >+ data += 2; >+ } >+ ipAddresses.append(ipAddress.toString()); >+ } >+ } >+ } >+} >+ >+Optional<CertificateInfo::SummaryInfo> CertificateInfo::summaryInfo() const >+{ >+ if (!m_certificateChain.size()) >+ return WTF::nullopt; >+ >+ OpenSSL::BIO bio { m_certificateChain.at(0) }; >+ auto x509 = bio.readX509(); >+ if (!x509) >+ return WTF::nullopt; >+ >+ SummaryInfo summaryInfo; >+ >+ if (auto commonName = getCommonName(*x509)) >+ summaryInfo.subject = WTFMove(*commonName); >+ else if (auto subjectName = getSubjectName(*x509)) >+ summaryInfo.subject = WTFMove(*subjectName); >+ >+ if (auto notBefore = convertASN1TimeToSeconds(X509_get0_notBefore(*x509))) >+ summaryInfo.validFrom = *notBefore; >+ >+ if (auto notAfter = convertASN1TimeToSeconds(X509_get0_notAfter(*x509))) >+ summaryInfo.validUntil = *notAfter; >+ >+ getSubjectAltName(*x509, summaryInfo.dnsNames, summaryInfo.ipAddresses); >+ >+ return summaryInfo; >+} >+ > } > > #endif >diff --git a/Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp b/Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp >index 8094b935998382eef413dc4a5eafb24e4eaf77ae..9f7b661e060e317c4eef7afb31b24bdb854601cc 100644 >--- a/Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp >+++ b/Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp >@@ -30,7 +30,7 @@ > #if USE(CURL) > #include "CurlContext.h" > #include "CurlSSLHandle.h" >-#include <openssl/ssl.h> >+#include "OpenSSLHelper.h" > > namespace WebCore { > >@@ -61,7 +61,7 @@ CurlSSLVerifier::CurlSSLVerifier(void* sslCtx) > SSL_CTX_set1_curves_list(ctx, curvesList.utf8().data()); > } > >-void CurlSSLVerifier::collectInfo(X509StoreCTX* ctx) >+void CurlSSLVerifier::collectInfo(OpenSSL::X509StoreCTX* ctx) > { > m_certificateInfo = CertificateInfo { X509_STORE_CTX_get_error(ctx), pemDataFromCtx(ctx) }; > >@@ -69,7 +69,7 @@ void CurlSSLVerifier::collectInfo(X509StoreCTX* ctx) > m_sslErrors = static_cast<int>(convertToSSLCertificateFlags(error)); > } > >-int CurlSSLVerifier::verifyCallback(int preverified, X509StoreCTX* ctx) >+int CurlSSLVerifier::verifyCallback(int preverified, OpenSSL::X509StoreCTX* ctx) > { > auto ssl = static_cast<SSL*>(X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx())); > auto sslCtx = SSL_get_SSL_CTX(ssl); >@@ -80,70 +80,21 @@ int CurlSSLVerifier::verifyCallback(int preverified, X509StoreCTX* ctx) > return preverified; > } > >-class StackOfX509 { >-public: >- explicit StackOfX509(X509StoreCTX* ctx) >- : m_certs { X509_STORE_CTX_get1_chain(ctx) } >- { >- } >- >- ~StackOfX509() >- { >- if (m_certs) >- sk_X509_pop_free(m_certs, X509_free); >- } >- >- unsigned count() { return sk_X509_num(m_certs); } >- X509* item(unsigned i) { return sk_X509_value(m_certs, i); } >- >-private: >- STACK_OF(X509)* m_certs { nullptr }; >-}; >- >-class BIOHolder { >-public: >- BIOHolder() >- : m_bio { BIO_new(BIO_s_mem()) } >- { >- } >- >- ~BIOHolder() >- { >- if (m_bio) >- BIO_free(m_bio); >- } >- >- bool write(X509* data) { return PEM_write_bio_X509(m_bio, data); } >- CertificateInfo::Certificate asCertificate() >- { >- uint8_t* data; >- long length = BIO_get_mem_data(m_bio, &data); >- if (length < 0) >- return CertificateInfo::Certificate(); >- >- auto cert = CertificateInfo::makeCertificate(data, length); >- return cert; >- } >- >-private: >- BIO* m_bio { nullptr }; >-}; >- >-static Vector<CertificateInfo::Certificate> pemDataFromCtx(X509StoreCTX* ctx) >+static Vector<CertificateInfo::Certificate> pemDataFromCtx(OpenSSL::X509StoreCTX* ctx) > { > Vector<CertificateInfo::Certificate> result; >- StackOfX509 certs { ctx }; >+ OpenSSL::StackOfX509 certs { ctx }; > for (int i = 0; i < certs.count(); i++) { >- BIOHolder bio; >+ OpenSSL::BIO bio; > > if (!bio.write(certs.item(i))) >- return Vector<CertificateInfo::Certificate> { }; >+ return { }; > >- auto certificate = bio.asCertificate(); >- if (certificate.isEmpty()) >- return Vector<CertificateInfo::Certificate> { }; >+ if (auto certificate = bio.getMemData()) >+ result.append(WTFMove(*certificate)); >+ else >+ return { }; > >- result.append(WTFMove(certificate)); > } > > return result; >diff --git a/Source/WebCore/platform/network/curl/OpenSSLHelper.h b/Source/WebCore/platform/network/curl/OpenSSLHelper.h >new file mode 100644 >index 0000000000000000000000000000000000000000..dbb7568dd058f67dbd90416d321e884a3b602216 >--- /dev/null >+++ b/Source/WebCore/platform/network/curl/OpenSSLHelper.h >@@ -0,0 +1,214 @@ >+/* >+ * Copyright (C) 2019 Sony Interactive Entertainment Inc. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <openssl/ssl.h> >+#include <openssl/x509v3.h> >+#include <wtf/optional.h> >+#include <wtf/vector.h> >+ >+struct x509_store_ctx_st; >+ >+namespace OpenSSL { >+ >+using X509StoreCTX = x509_store_ctx_st; >+ >+class X509Ref { >+public: >+ X509Ref(::X509* x509, bool isOwner = true) >+ : m_x509 { x509 } >+ , m_isOwner { isOwner } >+ { >+ } >+ >+ X509Ref(X509Ref&& other) >+ { >+ m_x509 = other.m_x509; >+ m_isOwner = other.m_isOwner; >+ other.m_x509 = nullptr; >+ } >+ >+ ~X509Ref() >+ { >+ if (m_x509 && m_isOwner) >+ ::X509_free(m_x509); >+ } >+ >+ operator const ::X509*() const { return m_x509; } >+ operator ::X509*() { return m_x509; } >+ >+ X509Ref() = delete; >+ X509Ref(const X509&) = delete; >+ >+private: >+ ::X509* m_x509 { nullptr }; >+ bool m_isOwner { true }; >+}; >+ >+class StackOfGeneralName { >+public: >+ StackOfGeneralName(const X509Ref& x509, int nid) >+ : m_name { static_cast<STACK_OF(GENERAL_NAME)*>(X509_get_ext_d2i(x509, nid, nullptr, nullptr)) } >+ { >+ } >+ >+ ~StackOfGeneralName() >+ { >+ if (m_name) >+ GENERAL_NAMES_free(m_name); >+ } >+ >+ operator bool() { return m_name; } >+ >+ int count() { return sk_GENERAL_NAME_num(m_name); } >+ GENERAL_NAME* item(int i) { return sk_GENERAL_NAME_value(m_name, i); } >+ >+private: >+ STACK_OF(GENERAL_NAME)* m_name { nullptr }; >+}; >+ >+class StackOfX509 { >+public: >+ explicit StackOfX509(X509StoreCTX* ctx) >+ : m_certs { X509_STORE_CTX_get1_chain(ctx) } >+ { >+ } >+ >+ ~StackOfX509() >+ { >+ if (m_certs) >+ sk_X509_pop_free(m_certs, X509_free); >+ } >+ >+ unsigned count() { return sk_X509_num(m_certs); } >+ X509Ref item(unsigned i) { return X509Ref { sk_X509_value(m_certs, i), false}; } >+ >+private: >+ STACK_OF(X509)* m_certs { nullptr }; >+}; >+ >+class BIO { >+public: >+ BIO() >+ : m_bio { ::BIO_new(::BIO_s_mem()) } >+ { >+ } >+ >+ BIO(const Vector<uint8_t>& data) >+ : m_bio { ::BIO_new_mem_buf(data.data(), data.size()) } >+ { >+ } >+ >+ ~BIO() >+ { >+ if (m_bio) >+ ::BIO_free(m_bio); >+ } >+ >+ bool write(X509* data) >+ { >+ return ::PEM_write_bio_X509(m_bio, data); >+ } >+ >+ Optional<X509Ref> readX509() >+ { >+ if (auto x509 = ::PEM_read_bio_X509(m_bio, nullptr, 0, nullptr)) >+ return { x509 }; >+ return WTF::nullopt; >+ } >+ >+ Optional<Vector<uint8_t>> getMemData() const >+ { >+ uint8_t* dataP; >+ auto length = ::BIO_get_mem_data(m_bio, &dataP); >+ if (length < 0) >+ return WTF::nullopt; >+ >+ Vector<uint8_t> data; >+ data.append(dataP, length); >+ return data; >+ } >+ >+ ::BIO* get() { return m_bio; } >+ >+private: >+ ::BIO* m_bio { nullptr }; >+}; >+ >+class BufMem { >+public: >+ BufMem() = default; >+ >+ ~BufMem() >+ { >+ if (m_bufMem) >+ BUF_MEM_free(m_bufMem); >+ } >+ >+ operator const BUF_MEM* () const { return m_bufMem; } >+ operator BUF_MEM* () { return m_bufMem; } >+ >+ BUF_MEM* get() { return m_bufMem; } >+ >+private: >+ BUF_MEM* m_bufMem { nullptr }; >+}; >+ >+template<typename T> >+class Ptr { >+public: >+ Ptr() = default; >+ >+ explicit Ptr(T* ptr) >+ : m_ptr { ptr } >+ { >+ } >+ >+ ~Ptr() >+ { >+ if (m_ptr) >+ OPENSSL_free(m_ptr); >+ } >+ >+ void adopt(T *ptr) >+ { >+ ASSERT(!m_ptr); >+ m_ptr = ptr; >+ } >+ >+ const T* get() const { return m_ptr; } >+ T* get() { return m_ptr; } >+ >+ operator const T*() const { return get(); } >+ operator T*() { return get(); } >+ operator bool() { return m_ptr; } >+ T** operator &() { return &m_ptr; } >+ >+private: >+ T* m_ptr { nullptr }; >+}; >+ >+} // namespace OpenSSL >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a913790ae79c2982e34eff2507434f111248c9e3..5671da3ce2691cdbdc66b4ad49065794b7db9728 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-07-08 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] implement CertificateInfo::summaryInfo >+ https://bugs.webkit.org/show_bug.cgi?id=191498 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/wincairo-wk1/TestExpectations: >+ * platform/wincairo/TestExpectations: >+ > 2019-07-08 Daniel Bates <dabates@apple.com> > > [iOS] Support select all in non-editable element >diff --git a/LayoutTests/platform/wincairo-wk1/TestExpectations b/LayoutTests/platform/wincairo-wk1/TestExpectations >index 5d10817a34a788c24bed01693a45db50fd791da3..6570820ef685a3173812465cdf0539ee9e008514 100644 >--- a/LayoutTests/platform/wincairo-wk1/TestExpectations >+++ b/LayoutTests/platform/wincairo-wk1/TestExpectations >@@ -340,3 +340,7 @@ fast/css/transition-color-unspecified.html [ Skip ] > fast/filter-image/filter-image-animation.html [ Skip ] > resize-observer/modify-frametree-in-callback.html [ Skip ] > resize-observer/multi-frames.html [ Skip ] >+ >+# WinCairo wk1 doesn't support inspector tests. >+webkit.org/b/191498 http/tests/inspector/network/resource-security-certificate.html [ Skip ] >+webkit.org/b/191498 http/tests/inspector/network/getSerializedCertificate.html [ Skip ] >diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations >index de683273755ac0ff285f256e2952a1b0c5077999..ffa6a6ba42efd2c4c5893f4d20effd0bb28293e7 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -1017,8 +1017,8 @@ http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.ht > http/tests/xmlviewer [ Skip ] > > webkit.org/b/192406 http/tests/inspector/network/resource-security-connection.html [ Skip ] >-webkit.org/b/191498 http/tests/inspector/network/resource-security-certificate.html [ Skip ] >-webkit.org/b/191498 http/tests/inspector/network/getSerializedCertificate.html [ Skip ] >+webkit.org/b/191498 http/tests/inspector/network/resource-security-certificate.html [ Pass ] >+webkit.org/b/191498 http/tests/inspector/network/getSerializedCertificate.html [ Pass ] > > #/////////////////////////////////////////////////////////////////////////////// > # Issue categories below are shared with other platforms (primarily AppleWin)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191498
:
373699
|
373889
|
374451
|
375068
|
375286
|
375520
|
375522