Changeset 238426 in webkit


Ignore:
Timestamp:
Nov 21, 2018 10:58:13 AM (5 years ago)
Author:
Claudio Saavedra
Message:

[SOUP] Follow-up robustness improvements to the certificate decoder
https://bugs.webkit.org/show_bug.cgi?id=191892

Reviewed by Michael Catanzaro.

If at any point the certificate fails to be constructed from
the DER data, bail out. Likewise, if the certificate returned
is NULL, return false from the decoder to notify the failure
to decode it.

  • platform/network/soup/CertificateInfo.h:

(WTF::Persistence::certificateFromCertificatesDataList):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238422 r238426  
     12018-11-21  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [SOUP] Follow-up robustness improvements to the certificate decoder
     4        https://bugs.webkit.org/show_bug.cgi?id=191892
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        If at any point the certificate fails to be constructed from
     9        the DER data, bail out. Likewise, if the certificate returned
     10        is NULL, return false from the decoder to notify the failure
     11        to decode it.
     12
     13        * platform/network/soup/CertificateInfo.h:
     14        (WTF::Persistence::certificateFromCertificatesDataList):
     15        (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
     16
    1172018-11-21  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/platform/network/soup/CertificateInfo.h

    r238417 r238426  
    120120        certificate = adoptGRef(G_TLS_CERTIFICATE(g_initable_new(
    121121            certificateType, nullptr, nullptr, "certificate", certificateData.get(), "issuer", certificate.get(), nullptr)));
     122        if (!certificate)
     123            break;
    122124    }
    123125
     
    146148        if (certificatesDataList.isEmpty())
    147149            return true;
    148         certificateInfo.setCertificate(certificateFromCertificatesDataList(certificatesDataList).get());
     150        auto certificate = certificateFromCertificatesDataList(certificatesDataList);
     151        if (!certificate)
     152            return false;
     153        certificateInfo.setCertificate(certificate.get());
    149154
    150155        uint32_t tlsErrors;
Note: See TracChangeset for help on using the changeset viewer.