[WebAuthN] Support Attestation Conveyance Preference
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2019 19:27:49 +0000 (19:27 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2019 19:27:49 +0000 (19:27 +0000)
commit6b73ac3746303c30c979309a097f36977c2b4a12
tree1f00eec90448b8e1d85467736fc47449df0a305a
parent4deabbf95e939aaadb8ec2676de37b5d48b8c88f
[WebAuthN] Support Attestation Conveyance Preference
https://bugs.webkit.org/show_bug.cgi?id=192722
<rdar://problem/49939647>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with
Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential.
Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM
the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between
the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt
of the attestation object, and therefore it is meaningless to return self attestation.

Covered by new tests within existing files.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
* Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/WebAuthenticationConstants.h:
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildAttestationObject):
* Modules/webauthn/WebAuthenticationUtils.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPMakeCredentialResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h:
* Modules/webauthn/fido/FidoConstants.h:
noneAttestationValue is moved to WebAuthenticationConstants.h.
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fRegisterResponse):
* Modules/webauthn/fido/U2fResponseConverter.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
(WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):

Tools:

* TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp:
(TestWebKitAPI::TEST):
Updates the test with AttestationConveyancePreference.

LayoutTests:

* http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:
* http/wpt/webauthn/public-key-credential-create-success-local.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-local.https.html:
* http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-u2f.https.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
LayoutTests/ChangeLog
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-local.https-expected.txt
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Headers.cmake
Source/WebCore/Modules/webauthn/AttestationConveyancePreference.h [new file with mode: 0644]
Source/WebCore/Modules/webauthn/AttestationConveyancePreference.idl [new file with mode: 0644]
Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h
Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.idl
Source/WebCore/Modules/webauthn/WebAuthenticationConstants.h
Source/WebCore/Modules/webauthn/WebAuthenticationUtils.cpp
Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h
Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp
Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h
Source/WebCore/Modules/webauthn/fido/FidoConstants.h
Source/WebCore/Modules/webauthn/fido/U2fResponseConverter.cpp
Source/WebCore/Modules/webauthn/fido/U2fResponseConverter.h
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp
Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp