Changeset 223993 in webkit


Ignore:
Timestamp:
Oct 25, 2017 4:24:15 PM (7 years ago)
Author:
pvollan@apple.com
Message:

Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
https://bugs.webkit.org/show_bug.cgi?id=160234
rdar://problem/30675510

Reviewed by Geoffrey Garen.

An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
challenge sender, which does not implement this optional method. The methods on the authentication challenge
sender are deprecated when network session is used, so we should not call them in that case.

  • Shared/Authentication/AuthenticationManager.cpp:

(WebKit::AuthenticationManager::useCredentialForSingleChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
(WebKit::AuthenticationManager::cancelSingleChallenge):
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):

  • Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:

(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):

  • Shared/Authentication/soup/AuthenticationManagerSoup.cpp:
Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r223990 r223993  
     12017-10-25  Per Arne Vollan  <pvollan@apple.com>
     2
     3        Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
     4        https://bugs.webkit.org/show_bug.cgi?id=160234
     5        rdar://problem/30675510
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
     10        challenge sender, which does not implement this optional method. The methods on the authentication challenge
     11        sender are deprecated when network session is used, so we should not call them in that case.
     12
     13        * Shared/Authentication/AuthenticationManager.cpp:
     14        (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
     15        (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
     16        (WebKit::AuthenticationManager::cancelSingleChallenge):
     17        (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
     18        (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
     19        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
     20        (WebKit::AuthenticationManager::receivedCredential):
     21        (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
     22        (WebKit::AuthenticationManager::receivedCancellation):
     23        (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
     24        (WebKit::AuthenticationManager::receivedChallengeRejection):
     25        * Shared/Authentication/soup/AuthenticationManagerSoup.cpp:
     26
    1272017-10-25  Youenn Fablet  <youenn@apple.com>
    228
  • trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp

    r223431 r223993  
    227227        return;
    228228    }
     229    ASSERT(coreClient);
    229230#endif
    230231
    231232    if (coreClient)
    232233        coreClient->receivedCredential(challenge.challenge, credential);
     234#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    233235    else
    234236        receivedCredential(challenge.challenge, credential);
     237#endif
    235238}
    236239
     
    255258        return;
    256259    }
     260    ASSERT(coreClient);
    257261#endif
    258262
    259263    if (coreClient)
    260264        coreClient->receivedRequestToContinueWithoutCredential(challenge.challenge);
     265#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    261266    else
    262267        receivedRequestToContinueWithoutCredential(challenge.challenge);
     268#endif
    263269}
    264270
     
    283289        return;
    284290    }
     291    ASSERT(coreClient);
    285292#endif
    286293
    287294    if (coreClient)
    288295        coreClient->receivedCancellation(challenge.challenge);
     296#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    289297    else
    290298        receivedCancellation(challenge.challenge);
     299#endif
    291300}
    292301
     
    311320        return;
    312321    }
     322    ASSERT(coreClient);
    313323#endif
    314324
    315325    if (coreClient)
    316326        coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge);
     327#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    317328    else
    318329        receivedRequestToPerformDefaultHandling(challenge.challenge);
     330#endif
    319331}
    320332
     
    339351        return;
    340352    }
     353    ASSERT(coreClient);
    341354#endif
    342355
    343356    if (coreClient)
    344357        coreClient->receivedChallengeRejection(challenge.challenge);
     358#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    345359    else
    346360        receivedChallengeRejection(challenge.challenge);
     361#endif
    347362}
    348363
  • trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm

    r207585 r223993  
    2727#import "AuthenticationManager.h"
    2828
     29#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
    2930using namespace WebCore;
    3031
     
    3334void AuthenticationManager::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential)
    3435{
    35 #if !USE(CFURLCONNECTION)
    3636    [authenticationChallenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
    37 #endif
    3837}
    3938
    4039void AuthenticationManager::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge)
    4140{
    42 #if !USE(CFURLCONNECTION)
    4341    [authenticationChallenge.sender() continueWithoutCredentialForAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
    44 #endif
    4542}
    4643
    4744void AuthenticationManager::receivedCancellation(const AuthenticationChallenge& authenticationChallenge)
    4845{
    49 #if !USE(CFURLCONNECTION)
    5046    [authenticationChallenge.sender() cancelAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
    51 #endif
    5247}
    5348
    5449void AuthenticationManager::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge& authenticationChallenge)
    5550{
    56 #if !USE(CFURLCONNECTION)
    5751    [authenticationChallenge.sender() performDefaultHandlingForAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
    58 #endif
    5952}
    6053
    6154void AuthenticationManager::receivedChallengeRejection(const AuthenticationChallenge& authenticationChallenge)
    6255{
    63 #if !USE(CFURLCONNECTION)
    6456    [authenticationChallenge.sender() rejectProtectionSpaceAndContinueWithChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
    65 #endif
    6657}
    6758
    6859}
     60#endif
  • trunk/Source/WebKit/Shared/Authentication/soup/AuthenticationManagerSoup.cpp

    r196600 r223993  
    2727#include "AuthenticationManager.h"
    2828
     29#if !USE(NETWORK_SESSION)
    2930using namespace WebCore;
    3031
     
    5253
    5354}
     55#endif
Note: See TracChangeset for help on using the changeset viewer.