Changeset 175495 in webkit


Ignore:
Timestamp:
Nov 3, 2014, 4:17:25 PM (11 years ago)
Author:
mitz@apple.com
Message:

Client certificate credentials with session persistence don’t work
https://bugs.webkit.org/show_bug.cgi?id=138330

Reviewed by Alexey Proskuryakov.

I think this is not testable with our test HTTP server.

  • platform/network/CredentialStorage.cpp:

(WebCore::CredentialStorage::set): Don’t require a valid URL for client certificate
credentials, since they don’t apply to a specific path. Don’t save such credentials to
CFNetwork’s persistent storage (we only do that as a workaround for sharing credentials
with the media framework, and we don’t want to expand the scope of the workaround).

  • platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::ResourceHandle::receivedCredential): Changed to use the Credential consturctor
that takes a Credential and a new persistence, so that this code works not only with
user+password credentials.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175494 r175495  
     12014-11-03  Dan Bernstein  <mitz@apple.com>
     2
     3        Client certificate credentials with session persistence don’t work
     4        https://bugs.webkit.org/show_bug.cgi?id=138330
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        I think this is not testable with our test HTTP server.
     9
     10        * platform/network/CredentialStorage.cpp:
     11        (WebCore::CredentialStorage::set): Don’t require a valid URL for client certificate
     12        credentials, since they don’t apply to a specific path. Don’t save such credentials to
     13        CFNetwork’s persistent storage (we only do that as a workaround for sharing credentials
     14        with the media framework, and we don’t want to expand the scope of the workaround).
     15        * platform/network/cf/ResourceHandleCFNet.cpp:
     16        (WebCore::ResourceHandle::receivedCredential): Changed to use the Credential consturctor
     17        that takes a Credential and a new persistence, so that this code works not only with
     18        user+password credentials.
     19
    1202014-11-03  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/platform/network/CredentialStorage.cpp

    r165607 r175495  
    9494void CredentialStorage::set(const Credential& credential, const ProtectionSpace& protectionSpace, const URL& url)
    9595{
    96     ASSERT(protectionSpace.isProxy() || url.protocolIsInHTTPFamily());
    97     ASSERT(protectionSpace.isProxy() || url.isValid());
     96    ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.protocolIsInHTTPFamily());
     97    ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.isValid());
    9898
    9999    protectionSpaceToCredentialMap().set(protectionSpace, credential);
    100100
    101101#if PLATFORM(IOS)
    102     saveToPersistentStorage(protectionSpace, credential);
     102    if (protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested)
     103        saveToPersistentStorage(protectionSpace, credential);
    103104#endif
    104105
    105     if (!protectionSpace.isProxy()) {
     106    if (!protectionSpace.isProxy() && protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
    106107        originsWithCredentials().add(originStringFromURL(url));
    107108
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

    r174827 r175495  
    425425        // Manage per-session credentials internally, because once NSURLCredentialPersistencePerSession is used, there is no way
    426426        // to ignore it for a particular request (short of removing it altogether).
    427         Credential webCredential(credential.user(), credential.password(), CredentialPersistenceNone);
     427        Credential webCredential(credential, CredentialPersistenceNone);
    428428
    429429        URL urlToStore;
Note: See TracChangeset for help on using the changeset viewer.