Changeset 249436 in webkit


Ignore:
Timestamp:
Sep 3, 2019 11:56:10 AM (5 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
https://bugs.webkit.org/show_bug.cgi?id=201369
<rdar://problem/54903724>

Reviewed by Brent Fulgham.

Source/WebCore:

  • platform/RuntimeApplicationChecks.h:
  • platform/cocoa/RuntimeApplicationChecksCocoa.mm:

(WebCore::IOSApplication::isSafariViewService):
Adds a way to detect SafariViewService.

Source/WebKit:

Communications to security keys require entitlements, which are not guaranteed to be present in third party
WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.

  • Shared/WebPreferences.yaml:
  • Shared/WebPreferencesDefaultValues.cpp:

(WebKit::defaultWebAuthenticationEnabled):

  • Shared/WebPreferencesDefaultValues.h:

LayoutTests:

  • http/wpt/webauthn/public-key-credential-get-success-nfc.https.html:

Imporves the test a bit.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249431 r249436  
     12019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
     4        https://bugs.webkit.org/show_bug.cgi?id=201369
     5        <rdar://problem/54903724>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * http/wpt/webauthn/public-key-credential-get-success-nfc.https.html:
     10        Imporves the test a bit.
     11
    1122019-09-03  Antoine Quint  <graouts@apple.com>
    213
  • trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-nfc.https.html

    r249059 r249436  
    2626            publicKey: {
    2727                challenge: Base64URL.parse("MTIzNDU2"),
    28                 allowCredentials: [{ type: "public-key", id: Base64URL.parse(testU2fCredentialIdBase64) }],
     28                allowCredentials: [{ type: "public-key", id: Base64URL.parse(testU2fCredentialIdBase64), transports: ["nfc"] }],
    2929                timeout: 100
    3030            }
  • trunk/Source/WebCore/ChangeLog

    r249434 r249436  
     12019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
     4        https://bugs.webkit.org/show_bug.cgi?id=201369
     5        <rdar://problem/54903724>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * platform/RuntimeApplicationChecks.h:
     10        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
     11        (WebCore::IOSApplication::isSafariViewService):
     12        Adds a way to detect SafariViewService.
     13
    1142019-09-03  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r249140 r249436  
    8080WEBCORE_EXPORT bool isMailCompositionService();
    8181WEBCORE_EXPORT bool isMobileSafari();
     82WEBCORE_EXPORT bool isSafariViewService();
    8283WEBCORE_EXPORT bool isIMDb();
    8384WEBCORE_EXPORT bool isWebBookmarksD();
  • trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

    r249140 r249436  
    215215}
    216216
     217bool IOSApplication::isSafariViewService()
     218{
     219    static bool isSafariViewService = applicationBundleIsEqualTo("com.apple.SafariViewService"_s);
     220    return isSafariViewService;
     221}
     222
    217223bool IOSApplication::isIMDb()
    218224{
  • trunk/Source/WebKit/ChangeLog

    r249435 r249436  
     12019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
     4        https://bugs.webkit.org/show_bug.cgi?id=201369
     5        <rdar://problem/54903724>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Communications to security keys require entitlements, which are not guaranteed to be present in third party
     10        WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.
     11
     12        * Shared/WebPreferences.yaml:
     13        * Shared/WebPreferencesDefaultValues.cpp:
     14        (WebKit::defaultWebAuthenticationEnabled):
     15        * Shared/WebPreferencesDefaultValues.h:
     16
    1172019-09-03  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r248960 r249436  
    768768WebAuthenticationEnabled:
    769769  type: bool
    770   defaultValue: DEFAULT_WEB_AUTHENTICATION_ENABLED
     770  defaultValue: defaultWebAuthenticationEnabled()
    771771  humanReadableName: "Web Authentication"
    772772  humanReadableDescription: "Enable Web Authentication support"
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp

    r248697 r249436  
    7878#endif // ENABLE(TEXT_AUTOSIZING) && !PLATFORM(IOS_FAMILY)
    7979
     80bool defaultWebAuthenticationEnabled()
     81{
     82#if PLATFORM(IOS_FAMILY)
     83    return WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isSafariViewService();
     84#elif PLATFORM(MAC)
     85    return true;
     86#else
     87    return false;
     88#endif
     89}
     90
    8091} // namespace WebKit
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r248697 r249436  
    271271#endif
    272272
    273 #if PLATFORM(MAC)
    274 #define DEFAULT_WEB_AUTHENTICATION_ENABLED true
    275 #else
    276 #define DEFAULT_WEB_AUTHENTICATION_ENABLED false
    277 #endif
    278 
    279273namespace WebKit {
    280274
     
    287281#endif
    288282
     283bool defaultWebAuthenticationEnabled();
     284
    289285} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.