[WebAuthN] Import an APDU coder from Chromium
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2018 23:06:54 +0000 (23:06 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2018 23:06:54 +0000 (23:06 +0000)
commit7485af0876db2f4593e639fa4f2946988de23eca
treeefeff39dd720d37b745a3910db69ddd11f5c0c58
parent93998a43700fd3469eb78b614ff3898742ec8660
[WebAuthN] Import an APDU coder from Chromium
https://bugs.webkit.org/show_bug.cgi?id=192949
<rdar://problem/46879933>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch imports an APDU coder from Chromium. Here is the documentation:
https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.

Here is a list of files that are imported from Chromium:
https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6

Covered by API tests.

* Modules/webauthn/apdu/ApduCommand.cpp: Added.
(apdu::ApduCommand::createFromMessage):
(apdu::ApduCommand::ApduCommand):
(apdu::ApduCommand::getEncodedCommand const):
* Modules/webauthn/apdu/ApduCommand.h: Added.
* Modules/webauthn/apdu/ApduResponse.cpp: Added.
(apdu::ApduResponse::createFromMessage):
(apdu::ApduResponse::ApduResponse):
(apdu::ApduResponse::getEncodedResponse const):
* Modules/webauthn/apdu/ApduResponse.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ApduTest.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/webauthn/apdu/ApduCommand.cpp [new file with mode: 0644]
Source/WebCore/Modules/webauthn/apdu/ApduCommand.h [new file with mode: 0644]
Source/WebCore/Modules/webauthn/apdu/ApduResponse.cpp [new file with mode: 0644]
Source/WebCore/Modules/webauthn/apdu/ApduResponse.h [new file with mode: 0644]
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebCore/ApduTest.cpp [new file with mode: 0644]