- Revision
- 289739
- Author
- j_pas...@apple.com
- Date
- 2022-02-14 09:58:13 -0800 (Mon, 14 Feb 2022)
Log Message
[WebAuthn] Modify _WKWebAuthenticationAssertionResponse according to internal needs
https://bugs.webkit.org/show_bug.cgi?id=236369
rdar://88585811
Reviewed by Brent Fulgham.
Source/WebCore:
This patch modifies AuthenticatorAssertionResponse with additional
fields and populates them according to internal needs.
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::group const):
(WebCore::AuthenticatorAssertionResponse::synchronizable const):
(WebCore::AuthenticatorAssertionResponse::setGroup):
(WebCore::AuthenticatorAssertionResponse::setSynchronizable):
Source/WebKit:
This patch modifies the _WKWebAuthenticationAssertionResponse API object with additional
fields and populates them according to internal needs.
* UIProcess/API/APIWebAuthenticationAssertionResponse.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm:
(-[_WKWebAuthenticationAssertionResponse synchronizable]):
(-[_WKWebAuthenticationAssertionResponse group]):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(groupForAttributes):
(WebKit::LocalAuthenticatorInternal::getExistingCredentials):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (289738 => 289739)
--- trunk/Source/WebCore/ChangeLog 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebCore/ChangeLog 2022-02-14 17:58:13 UTC (rev 289739)
@@ -1,3 +1,20 @@
+2022-02-14 J Pascoe <j_pas...@apple.com>
+
+ [WebAuthn] Modify _WKWebAuthenticationAssertionResponse according to internal needs
+ https://bugs.webkit.org/show_bug.cgi?id=236369
+ rdar://88585811
+
+ Reviewed by Brent Fulgham.
+
+ This patch modifies AuthenticatorAssertionResponse with additional
+ fields and populates them according to internal needs.
+
+ * Modules/webauthn/AuthenticatorAssertionResponse.h:
+ (WebCore::AuthenticatorAssertionResponse::group const):
+ (WebCore::AuthenticatorAssertionResponse::synchronizable const):
+ (WebCore::AuthenticatorAssertionResponse::setGroup):
+ (WebCore::AuthenticatorAssertionResponse::setSynchronizable):
+
2022-02-14 Frédéric Wang <fw...@igalia.com>
Nullptr crash in CompositeEditCommand::splitTreeToNode via InsertParagraphSeparatorCommand::doApply
Modified: trunk/Source/WebCore/Modules/webauthn/AuthenticatorAssertionResponse.h (289738 => 289739)
--- trunk/Source/WebCore/Modules/webauthn/AuthenticatorAssertionResponse.h 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebCore/Modules/webauthn/AuthenticatorAssertionResponse.h 2022-02-14 17:58:13 UTC (rev 289739)
@@ -49,6 +49,8 @@
const String& displayName() const { return m_displayName; }
size_t numberOfCredentials() const { return m_numberOfCredentials; }
SecAccessControlRef accessControl() const { return m_accessControl.get(); }
+ const String& group() const { return m_group; }
+ bool synchronizable() const { return m_synchronizable; }
LAContext * laContext() const { return m_laContext.get(); }
WEBCORE_EXPORT void setAuthenticatorData(Vector<uint8_t>&&);
@@ -56,6 +58,8 @@
void setName(const String& name) { m_name = name; }
void setDisplayName(const String& displayName) { m_displayName = displayName; }
void setNumberOfCredentials(size_t numberOfCredentials) { m_numberOfCredentials = numberOfCredentials; }
+ void setGroup(const String& group) { m_group = group; }
+ void setSynchronizable(bool synchronizable) { m_synchronizable = synchronizable; }
void setLAContext(LAContext *context) { m_laContext = context; }
private:
@@ -71,6 +75,8 @@
String m_name;
String m_displayName;
+ String m_group;
+ bool m_synchronizable;
size_t m_numberOfCredentials { 0 };
RetainPtr<SecAccessControlRef> m_accessControl;
RetainPtr<LAContext> m_laContext;
Modified: trunk/Source/WebKit/ChangeLog (289738 => 289739)
--- trunk/Source/WebKit/ChangeLog 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebKit/ChangeLog 2022-02-14 17:58:13 UTC (rev 289739)
@@ -1,3 +1,23 @@
+2022-02-14 J Pascoe <j_pas...@apple.com>
+
+ [WebAuthn] Modify _WKWebAuthenticationAssertionResponse according to internal needs
+ https://bugs.webkit.org/show_bug.cgi?id=236369
+ rdar://88585811
+
+ Reviewed by Brent Fulgham.
+
+ This patch modifies the _WKWebAuthenticationAssertionResponse API object with additional
+ fields and populates them according to internal needs.
+
+ * UIProcess/API/APIWebAuthenticationAssertionResponse.h:
+ * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h:
+ * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm:
+ (-[_WKWebAuthenticationAssertionResponse synchronizable]):
+ (-[_WKWebAuthenticationAssertionResponse group]):
+ * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
+ (groupForAttributes):
+ (WebKit::LocalAuthenticatorInternal::getExistingCredentials):
+
2022-02-14 Tim Nguyen <n...@apple.com>
Don't perform layout in WKBundlePagePostSynchronousMessageForTesting
Modified: trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationAssertionResponse.h (289738 => 289739)
--- trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationAssertionResponse.h 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationAssertionResponse.h 2022-02-14 17:58:13 UTC (rev 289739)
@@ -42,6 +42,8 @@
const WTF::String& name() const { return m_response->name(); }
const WTF::String& displayName() const { return m_response->displayName(); }
RefPtr<Data> userHandle() const;
+ bool synchronizable() const { return m_response->synchronizable(); }
+ const WTF::String& group() const { return m_response->group(); }
void setLAContext(LAContext *context) { m_response->setLAContext(context); }
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h (289738 => 289739)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h 2022-02-14 17:58:13 UTC (rev 289739)
@@ -36,6 +36,8 @@
@property (nonatomic, readonly, copy) NSString *name;
@property (nonatomic, readonly, copy) NSString *displayName;
@property (nonatomic, readonly, copy) NSData *userHandle;
+@property (nonatomic, readonly) BOOL synchronizable;
+@property (nonatomic, readonly, copy) NSString *group;
- (void)setLAContext:(LAContext *)context WK_API_AVAILABLE(macos(12.0), ios(15.0));
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm (289738 => 289739)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm 2022-02-14 17:58:13 UTC (rev 289739)
@@ -58,6 +58,16 @@
return wrapper(_response->userHandle());
}
+- (BOOL)synchronizable
+{
+ return _response->synchronizable();
+}
+
+- (NSString *)group
+{
+ return _response->group();
+}
+
#endif // ENABLE(WEB_AUTHN)
- (void)setLAContext:(LAContext *)context
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm (289738 => 289739)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-02-14 17:07:17 UTC (rev 289738)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-02-14 17:58:13 UTC (rev 289739)
@@ -44,6 +44,7 @@
#import <wtf/RetainPtr.h>
#import <wtf/RunLoop.h>
#import <wtf/Vector.h>
+#import <wtf/cocoa/TypeCastsCocoa.h>
#import <wtf/cocoa/VectorCocoa.h>
#import <wtf/spi/cocoa/SecuritySPI.h>
#import <wtf/text/Base64.h>
@@ -55,6 +56,10 @@
static void updateQueryIfNecessary(NSMutableDictionary *)
{
}
+static inline String groupForAttributes(NSDictionary *attributes)
+{
+ return nullString();
+}
#endif
namespace WebKit {
@@ -163,7 +168,15 @@
}
auto& username = it->second.getString();
- result.uncheckedAppend(AuthenticatorAssertionResponse::create(toArrayBuffer(attributes[(id)kSecAttrApplicationLabel]), toArrayBuffer(userHandle), String(username), (__bridge SecAccessControlRef)attributes[(id)kSecAttrAccessControl], AuthenticatorAttachment::Platform));
+ auto response = AuthenticatorAssertionResponse::create(toArrayBuffer(attributes[(id)kSecAttrApplicationLabel]), toArrayBuffer(userHandle), String(username), (__bridge SecAccessControlRef)attributes[(id)kSecAttrAccessControl], AuthenticatorAttachment::Platform);
+
+ auto group = groupForAttributes(attributes);
+ if (!group.isNull())
+ response->setGroup(group);
+ if ([[attributes allKeys] containsObject:bridge_cast(kSecAttrSynchronizable)])
+ response->setSynchronizable(attributes[(id)kSecAttrSynchronizable]);
+
+ result.uncheckedAppend(WTFMove(response));
}
return result;
}