WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-200932-20191021225039.patch (text/plain), 44.71 KB, created by
Jiewen Tan
on 2019-10-21 22:50:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jiewen Tan
Created:
2019-10-21 22:50:40 PDT
Size:
44.71 KB
patch
obsolete
>Subversion Revision: 251372 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1a52c1de72c37d9a18579e4fa2dc7e7b168bbfd6..60dd32e68b0c51f10154353a39ba740fd135bada 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-10-21 Jiewen Tan <jiewen_tan@apple.com> >+ >+ [WebAuthn] Warn users when multiple NFC tags present >+ https://bugs.webkit.org/show_bug.cgi?id=200932 >+ <rdar://problem/54890736> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by new tests in existing test file. >+ >+ * testing/MockWebAuthenticationConfiguration.h: >+ (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::encode const): >+ (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode): >+ * testing/MockWebAuthenticationConfiguration.idl: >+ Adds a new test option. >+ > 2019-10-21 Simon Fraser <simon.fraser@apple.com> > > [iOS WK2] Support hiding iframe scrollbars via ::-webkit-scrollbar style >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e41de38c7056c3c3a7773b672eaba4c66f04ad07..a66f015d9b6befc5d9f116c4758c706086a87aa7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,76 @@ >+2019-10-21 Jiewen Tan <jiewen_tan@apple.com> >+ >+ [WebAuthn] Warn users when multiple NFC tags present >+ https://bugs.webkit.org/show_bug.cgi?id=200932 >+ <rdar://problem/54890736> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch utilizes -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] to >+ inform clients about multiple physical tags are presenting such that clients can instruct users >+ to select only one of them physically. Given a physical tag could have multiple different >+ interfaces, which NearField will treat them into different NFTags, the tagID is then used to >+ identify if there are actually multiple physical tags. >+ >+ This patch also adds the ability to restart polling of a partiuclar NFReaderSession to NfcConnection >+ and the ability to restart the whole session to NfcService. The former is used to recover from errors >+ in the discovery stages, and the latter is used to recover from errors returned from authenticators >+ in the request stages. For the latter, given NfcConnection is not awared of the syntax of FIDO2/U2F >+ protocol, and CtapAuthenticator/U2fAuthenticator are not awared the transport of the underneath driver. >+ A generic restartDiscovery process is added to each service and it is up to the actual service to >+ implement the actual process such that AuthenticatorManager can arbitrarily call it after exceptions >+ are returned to restart the whole NFC session. To achieve restartDiscovery, NfcConnection is made >+ RefCounted as well such that both the NfcService and the CtapNfcDriver could hold it at the same time. >+ CtapNfcDriver uses the connection to complete requests as before while NfcService has the new capability >+ to use it to stop the current session when restartDiscovery kicks off. >+ >+ * Platform/spi/Cocoa/NearFieldSPI.h: >+ * UIProcess/WebAuthentication/AuthenticatorManager.cpp: >+ (WebKit::AuthenticatorManager::serviceStatusUpdated): >+ (WebKit::AuthenticatorManager::respondReceived): >+ (WebKit::AuthenticatorManager::restartDiscovery): >+ * UIProcess/WebAuthentication/AuthenticatorManager.h: >+ * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: >+ (WebKit::AuthenticatorTransportService::startDiscovery): >+ (WebKit::AuthenticatorTransportService::restartDiscovery): >+ * UIProcess/WebAuthentication/AuthenticatorTransportService.h: >+ (WebKit::AuthenticatorTransportService::restartDiscoveryInternal): >+ * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: >+ * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: >+ (WebKit::NfcConnection::create): >+ (WebKit::NfcConnection::NfcConnection): >+ (WebKit::NfcConnection::~NfcConnection): >+ (WebKit::NfcConnection::stop const): >+ (WebKit::NfcConnection::didDetectTags): >+ (WebKit::NfcConnection::restartPolling): >+ (WebKit::NfcConnection::startPolling): >+ (WebKit::NfcConnection::didDetectTags const): Deleted. >+ * UIProcess/WebAuthentication/Cocoa/NfcService.h: >+ * UIProcess/WebAuthentication/Cocoa/NfcService.mm: >+ (WebKit::NfcService::NfcService): >+ (WebKit::NfcService::didConnectTag): >+ (WebKit::NfcService::didDetectMultipleTags const): >+ (WebKit::NfcService::setConnection): >+ (WebKit::NfcService::restartDiscoveryInternal): >+ (WebKit::NfcService::platformStartDiscovery): >+ (WebKit::NfcService::setDriver): Deleted. >+ * UIProcess/WebAuthentication/Mock/MockNfcService.h: >+ * UIProcess/WebAuthentication/Mock/MockNfcService.mm: >+ (-[WKMockNFTag tagID]): >+ (-[WKMockNFTag initWithNFTag:]): >+ (-[WKMockNFTag dealloc]): >+ (-[WKMockNFTag initWithType:]): >+ (-[WKMockNFTag initWithType:tagID:]): >+ (WebKit::MockNfcService::receiveStopPolling): >+ (WebKit::MockNfcService::receiveStartPolling): >+ (WebKit::MockNfcService::platformStartDiscovery): >+ (WebKit::MockNfcService::detectTags): >+ (WebKit::MockNfcService::detectTags const): Deleted. >+ * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: >+ (WebKit::CtapNfcDriver::CtapNfcDriver): >+ * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: >+ * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: >+ > 2019-10-21 Chris Dumez <cdumez@apple.com> > > Add more release logging for "Unexpectedly resumed" assertion >diff --git a/Source/WebCore/testing/MockWebAuthenticationConfiguration.h b/Source/WebCore/testing/MockWebAuthenticationConfiguration.h >index eb381cba315b255016b57e99fd275d69a86fb6d3..328bb9d4eaafc75d83c71a7c7274d1650367d20b 100644 >--- a/Source/WebCore/testing/MockWebAuthenticationConfiguration.h >+++ b/Source/WebCore/testing/MockWebAuthenticationConfiguration.h >@@ -93,6 +93,7 @@ struct MockWebAuthenticationConfiguration { > NfcError error { NfcError::Success }; > Vector<String> payloadBase64; > bool multipleTags { false }; >+ bool multiplePhysicalTags { false }; > > template<class Encoder> void encode(Encoder&) const; > template<class Decoder> static Optional<NfcConfiguration> decode(Decoder&); >@@ -193,7 +194,7 @@ Optional<MockWebAuthenticationConfiguration::HidConfiguration> MockWebAuthentica > template<class Encoder> > void MockWebAuthenticationConfiguration::NfcConfiguration::encode(Encoder& encoder) const > { >- encoder << error << payloadBase64 << multipleTags; >+ encoder << error << payloadBase64 << multipleTags << multiplePhysicalTags; > } > > template<class Decoder> >@@ -206,6 +207,8 @@ Optional<MockWebAuthenticationConfiguration::NfcConfiguration> MockWebAuthentica > return WTF::nullopt; > if (!decoder.decode(result.multipleTags)) > return WTF::nullopt; >+ if (!decoder.decode(result.multiplePhysicalTags)) >+ return WTF::nullopt; > return result; > } > >diff --git a/Source/WebCore/testing/MockWebAuthenticationConfiguration.idl b/Source/WebCore/testing/MockWebAuthenticationConfiguration.idl >index 16470f92729dbaa2a9152a056b7f8c5f745cc38d..7853851476fccd62284c36bf27942a8b17c5de10 100644 >--- a/Source/WebCore/testing/MockWebAuthenticationConfiguration.idl >+++ b/Source/WebCore/testing/MockWebAuthenticationConfiguration.idl >@@ -100,4 +100,5 @@ > MockNfcError error = "success"; > sequence<DOMString> payloadBase64; > boolean multipleTags = false; >+ boolean multiplePhysicalTags = false; > }; >diff --git a/Source/WebKit/Platform/spi/Cocoa/NearFieldSPI.h b/Source/WebKit/Platform/spi/Cocoa/NearFieldSPI.h >index 6bcbaa549e781e9ac9fc1bbd0edb13dcdb3f249f..e206a36bfe1728e6f6987a4e8b86159575496fea 100644 >--- a/Source/WebKit/Platform/spi/Cocoa/NearFieldSPI.h >+++ b/Source/WebKit/Platform/spi/Cocoa/NearFieldSPI.h >@@ -93,12 +93,11 @@ typedef NS_ENUM(uint32_t, NFNdefAvailability) { > @interface NFReaderSession : NFSession > @property (assign) id<NFReaderSessionDelegate> delegate; > >-- (BOOL)startPolling; >+- (BOOL)startPollingWithError:(NSError **)outError; > - (BOOL)stopPolling; > - (BOOL)connectTag:(NFTag*)tag; > - (BOOL)disconnectTag; > - (NSData*)transceive:(NSData*)capdu; >-- (NSError *)updateUIAlertMessage:(NSString *)message; > @end > > @protocol NFReaderSessionDelegate <NSObject> >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >index 4c819eaaa1154961ca17edf22003cdd7525b5fed..62891f42e0ce22208e464047f727a4cd4e8c4089 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >@@ -213,6 +213,12 @@ void AuthenticatorManager::authenticatorAdded(Ref<Authenticator>&& authenticator > ASSERT_UNUSED(addResult, addResult.isNewEntry); > } > >+void AuthenticatorManager::serviceStatusUpdated(WebAuthenticationStatus status) >+{ >+ if (auto *panel = m_pendingRequestData.panel.get()) >+ panel->client().updatePanel(status); >+} >+ > void AuthenticatorManager::respondReceived(Respond&& respond) > { > ASSERT(RunLoop::isMain()); >@@ -230,6 +236,7 @@ void AuthenticatorManager::respondReceived(Respond&& respond) > return; > } > respondReceivedInternal(WTFMove(respond)); >+ restartDiscovery(); > } > > void AuthenticatorManager::downgrade(Authenticator* id, Ref<Authenticator>&& downgradedAuthenticator) >@@ -341,6 +348,12 @@ void AuthenticatorManager::resetState() > m_pendingRequestData = { }; > } > >+void AuthenticatorManager::restartDiscovery() >+{ >+ for (auto& service : m_services) >+ service->restartDiscovery(); >+} >+ > } // namespace WebKit > > #endif // ENABLE(WEB_AUTHN) >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >index 494a44dc1d0c1827d0ec5dc0241d0c9f0fb2abbd..3628d598ff55cae56c3d57895bed4640df6fccec 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >@@ -73,6 +73,7 @@ protected: > private: > // AuthenticatorTransportService::Observer > void authenticatorAdded(Ref<Authenticator>&&) final; >+ void serviceStatusUpdated(WebAuthenticationStatus) final; > > // Authenticator::Observer > void respondReceived(Respond&&) final; >@@ -90,6 +91,7 @@ private: > void runPanel(); > void startRequest(); > void resetState(); >+ void restartDiscovery(); > > // Request: We only allow one request per time. A new request will cancel any pending ones. > WebAuthenticationRequestData m_pendingRequestData; >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.cpp b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.cpp >index e81039b6dcb40c56255d77f4defde96f1e4d4ef6..ed1759e73a30564e2a49628e2444706b378a38b3 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.cpp >@@ -75,7 +75,6 @@ AuthenticatorTransportService::AuthenticatorTransportService(Observer& observer) > > void AuthenticatorTransportService::startDiscovery() > { >- // Enforce asynchronous execution of makeCredential. > RunLoop::main().dispatch([weakThis = makeWeakPtr(*this)] { > if (!weakThis) > return; >@@ -83,6 +82,15 @@ void AuthenticatorTransportService::startDiscovery() > }); > } > >+void AuthenticatorTransportService::restartDiscovery() >+{ >+ RunLoop::main().dispatch([weakThis = makeWeakPtr(*this)] { >+ if (!weakThis) >+ return; >+ weakThis->restartDiscoveryInternal(); >+ }); >+} >+ > } // namespace WebKit > > #endif // ENABLE(WEB_AUTHN) >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h >index 09084ab8a7c79090517f2e72eb7a546d9ad26ea3..8cbd100edbb38ea366d337d30465132bcd0fe89c 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h >@@ -27,6 +27,7 @@ > > #if ENABLE(WEB_AUTHN) > >+#include "WebAuthenticationFlags.h" > #include <WebCore/AuthenticatorTransport.h> > #include <wtf/UniqueRef.h> > #include <wtf/WeakPtr.h> >@@ -48,6 +49,7 @@ public: > virtual ~Observer() = default; > > virtual void authenticatorAdded(Ref<Authenticator>&&) = 0; >+ virtual void serviceStatusUpdated(WebAuthenticationStatus) = 0; > }; > > static UniqueRef<AuthenticatorTransportService> create(WebCore::AuthenticatorTransport, Observer&); >@@ -55,8 +57,9 @@ public: > > virtual ~AuthenticatorTransportService() = default; > >- // This operation is guaranteed to execute asynchronously. >+ // These operation are guaranteed to execute asynchronously. > void startDiscovery(); >+ void restartDiscovery(); > > protected: > explicit AuthenticatorTransportService(Observer&); >@@ -65,6 +68,9 @@ protected: > > private: > virtual void startDiscoveryInternal() = 0; >+ // NFC service's polling is one shot. It halts after the first tags are detected. >+ // Therefore, a restart process is needed to resume polling after exceptions. >+ virtual void restartDiscoveryInternal() { }; > > WeakPtr<Observer> m_observer; > }; >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.h b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.h >index 3b9d9577e205aab7db7a3ab1e559b97dc3e9245f..b8a917ead0a0b8ae7473246e38713c176e961e83 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.h >@@ -27,9 +27,9 @@ > > #if ENABLE(WEB_AUTHN) && HAVE(NEAR_FIELD) > >-#include <wtf/FastMalloc.h> >-#include <wtf/Noncopyable.h> >+#include <wtf/RefCounted.h> > #include <wtf/RetainPtr.h> >+#include <wtf/RunLoop.h> > #include <wtf/WeakPtr.h> > > OBJC_CLASS NFReaderSession; >@@ -40,22 +40,27 @@ namespace WebKit { > > class NfcService; > >-class NfcConnection : public CanMakeWeakPtr<NfcConnection> { >- WTF_MAKE_FAST_ALLOCATED; >- WTF_MAKE_NONCOPYABLE(NfcConnection); >+class NfcConnection : public RefCounted<NfcConnection>, public CanMakeWeakPtr<NfcConnection> { > public: >- NfcConnection(RetainPtr<NFReaderSession>&&, NfcService&); >+ static Ref<NfcConnection> create(RetainPtr<NFReaderSession>&&, NfcService&); > ~NfcConnection(); > > Vector<uint8_t> transact(Vector<uint8_t>&& data) const; >+ void stop() const; > > // For WKNFReaderSessionDelegate >- void didDetectTags(NSArray *) const; >+ void didDetectTags(NSArray *); > > private: >+ NfcConnection(RetainPtr<NFReaderSession>&&, NfcService&); >+ >+ void restartPolling(); >+ void startPolling(); >+ > RetainPtr<NFReaderSession> m_session; > RetainPtr<WKNFReaderSessionDelegate> m_delegate; > WeakPtr<NfcService> m_service; >+ RunLoop::Timer<NfcConnection> m_retryTimer; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.mm >index 3246ee74976e9a80fe6a3d4467e5c7f50101fa42..8ed71ee6f241a7458c0f605d3ed8a1d4db556aa7 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.mm >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcConnection.mm >@@ -45,20 +45,24 @@ inline bool compareVersion(NSData *data, const uint8_t version[], size_t version > } > } // namespace > >+Ref<NfcConnection> NfcConnection::create(RetainPtr<NFReaderSession>&& session, NfcService& service) >+{ >+ return adoptRef(*new NfcConnection(WTFMove(session), service)); >+} >+ > NfcConnection::NfcConnection(RetainPtr<NFReaderSession>&& session, NfcService& service) > : m_session(WTFMove(session)) > , m_delegate(adoptNS([[WKNFReaderSessionDelegate alloc] initWithConnection:*this])) > , m_service(makeWeakPtr(service)) >+ , m_retryTimer(RunLoop::main(), this, &NfcConnection::startPolling) > { > [m_session setDelegate:m_delegate.get()]; >- [m_session startPolling]; >+ startPolling(); > } > > NfcConnection::~NfcConnection() > { >- [m_session disconnectTag]; >- [m_session stopPolling]; >- [m_session endSession]; >+ stop(); > } > > Vector<uint8_t> NfcConnection::transact(Vector<uint8_t>&& data) const >@@ -71,16 +75,33 @@ Vector<uint8_t> NfcConnection::transact(Vector<uint8_t>&& data) const > return response; > } > >-void NfcConnection::didDetectTags(NSArray *tags) const >+void NfcConnection::stop() const >+{ >+ [m_session disconnectTag]; >+ [m_session stopPolling]; >+ [m_session endSession]; >+} >+ >+void NfcConnection::didDetectTags(NSArray *tags) > { >- if (!m_service) >+ if (!m_service || !tags.count) > return; > >- // FIXME(200932): Warn users when multiple NFC tags present >- for (NFTag *tag in tags) { >- if (tag.type != NFTagTypeGeneric4A) >+ // A physical NFC tag could have multiple interfaces. >+ // Therefore, we use tagID to detect if there are multiple physical tags. >+ NSData *tagID = ((NFTag *)tags[0]).tagID; >+ for (NFTag *tag : tags) { >+ if ([tagID isEqualToData:tag.tagID]) > continue; >- if (![m_session connectTag:tag]) >+ m_service->didDetectMultipleTags(); >+ restartPolling(); >+ return; >+ } >+ >+ // FIXME(203234): Tell users to switch to a different tag if the tag is not of type NFTagTypeGeneric4A >+ // or can't speak U2F/FIDO2. >+ for (NFTag *tag : tags) { >+ if (tag.type != NFTagTypeGeneric4A || ![m_session connectTag:tag]) > continue; > > // Confirm the FIDO applet is avaliable before return. >@@ -94,8 +115,25 @@ void NfcConnection::didDetectTags(NSArray *tags) const > } > > m_service->didConnectTag(); >- break; >+ return; > } >+ restartPolling(); >+} >+ >+// NearField polling is a one shot polling. It halts after tags are detected. >+// Therefore, a restart process is needed to resume polling after error. >+void NfcConnection::restartPolling() >+{ >+ [m_session stopPolling]; >+ m_retryTimer.startOneShot(1_s); // Magic number to give users enough time for reactions. >+} >+ >+void NfcConnection::startPolling() >+{ >+ NSError *error = nil; >+ [m_session startPollingWithError:&error]; >+ if (error) >+ LOG_ERROR("Couldn't start NFC reader polling: %@", error); > } > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.h b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.h >index 3728019471895f3d75555b9da4858467c7e68fe3..2150344c1f6205c3c6785aee76c04bce5fc700b6 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.h >@@ -28,12 +28,13 @@ > #if ENABLE(WEB_AUTHN) > > #include "FidoService.h" >+#include <wtf/RunLoop.h> > > OBJC_CLASS NFReaderSession; > > namespace WebKit { > >-class CtapNfcDriver; >+class NfcConnection; > > class NfcService : public FidoService { > public: >@@ -42,15 +43,16 @@ public: > > // For NfcConnection. > void didConnectTag(); >+ void didDetectMultipleTags() const; > > #if HAVE(NEAR_FIELD) > protected: >- void setDriver(std::unique_ptr<CtapNfcDriver>&&); >+ void setConnection(Ref<NfcConnection>&&); // For MockNfcConnection > #endif > > private: > void startDiscoveryInternal() final; >- void continueAddDeviceAfterGetInfo(Vector<uint8_t>&& response); >+ void restartDiscoveryInternal() final; > > // Overrided by MockNfcService. > virtual void platformStartDiscovery(); >@@ -58,8 +60,9 @@ private: > #if HAVE(NEAR_FIELD) > // Only one reader session is allowed per time. > // Keep the reader session alive here when it tries to connect to a tag. >- std::unique_ptr<CtapNfcDriver> m_driver; >+ RefPtr<NfcConnection> m_connection; > #endif >+ RunLoop::Timer<NfcService> m_restartTimer; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.mm >index 752d788d3b52369d04908b0686314425aef24e65..58327b22ffce507bca04e4e814899516fef46c57 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.mm >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/NfcService.mm >@@ -41,6 +41,7 @@ namespace WebKit { > > NfcService::NfcService(Observer& observer) > : FidoService(observer) >+ , m_restartTimer(RunLoop::main(), this, &NfcService::platformStartDiscovery) > { > } > >@@ -51,14 +52,22 @@ NfcService::~NfcService() > void NfcService::didConnectTag() > { > #if HAVE(NEAR_FIELD) >- getInfo(WTFMove(m_driver)); >+ auto connection = m_connection; >+ ASSERT(connection); >+ getInfo(WTF::makeUnique<CtapNfcDriver>(connection.releaseNonNull())); > #endif > } > >+void NfcService::didDetectMultipleTags() const >+{ >+ if (auto* observer = this->observer()) >+ observer->serviceStatusUpdated(WebAuthenticationStatus::MultipleNFCTagsPresent); >+} >+ > #if HAVE(NEAR_FIELD) >-void NfcService::setDriver(std::unique_ptr<CtapNfcDriver>&& driver) >+void NfcService::setConnection(Ref<NfcConnection>&& connection) > { >- m_driver = WTFMove(driver); >+ m_connection = WTFMove(connection); > } > #endif > >@@ -67,6 +76,15 @@ void NfcService::startDiscoveryInternal() > platformStartDiscovery(); > } > >+void NfcService::restartDiscoveryInternal() >+{ >+#if HAVE(NEAR_FIELD) >+ if (m_connection) >+ m_connection->stop(); >+#endif >+ m_restartTimer.startOneShot(1_s); // Magic number to give users enough time for reactions. >+} >+ > void NfcService::platformStartDiscovery() > { > #if HAVE(NEAR_FIELD) >@@ -87,8 +105,8 @@ void NfcService::platformStartDiscovery() > return; > } > >- // CtapNfcDriver and NfcConnection will take care of polling tags and connecting to them. >- m_driver = WTF::makeUnique<CtapNfcDriver>(makeUniqueRef<NfcConnection>(WTFMove(session), *this)); >+ // NfcConnection will take care of polling tags and connecting to them. >+ m_connection = NfcConnection::create(WTFMove(session), *this); > }); > }); > [[getNFHardwareManagerClass() sharedHardwareManager] startReaderSession:callback.get()]; >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.h b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.h >index 9fd1c9b410b8232b4d35e0e12867fd3646d566ba..31762b14f5cc8034a23dfa4afaa74ebf781218fa 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.h >@@ -39,11 +39,13 @@ public: > MockNfcService(Observer&, const WebCore::MockWebAuthenticationConfiguration&); > > NSData* transceive(); >+ void receiveStopPolling(); >+ void receiveStartPolling(); > > private: > void platformStartDiscovery() final; > >- void detectTags() const; >+ void detectTags(); > > WebCore::MockWebAuthenticationConfiguration m_configuration; > }; >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.mm b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.mm >index ca522c5e3a3d28d420558372b1571f713e37d1c9..c30858fbed8691da31cac707f7e173c904ff3dbe 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.mm >+++ b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockNfcService.mm >@@ -38,20 +38,26 @@ > > #import "NearFieldSoftLink.h" > >+namespace { >+uint8_t tagID1[] = { 0x01 }; >+uint8_t tagID2[] = { 0x02 }; >+} >+ > #if HAVE(NEAR_FIELD) > > @interface WKMockNFTag : NSObject <NFTag> > > - (instancetype)initWithType:(NFTagType)type; >+- (instancetype)initWithType:(NFTagType)type tagID:(NSData *)tagID; > > @end > > @implementation WKMockNFTag { > NFTagType _type; >+ RetainPtr<NSData> _tagID; > } > > @synthesize technology=_technology; >-@synthesize tagID=_tagID; > @synthesize AppData=_AppData; > @synthesize UID=_UID; > @synthesize ndefAvailability=_ndefAvailability; >@@ -66,17 +72,22 @@ - (NFTagType)type > return _type; > } > >+- (NSData *)tagID >+{ >+ return _tagID.get(); >+} >+ > - (instancetype)initWithNFTag:(id<NFTag>)tag > { >- if ((self = [super init])) >+ if ((self = [super init])) { > _type = tag.type; >+ _tagID = tag.tagID; >+ } > return self; > } > > - (void)dealloc > { >- [_tagID release]; >- _tagID = nil; > [_AppData release]; > _AppData = nil; > [_UID release]; >@@ -97,8 +108,15 @@ - (BOOL)isEqualToNFTag:(id<NFTag>)tag > > - (instancetype)initWithType:(NFTagType)type > { >- if ((self = [super init])) >+ return [self initWithType:type tagID:adoptNS([[NSData alloc] initWithBytes:tagID1 length:sizeof(tagID1)]).get()]; >+} >+ >+- (instancetype)initWithType:(NFTagType)type tagID:(NSData *)tagID >+{ >+ if ((self = [super init])) { > _type = type; >+ _tagID = tagID; >+ } > return self; > } > >@@ -132,6 +150,22 @@ static BOOL NFReaderSessionConnectTag(id, SEL, NFTag *) > return YES; > } > >+static BOOL NFReaderSessionStopPolling(id, SEL) >+{ >+ if (!globalNfcService) >+ return NO; >+ globalNfcService->receiveStopPolling(); >+ return YES; >+} >+ >+static BOOL NFReaderSessionStartPollingWithError(id, SEL, NSError **) >+{ >+ if (!globalNfcService) >+ return NO; >+ globalNfcService->receiveStartPolling(); >+ return YES; >+} >+ > static NSData* NFReaderSessionTransceive(id, SEL, NSData *) > { > if (!globalNfcService) >@@ -159,6 +193,21 @@ NSData* MockNfcService::transceive() > return [result autorelease]; > } > >+void MockNfcService::receiveStopPolling() >+{ >+ // For purpose of restart polling. >+ m_configuration.nfc->multiplePhysicalTags = false; >+} >+ >+void MockNfcService::receiveStartPolling() >+{ >+ RunLoop::main().dispatch([weakThis = makeWeakPtr(*this)] { >+ if (!weakThis) >+ return; >+ weakThis->detectTags(); >+ }); >+} >+ > void MockNfcService::platformStartDiscovery() > { > #if HAVE(NEAR_FIELD) >@@ -177,21 +226,20 @@ void MockNfcService::platformStartDiscovery() > Method methodToSwizzle3 = class_getInstanceMethod(getNFReaderSessionClass(), @selector(transceive:)); > method_setImplementation(methodToSwizzle3, (IMP)NFReaderSessionTransceive); > >- auto readerSession = adoptNS([allocNFReaderSessionInstance() init]); >- setDriver(WTF::makeUnique<CtapNfcDriver>(makeUniqueRef<NfcConnection>(readerSession.get(), *this))); >+ Method methodToSwizzle4 = class_getInstanceMethod(getNFReaderSessionClass(), @selector(stopPolling)); >+ method_setImplementation(methodToSwizzle4, (IMP)NFReaderSessionStopPolling); > >- RunLoop::main().dispatch([weakThis = makeWeakPtr(*this)] { >- if (!weakThis) >- return; >- weakThis->detectTags(); >- }); >- return; >+ Method methodToSwizzle5 = class_getInstanceMethod(getNFReaderSessionClass(), @selector(startPollingWithError:)); >+ method_setImplementation(methodToSwizzle5, (IMP)NFReaderSessionStartPollingWithError); >+ >+ auto readerSession = adoptNS([allocNFReaderSessionInstance() init]); >+ setConnection(NfcConnection::create(readerSession.get(), *this)); > } > LOG_ERROR("No nfc authenticators is available."); > #endif // HAVE(NEAR_FIELD) > } > >-void MockNfcService::detectTags() const >+void MockNfcService::detectTags() > { > #if HAVE(NEAR_FIELD) > if (m_configuration.nfc->error == Mock::NfcError::NoTags) >@@ -207,6 +255,9 @@ void MockNfcService::detectTags() const > if (configuration.nfc->multipleTags) > [tags addObject:adoptNS([[WKMockNFTag alloc] initWithType:NFTagTypeGeneric4A]).get()]; > >+ if (configuration.nfc->multiplePhysicalTags) >+ [tags addObject:adoptNS([[WKMockNFTag alloc] initWithType:NFTagTypeGeneric4A tagID:adoptNS([[NSData alloc] initWithBytes:tagID2 length:sizeof(tagID2)]).get()]).get()]; >+ > [globalNFReaderSessionDelegate readerSession:nil didDetectTags:tags.get()]; > }); > dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), callback.get()); >diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp >index 0f6a791cead9bfec599cb6d691f28980dc103117..4a9caf2030f7667328c80c5ca9b3205d24ae54b4 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp >@@ -36,7 +36,7 @@ namespace WebKit { > using namespace apdu; > using namespace fido; > >-CtapNfcDriver::CtapNfcDriver(UniqueRef<NfcConnection>&& connection) >+CtapNfcDriver::CtapNfcDriver(Ref<NfcConnection>&& connection) > : m_connection(WTFMove(connection)) > { > } >diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.h b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.h >index e6d129e74e48110eb7c8d0a59cdf24474fa30635..359daaf81dcf0471ae44827283577328ceaf1adf 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapNfcDriver.h >@@ -37,14 +37,14 @@ namespace WebKit { > // https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#nfc > class CtapNfcDriver : public CtapDriver { > public: >- explicit CtapNfcDriver(UniqueRef<NfcConnection>&&); >+ explicit CtapNfcDriver(Ref<NfcConnection>&&); > > void transact(Vector<uint8_t>&& data, ResponseCallback&&) final; > > private: > void respondAsync(ResponseCallback&&, Vector<uint8_t>&& response) const; > >- UniqueRef<NfcConnection> m_connection; >+ Ref<NfcConnection> m_connection; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp b/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp >index 7936c5b2ec2ab5fe602e0d228262c751724e92ff..9d3bda52a5eb14b95eac1f554573966e3a28e35f 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp >@@ -33,7 +33,6 @@ > #include <WebCore/ExceptionData.h> > #include <WebCore/U2fCommandConstructor.h> > #include <WebCore/U2fResponseConverter.h> >-#include <wtf/RunLoop.h> > #include <wtf/text/StringConcatenateNumbers.h> > > namespace WebKit { >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 42393ffc4ff8b32caee60158ee91450a23af47e8..466005c7238275039ba08ab91db0df9a2721c0e2 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2019-10-21 Jiewen Tan <jiewen_tan@apple.com> >+ >+ [WebAuthn] Warn users when multiple NFC tags present >+ https://bugs.webkit.org/show_bug.cgi?id=200932 >+ <rdar://problem/54890736> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: >+ (-[TestWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:]): >+ (TestWebKitAPI::TEST): >+ Adds a new test for -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:]. >+ * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-nfc-multiple-tags.html: Added. >+ > 2019-10-18 Aakash Jain <aakash_jain@apple.com> > > EWS should have a way to retry a patch >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index b80e82440ede5aa73aa2a88355c3e9e7162f37f8..e794d8d40c5d1cace1ead0ba7914ad12ee5f1db1 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -350,6 +350,7 @@ > 579651E7216BFDED006EBFE5 /* FidoHidMessageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 579651E6216BFD53006EBFE5 /* FidoHidMessageTest.cpp */; }; > 5797FE311EB15A6800B2F4A0 /* NavigationClientDefaultCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5797FE2F1EB15A5F00B2F4A0 /* NavigationClientDefaultCrypto.cpp */; }; > 5797FE331EB15AB100B2F4A0 /* navigation-client-default-crypto.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5797FE321EB15A8900B2F4A0 /* navigation-client-default-crypto.html */; }; >+ 5798337C235EB689008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5798337B235EB65C008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html */; }; > 57A79857224AB34E00A7F6F1 /* WebCryptoMasterKey.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57A79856224AB34E00A7F6F1 /* WebCryptoMasterKey.mm */; }; > 57C3FA661F7C248F009D4B80 /* WeakPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CB9BC371A67482300FE5678 /* WeakPtr.cpp */; }; > 57C6244E2346BCFA00383FE7 /* _WKWebAuthenticationPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57C6244D2346BCFA00383FE7 /* _WKWebAuthenticationPanel.mm */; }; >@@ -1449,6 +1450,7 @@ > 57663DF32357E48900E85E09 /* web-authentication-get-assertion-hid-cancel.html in Copy Resources */, > 577454D02359B378008E1ED7 /* web-authentication-get-assertion-hid-no-credentials.html in Copy Resources */, > 57663DEC234F1F9300E85E09 /* web-authentication-get-assertion-hid.html in Copy Resources */, >+ 5798337C235EB689008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html in Copy Resources */, > 57663DEA234EA66D00E85E09 /* web-authentication-get-assertion-nfc.html in Copy Resources */, > 577454D22359BB01008E1ED7 /* web-authentication-get-assertion-u2f-no-credentials.html in Copy Resources */, > 57C624502346C21E00383FE7 /* web-authentication-get-assertion.html in Copy Resources */, >@@ -1884,6 +1886,7 @@ > 579651E6216BFD53006EBFE5 /* FidoHidMessageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FidoHidMessageTest.cpp; sourceTree = "<group>"; }; > 5797FE2F1EB15A5F00B2F4A0 /* NavigationClientDefaultCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigationClientDefaultCrypto.cpp; sourceTree = "<group>"; }; > 5797FE321EB15A8900B2F4A0 /* navigation-client-default-crypto.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "navigation-client-default-crypto.html"; sourceTree = "<group>"; }; >+ 5798337B235EB65C008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "web-authentication-get-assertion-nfc-multiple-tags.html"; sourceTree = "<group>"; }; > 5798E2AF1CAF5C2800C5CBA0 /* ProvisionalURLNotChange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProvisionalURLNotChange.mm; sourceTree = "<group>"; }; > 57A79856224AB34E00A7F6F1 /* WebCryptoMasterKey.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCryptoMasterKey.mm; sourceTree = "<group>"; }; > 57C6244D2346BCFA00383FE7 /* _WKWebAuthenticationPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKWebAuthenticationPanel.mm; sourceTree = "<group>"; }; >@@ -3399,6 +3402,7 @@ > 57663DF22357E45D00E85E09 /* web-authentication-get-assertion-hid-cancel.html */, > 577454CF2359B338008E1ED7 /* web-authentication-get-assertion-hid-no-credentials.html */, > 57663DEB234F1F8000E85E09 /* web-authentication-get-assertion-hid.html */, >+ 5798337B235EB65C008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html */, > 57663DE9234EA60B00E85E09 /* web-authentication-get-assertion-nfc.html */, > 577454D12359BAD5008E1ED7 /* web-authentication-get-assertion-u2f-no-credentials.html */, > 57C6244F2346C1EC00383FE7 /* web-authentication-get-assertion.html */, >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >index 6f418ae01494ff083172e2fa7e79e439dd9ef7be..b1fc9cb5a23e395e0417b68eea8ca272aa24abe2 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >@@ -42,6 +42,7 @@ > static bool webAuthenticationPanelRan = false; > static bool webAuthenticationPanelFailed = false; > static bool webAuthenticationPanelSucceded = false; >+static bool webAuthenticationPanelUpdateMultipleNFCTagsPresent = false; > static bool webAuthenticationPanelUpdateNoCredentialsFound = false; > static RetainPtr<_WKWebAuthenticationPanel> gPanel; > >@@ -53,8 +54,14 @@ @implementation TestWebAuthenticationPanelDelegate > - (void)panel:(_WKWebAuthenticationPanel *)panel updateWebAuthenticationPanel:(_WKWebAuthenticationPanelUpdate)update > { > ASSERT_NE(panel, nil); >- if (update == _WKWebAuthenticationPanelUpdateNoCredentialsFound) >+ if (update == _WKWebAuthenticationPanelUpdateMultipleNFCTagsPresent) { >+ webAuthenticationPanelUpdateMultipleNFCTagsPresent = true; >+ return; >+ } >+ if (update == _WKWebAuthenticationPanelUpdateNoCredentialsFound) { > webAuthenticationPanelUpdateNoCredentialsFound = true; >+ return; >+ } > } > > - (void)panel:(_WKWebAuthenticationPanel *)panel dismissWebAuthenticationPanelWithResult:(_WKWebAuthenticationResult)result >@@ -578,6 +585,23 @@ TEST(WebAuthenticationPanel, NullPanelHidCtapNoCredentialsFound) > [webView waitForMessage:@"Operation timed out."]; > } > >+TEST(WebAuthenticationPanel, PanelMultipleNFCTagsPresent) >+{ >+ reset(); >+ RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"web-authentication-get-assertion-nfc-multiple-tags" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; >+ >+ auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES]; >+ [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationExperimentalFeature()]; >+ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]); >+ auto delegate = adoptNS([[TestWebAuthenticationPanelUIDelegate alloc] init]); >+ [webView setUIDelegate:delegate.get()]; >+ >+ [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; >+ Util::run(&webAuthenticationPanelRan); >+ Util::run(&webAuthenticationPanelUpdateMultipleNFCTagsPresent); >+} >+ > } // namespace TestWebKitAPI > > #endif // ENABLE(WEB_AUTHN) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-nfc-multiple-tags.html b/Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-nfc-multiple-tags.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3da3f58c629211d0fc6131aa8fa79fb5e0201a88 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-nfc-multiple-tags.html >@@ -0,0 +1,16 @@ >+<input type="text" id="input"> >+<script> >+ if (window.internals) { >+ internals.setMockWebAuthenticationConfiguration({ silentFailure: true, nfc: { multiplePhysicalTags:true } }); >+ internals.withUserGesture(() => { input.focus(); }); >+ } >+ >+ const options = { >+ publicKey: { >+ challenge: new Uint8Array(16), >+ timeout: 100, >+ } >+ }; >+ >+ navigator.credentials.get(options); >+</script> >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 45f3a445a97454d0b67fdc8d118335ee3d662d94..ae89225860e57b7ca1802dba9f67a566c0ec8e37 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-10-21 Jiewen Tan <jiewen_tan@apple.com> >+ >+ [WebAuthn] Warn users when multiple NFC tags present >+ https://bugs.webkit.org/show_bug.cgi?id=200932 >+ <rdar://problem/54890736> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt: >+ * http/wpt/webauthn/public-key-credential-create-success-nfc.https.html: >+ Adds new tests for multiple physical tags and service restart. >+ > 2019-10-21 Simon Fraser <simon.fraser@apple.com> > > [iOS WK2] Support hiding iframe scrollbars via ::-webkit-scrollbar style >diff --git a/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt b/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt >index 9f5e8312e02f3bbf958a28b4371dedbee305f37f..d374d69cfde0d941198bde6c5fbdc96b6a07d5d4 100644 >--- a/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt >+++ b/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt >@@ -3,4 +3,6 @@ PASS PublicKeyCredential's [[create]] with minimum options in a mock nfc authent > PASS PublicKeyCredential's [[create]] with authenticatorSelection { 'cross-platform' } in a mock nfc authenticator. > PASS PublicKeyCredential's [[create]] with multiple tags in a mock nfc authenticator. > PASS PublicKeyCredential's [[create]] with U2F in a mock nfc authenticator. >+PASS PublicKeyCredential's [[create]] with multiple physical tags in a mock nfc authenticator. >+PASS PublicKeyCredential's [[create]] with service restart in a mock nfc authenticator. > >diff --git a/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https.html b/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https.html >index 82d070618b3e033c348a7742c10af6ec11c66356..0b9622a66b2e92a4b013160b241a6f2abf176461 100644 >--- a/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https.html >+++ b/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-nfc.https.html >@@ -21,8 +21,7 @@ > displayName: "Appleseed", > }, > challenge: Base64URL.parse("MTIzNDU2"), >- pubKeyCredParams: [{ type: "public-key", alg: -7 }], >- timeout: 100 >+ pubKeyCredParams: [{ type: "public-key", alg: -7 }] > } > }; > >@@ -44,8 +43,7 @@ > }, > challenge: Base64URL.parse("MTIzNDU2"), > pubKeyCredParams: [{ type: "public-key", alg: -7 }], >- authenticatorSelection: { authenticatorAttachment: "cross-platform" }, >- timeout: 100 >+ authenticatorSelection: { authenticatorAttachment: "cross-platform" } > } > }; > >@@ -66,8 +64,7 @@ > displayName: "Appleseed", > }, > challenge: Base64URL.parse("MTIzNDU2"), >- pubKeyCredParams: [{ type: "public-key", alg: -7 }], >- timeout: 100 >+ pubKeyCredParams: [{ type: "public-key", alg: -7 }] > } > }; > >@@ -90,8 +87,7 @@ > displayName: "Appleseed", > }, > challenge: Base64URL.parse("MTIzNDU2"), >- pubKeyCredParams: [{ type: "public-key", alg: -7 }], >- timeout: 100 >+ pubKeyCredParams: [{ type: "public-key", alg: -7 }] > } > }; > >@@ -101,4 +97,50 @@ > checkU2fMakeCredentialResult(credential); > }); > }, "PublicKeyCredential's [[create]] with U2F in a mock nfc authenticator."); >+ >+ promise_test(t => { >+ const options = { >+ publicKey: { >+ rp: { >+ name: "localhost", >+ }, >+ user: { >+ name: "John Appleseed", >+ id: Base64URL.parse(testUserhandleBase64), >+ displayName: "Appleseed", >+ }, >+ challenge: Base64URL.parse("MTIzNDU2"), >+ pubKeyCredParams: [{ type: "public-key", alg: -7 }] >+ } >+ }; >+ >+ if (window.internals) >+ internals.setMockWebAuthenticationConfiguration({ nfc: { error: "success", payloadBase64: [testNfcCtapVersionBase64, testGetInfoResponseApduBase64, testCreationMessageApduBase64], multiplePhysicalTags: true } }); >+ return navigator.credentials.create(options).then(credential => { >+ checkCtapMakeCredentialResult(credential); >+ }); >+ }, "PublicKeyCredential's [[create]] with multiple physical tags in a mock nfc authenticator."); >+ >+ promise_test(t => { >+ const options = { >+ publicKey: { >+ rp: { >+ name: "localhost", >+ }, >+ user: { >+ name: "John Appleseed", >+ id: Base64URL.parse(testUserhandleBase64), >+ displayName: "Appleseed", >+ }, >+ challenge: Base64URL.parse("MTIzNDU2"), >+ pubKeyCredParams: [{ type: "public-key", alg: -7 }] >+ } >+ }; >+ >+ if (window.internals) >+ internals.setMockWebAuthenticationConfiguration({ silentFailure: true, nfc: { error: "malicious-payload", payloadBase64: [testDummyMessagePayloadBase64, testNfcCtapVersionBase64, testGetInfoResponseApduBase64, testCreationMessageApduBase64] } }); >+ return navigator.credentials.create(options).then(credential => { >+ checkCtapMakeCredentialResult(credential); >+ }); >+ }, "PublicKeyCredential's [[create]] with service restart in a mock nfc authenticator."); > </script>
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 200932
:
381511
|
381533
|
381983