[WebAuthN] Import a JS CBOR coder
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2018 19:47:05 +0000 (19:47 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2018 19:47:05 +0000 (19:47 +0000)
commit46dc76720f50245113900f321c9671b4cad76b34
tree7a951f84d54155d4aa90330211a2525acfa726e5
parent89c4a55be7ac1d768e3fe8d0a2bfd1b44a7562cf
[WebAuthN] Import a JS CBOR coder
https://bugs.webkit.org/show_bug.cgi?id=189877
<rdar://problem/44701124>

Reviewed by Chris Dumez.

Source/WebKit:

Update MockWebAuthenticationConfiguration to have userCertificateBase64 and intermediateCACertificateBase64
as Local's memeber such that tests can pass those certificates to MockLocalConnection instead of letting it
holds some static ones.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

Tools:

Add logic to only process privateKeyBase64, userCertificateBase64 and intermediateCACertificateBase64
only if acceptAttestation is true.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):

LayoutTests:

This patch import a 3rd party JS CBOR coder from https://github.com/paroga/cbor-js.
The library is MIT licensed, which should be fine to use within WebKit.

As a benefit from the library, tests are updated to check CBOR binaries.

* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
* http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-create-success-local.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-get-success-local.https.html:
* http/wpt/webauthn/resources/cbor.js: Added.
* http/wpt/webauthn/resources/util.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/http/wpt/credential-management/credentialscontainer-store-basics.https.html
LayoutTests/http/wpt/webauthn/idl.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-get-success-local.https.html
LayoutTests/http/wpt/webauthn/resources/cbor.js [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/resources/util.js
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm
Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp