Changeset 239520 in webkit


Ignore:
Timestamp:
Dec 21, 2018 3:06:54 PM (5 years ago)
Author:
jiewen_tan@apple.com
Message:

[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):

Location:
trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239519 r239520  
     12018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Import an APDU coder from Chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=192949
     5        <rdar://problem/46879933>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This patch imports an APDU coder from Chromium. Here is the documentation:
     10        https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
     11        APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
     12
     13        Here is a list of files that are imported from Chromium:
     14        https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
     15        https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
     16        https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
     17        https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
     18        https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
     19
     20        Covered by API tests.
     21
     22        * Modules/webauthn/apdu/ApduCommand.cpp: Added.
     23        (apdu::ApduCommand::createFromMessage):
     24        (apdu::ApduCommand::ApduCommand):
     25        (apdu::ApduCommand::getEncodedCommand const):
     26        * Modules/webauthn/apdu/ApduCommand.h: Added.
     27        * Modules/webauthn/apdu/ApduResponse.cpp: Added.
     28        (apdu::ApduResponse::createFromMessage):
     29        (apdu::ApduResponse::ApduResponse):
     30        (apdu::ApduResponse::getEncodedResponse const):
     31        * Modules/webauthn/apdu/ApduResponse.h: Added.
     32        * Sources.txt:
     33        * WebCore.xcodeproj/project.pbxproj:
     34
    1352018-12-21  Jer Noble  <jer.noble@apple.com>
    236
  • trunk/Source/WebCore/Sources.txt

    r239515 r239520  
    257257Modules/webauthn/AuthenticatorCoordinatorClient.cpp
    258258Modules/webauthn/PublicKeyCredential.cpp
     259Modules/webauthn/apdu/ApduCommand.cpp
     260Modules/webauthn/apdu/ApduResponse.cpp
    259261Modules/webauthn/cbor/CBORReader.cpp
    260262Modules/webauthn/cbor/CBORValue.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r239515 r239520  
    17821782                5706A6981DDE5E4600A03B14 /* JSRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */; };
    17831783                571252691E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h in Headers */ = {isa = PBXBuildFile; fileRef = 571252681E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h */; };
     1784                57152B5A21CB3E88000C37CA /* ApduCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 57152B5821CB2E3B000C37CA /* ApduCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1785                57152B5C21CC1902000C37CA /* ApduResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 57152B5621CB2E3A000C37CA /* ApduResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17841786                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
    17851787                572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */; };
     
    85878589                571252681E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAES_CFB.h; sourceTree = "<group>"; };
    85888590                5712526A1E52527C008FF369 /* CryptoAlgorithmAES_CFB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CFB.cpp; sourceTree = "<group>"; };
     8591                57152B5521CB2E3A000C37CA /* ApduResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApduResponse.cpp; path = Modules/webauthn/apdu/ApduResponse.cpp; sourceTree = SOURCE_ROOT; };
     8592                57152B5621CB2E3A000C37CA /* ApduResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ApduResponse.h; path = Modules/webauthn/apdu/ApduResponse.h; sourceTree = SOURCE_ROOT; };
     8593                57152B5721CB2E3A000C37CA /* ApduCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApduCommand.cpp; path = Modules/webauthn/apdu/ApduCommand.cpp; sourceTree = SOURCE_ROOT; };
     8594                57152B5821CB2E3B000C37CA /* ApduCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ApduCommand.h; path = Modules/webauthn/apdu/ApduCommand.h; sourceTree = SOURCE_ROOT; };
    85898595                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = "<group>"; };
    85908596                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
     
    1927119277                        sourceTree = "<group>";
    1927219278                };
     19279                57152B5321CB2CE3000C37CA /* apdu */ = {
     19280                        isa = PBXGroup;
     19281                        children = (
     19282                                57152B5721CB2E3A000C37CA /* ApduCommand.cpp */,
     19283                                57152B5821CB2E3B000C37CA /* ApduCommand.h */,
     19284                                57152B5521CB2E3A000C37CA /* ApduResponse.cpp */,
     19285                                57152B5621CB2E3A000C37CA /* ApduResponse.h */,
     19286                        );
     19287                        path = apdu;
     19288                        sourceTree = "<group>";
     19289                };
    1927319290                57303BB32006C6ED00355965 /* cbor */ = {
    1927419291                        isa = PBXGroup;
     
    1934819365                        isa = PBXGroup;
    1934919366                        children = (
     19367                                57152B5321CB2CE3000C37CA /* apdu */,
    1935019368                                57303BB32006C6ED00355965 /* cbor */,
    1935119369                                578A4BFA2166AE0000D08F34 /* fido */,
     
    2786327881                                71025ECD1F99F0CE004A250C /* AnimationTimeline.h in Headers */,
    2786427882                                0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
     27883                                57152B5A21CB3E88000C37CA /* ApduCommand.h in Headers */,
     27884                                57152B5C21CC1902000C37CA /* ApduResponse.h in Headers */,
    2786527885                                93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */,
    2786627886                                A1DF5A941F7EC4320058A477 /* ApplePayContactField.h in Headers */,
  • trunk/Tools/ChangeLog

    r239511 r239520  
     12018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Import an APDU coder from Chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=192949
     5        <rdar://problem/46879933>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebCore/ApduTest.cpp: Added.
     11        (TestWebKitAPI::TEST):
     12
    1132018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r239442 r239520  
    258258                5714ECBB1CA8BFE400051AC8 /* DownloadRequestOriginalURLFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */; };
    259259                5714ECBD1CA8C22A00051AC8 /* DownloadRequestOriginalURL2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */; };
     260                57152B5E21CC2045000C37CA /* ApduTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57152B5D21CC2045000C37CA /* ApduTest.cpp */; };
    260261                571F7FD01F2961FB00946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal in Copy Resources */ = {isa = PBXBuildFile; fileRef = 571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */; };
    261262                572B403421769A88000AD43E /* CtapRequestTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B403321769A88000AD43E /* CtapRequestTest.cpp */; };
     
    16051606                5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURLFrame.html; sourceTree = "<group>"; };
    16061607                5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURL2.html; sourceTree = "<group>"; };
     1608                57152B5D21CC2045000C37CA /* ApduTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApduTest.cpp; sourceTree = "<group>"; };
    16071609                571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal"; sourceTree = "<group>"; };
    16081610                572B403321769A88000AD43E /* CtapRequestTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CtapRequestTest.cpp; sourceTree = "<group>"; };
     
    26172619                                ABF510632A19B8AC7EC40E17 /* AbortableTaskQueue.cpp */,
    26182620                                7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
     2621                                57152B5D21CC2045000C37CA /* ApduTest.cpp */,
    26192622                                6354F4D01F7C3AB500D89DF3 /* ApplicationManifestParser.cpp */,
    26202623                                93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
     
    38383841                                A1DF74321C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm in Sources */,
    38393842                                2DE71AFE1D49C0BD00904094 /* AnimatedResize.mm in Sources */,
     3843                                57152B5E21CC2045000C37CA /* ApduTest.cpp in Sources */,
    38403844                                63F668221F97F7F90032EE51 /* ApplicationManifest.mm in Sources */,
    38413845                                6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.