Changeset 226862 in webkit
- Timestamp:
- Jan 11, 2018 9:29:01 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r226842 r226862 1 2018-01-11 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] Import a CBOR coder from Chromium 4 https://bugs.webkit.org/show_bug.cgi?id=181522 5 <rdar://problem/36055729> 6 7 Reviewed by Brent Fulgham. 8 9 This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder 10 is needed for WebAuthN to encode attestation object into binaries. When supporting extensions 11 in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining 12 a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore, 13 importing a most suitable third party implementation will be wise. 14 15 In this patch, it fully integrate the whole coder into our codebase. Those changes includes: 16 1. Substitute data structures that enjoy a better WTF version. 17 2. Replacing marcos. 18 3. Implementating workarounds for some functionalities that we lack fundamental types' support. 19 4. Changing the coding style to match ours. 20 21 This patch doesn't intend to improve the logic of the original codebase. Hence some of the 22 coding logic might not match what WebKit ususally has. 23 24 Here is a full list of Chromium changes that constructed this CBOR coder in chronological order: 25 6efcf495521d18d060027762f48bb292d6979136, 26 9eb43fd347890b4c6cf54c4bd7ec1bbb88e381e1, 27 31c85e74fd567772f18e0a41be468d04af721f21, 28 68672fdcad280a8ff69b91927d38d0eabf2c87f2, 29 0ca8667c0584fb21c0748ebd7468d32889759a07, 30 df763d790d7e45d70116bdefacbfd4f9faa8995e, 31 6d30c4a621c65314db63eb56e87c19ab75627b26, 32 50fe92953f4739f17a62303fedbf8db9234317c8, 33 47be22c3603424d1832d046a348ff3f982500288, 34 98a59e46948b2c71608926004fac8192b0ff2208, 35 07540c6d850ed6e0fa508d63c20a8ce96d751de6, 36 06ae32d640c8e4b86ea8914a80ee419ea16e56d8. 37 38 Covered by API tests. 39 40 * Modules/webauthn/cbor/CBORBinary.h: Added. 41 * Modules/webauthn/cbor/CBORReader.cpp: Added. 42 (cbor::CBORReader::CBORReader): 43 (cbor::CBORReader::~CBORReader): 44 (cbor::CBORReader::read): 45 (cbor::CBORReader::decodeCBOR): 46 (cbor::CBORReader::readVariadicLengthInteger): 47 (cbor::CBORReader::decodeValueToNegative): 48 (cbor::CBORReader::decodeValueToUnsigned): 49 (cbor::CBORReader::readSimpleValue): 50 (cbor::CBORReader::readString): 51 Workarounds applied. 52 (cbor::CBORReader::readBytes): 53 (cbor::CBORReader::readCBORArray): 54 (cbor::CBORReader::readCBORMap): 55 (cbor::CBORReader::canConsume): 56 (cbor::CBORReader::checkMinimalEncoding): 57 (cbor::CBORReader::checkExtraneousData): 58 (cbor::CBORReader::checkDuplicateKey): 59 (cbor::CBORReader::hasValidUTF8Format): 60 Workarounds applied. 61 (cbor::CBORReader::checkOutOfOrderKey): 62 (cbor::CBORReader::getErrorCode): 63 (cbor::CBORReader::errorCodeToString): 64 * Modules/webauthn/cbor/CBORReader.h: Added. 65 * Modules/webauthn/cbor/CBORValue.cpp: Added. 66 (cbor::CBORValue::CBORValue): 67 (cbor::CBORValue::operator=): 68 (cbor::CBORValue::~CBORValue): 69 (cbor::CBORValue::clone const): 70 (cbor::CBORValue::getInteger const): 71 (cbor::CBORValue::getUnsigned const): 72 (cbor::CBORValue::getNegative const): 73 (cbor::CBORValue::getString const): 74 (cbor::CBORValue::getByteString const): 75 (cbor::CBORValue::getArray const): 76 (cbor::CBORValue::getMap const): 77 (cbor::CBORValue::getSimpleValue const): 78 (cbor::CBORValue::internalMoveConstructFrom): 79 (cbor::CBORValue::internalCleanup): 80 * Modules/webauthn/cbor/CBORValue.h: Added. 81 * Modules/webauthn/cbor/CBORWriter.cpp: Added. 82 (cbor::CBORWriter::~CBORWriter): 83 (cbor::CBORWriter::write): 84 (cbor::CBORWriter::CBORWriter): 85 (cbor::CBORWriter::encodeCBOR): 86 Workarounds applied. 87 (cbor::CBORWriter::startItem): 88 (cbor::CBORWriter::setAdditionalInformation): 89 (cbor::CBORWriter::setUint): 90 (cbor::CBORWriter::getNumUintBytes): 91 * Modules/webauthn/cbor/CBORWriter.h: Added. 92 * Sources.txt: 93 * WebCore.xcodeproj/project.pbxproj: 94 1 95 2018-01-11 Chris Dumez <cdumez@apple.com> 2 96 -
trunk/Source/WebCore/Sources.txt
r226778 r226862 246 246 247 247 Modules/webauthn/PublicKeyCredential.cpp 248 Modules/webauthn/cbor/CBORReader.cpp 249 Modules/webauthn/cbor/CBORValue.cpp 250 Modules/webauthn/cbor/CBORWriter.cpp 248 251 249 252 Modules/webdatabase/ChangeVersionWrapper.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r226778 r226862 1642 1642 5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */; }; 1643 1643 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; }; 1644 57303BB92006C6EE00355965 /* CBORValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BB42006C6ED00355965 /* CBORValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1645 57303BBA2006C6EE00355965 /* CBORWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BB52006C6ED00355965 /* CBORWriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1646 57303BBB2006C6EE00355965 /* CBORBinary.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BB62006C6ED00355965 /* CBORBinary.h */; }; 1647 57303BC12006E00C00355965 /* CBORReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BBF2006E00C00355965 /* CBORReader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1644 1648 573489391DAC6B6E00DC0667 /* CryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */; }; 1645 1649 5739E12F1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5739E12E1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h */; }; … … 8170 8174 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; }; 8171 8175 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; }; 8176 57303BB42006C6ED00355965 /* CBORValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORValue.h; sourceTree = "<group>"; }; 8177 57303BB52006C6ED00355965 /* CBORWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORWriter.h; sourceTree = "<group>"; }; 8178 57303BB62006C6ED00355965 /* CBORBinary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORBinary.h; sourceTree = "<group>"; }; 8179 57303BB72006C6ED00355965 /* CBORValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORValue.cpp; sourceTree = "<group>"; }; 8180 57303BB82006C6ED00355965 /* CBORWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORWriter.cpp; sourceTree = "<group>"; }; 8181 57303BBE2006E00400355965 /* CBORReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORReader.cpp; sourceTree = "<group>"; }; 8182 57303BBF2006E00C00355965 /* CBORReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORReader.h; sourceTree = "<group>"; }; 8172 8183 573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmParameters.h; sourceTree = "<group>"; }; 8173 8184 5739E12E1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoAlgorithmParameters.h; sourceTree = "<group>"; }; … … 18059 18070 sourceTree = "<group>"; 18060 18071 }; 18072 57303BB32006C6ED00355965 /* cbor */ = { 18073 isa = PBXGroup; 18074 children = ( 18075 57303BB62006C6ED00355965 /* CBORBinary.h */, 18076 57303BBE2006E00400355965 /* CBORReader.cpp */, 18077 57303BBF2006E00C00355965 /* CBORReader.h */, 18078 57303BB72006C6ED00355965 /* CBORValue.cpp */, 18079 57303BB42006C6ED00355965 /* CBORValue.h */, 18080 57303BB82006C6ED00355965 /* CBORWriter.cpp */, 18081 57303BB52006C6ED00355965 /* CBORWriter.h */, 18082 ); 18083 path = cbor; 18084 sourceTree = "<group>"; 18085 }; 18061 18086 57C7A6881E56946D00C67D71 /* credentialmanagement */ = { 18062 18087 isa = PBXGroup; … … 18099 18124 isa = PBXGroup; 18100 18125 children = ( 18126 57303BB32006C6ED00355965 /* cbor */, 18101 18127 57D8462C1FEAF68F00CA3682 /* PublicKeyCredential.cpp */, 18102 18128 57D8462B1FEAF68F00CA3682 /* PublicKeyCredential.h */, … … 26525 26551 07B7116F1D899E63009F0FFB /* CaptureDeviceManager.h in Headers */, 26526 26552 CDC734151977896D0046BFC5 /* CARingBuffer.h in Headers */, 26553 57303BBB2006C6EE00355965 /* CBORBinary.h in Headers */, 26554 57303BC12006E00C00355965 /* CBORReader.h in Headers */, 26555 57303BB92006C6EE00355965 /* CBORValue.h in Headers */, 26556 57303BBA2006C6EE00355965 /* CBORWriter.h in Headers */, 26527 26557 6550B69E099DF0270090D781 /* CDATASection.h in Headers */, 26528 26558 CDF4B7161E00B7E500E235A2 /* CDM.h in Headers */, -
trunk/Tools/ChangeLog
r226841 r226862 1 2018-01-11 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] Import a CBOR coder from Chromium 4 https://bugs.webkit.org/show_bug.cgi?id=181522 5 <rdar://problem/36055729> 6 7 Reviewed by Brent Fulgham. 8 9 This patch also imports all unit tests into our API tests to ensure all 10 workarounds and modification against the original codebase doesn't change 11 any original functionalities. 12 13 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 14 * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: Added. 15 (TestWebKitAPI::TEST): 16 * TestWebKitAPI/Tests/WebCore/CBORValueTest.cpp: Added. 17 (TestWebKitAPI::TEST): 18 * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: Added. 19 (TestWebKitAPI::eq): 20 Workarounds applied. 21 (TestWebKitAPI::TEST): 22 1 23 2018-01-11 Jonathan Bedard <jbedard@apple.com> 2 24 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r226471 r226862 219 219 5714ECBD1CA8C22A00051AC8 /* DownloadRequestOriginalURL2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */; }; 220 220 571F7FD01F2961FB00946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal in Copy Resources */ = {isa = PBXBuildFile; fileRef = 571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */; }; 221 57303BC9200824D300355965 /* CBORValueTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAC2006C56000355965 /* CBORValueTest.cpp */; }; 222 57303BCA20082C0100355965 /* CBORWriterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAB2006C55400355965 /* CBORWriterTest.cpp */; }; 223 57303BCB2008376500355965 /* CBORReaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BC220071E2200355965 /* CBORReaderTest.cpp */; }; 221 224 57599E211F07191900A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57599E201F07191700A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.mm */; }; 222 225 57599E271F071AA000A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3 in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57599E241F07192C00A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3 */; }; … … 1380 1383 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURL2.html; sourceTree = "<group>"; }; 1381 1384 571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal"; sourceTree = "<group>"; }; 1385 57303BAB2006C55400355965 /* CBORWriterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORWriterTest.cpp; sourceTree = "<group>"; }; 1386 57303BAC2006C56000355965 /* CBORValueTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORValueTest.cpp; sourceTree = "<group>"; }; 1387 57303BC220071E2200355965 /* CBORReaderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORReaderTest.cpp; sourceTree = "<group>"; }; 1382 1388 5735F0251F3A4EA6000EE801 /* TestWebKitAPI-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "TestWebKitAPI-iOS.entitlements"; sourceTree = "<group>"; }; 1383 1389 57599E201F07191700A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IndexedDBStructuredCloneBackwardCompatibility.mm; sourceTree = "<group>"; }; … … 2204 2210 93A720E518F1A0E800A848E1 /* CalculationValue.cpp */, 2205 2211 07C046C91E42573E007201E7 /* CARingBuffer.cpp */, 2212 57303BC220071E2200355965 /* CBORReaderTest.cpp */, 2213 57303BAC2006C56000355965 /* CBORValueTest.cpp */, 2214 57303BAB2006C55400355965 /* CBORWriterTest.cpp */, 2206 2215 7C3965051CDD74F90094DBB8 /* Color.cpp */, 2207 2216 1C9EB8401E380DA1005C6442 /* ComplexTextController.cpp */, … … 3332 3341 7CCE7EE71A411AE600447C4C /* CanHandleRequest.cpp in Sources */, 3333 3342 07C046CA1E4262A8007201E7 /* CARingBuffer.cpp in Sources */, 3343 57303BCB2008376500355965 /* CBORReaderTest.cpp in Sources */, 3344 57303BC9200824D300355965 /* CBORValueTest.cpp in Sources */, 3345 57303BCA20082C0100355965 /* CBORWriterTest.cpp in Sources */, 3334 3346 7CCE7EE61A411AE600447C4C /* CloseFromWithinCreatePage.cpp in Sources */, 3335 3347 7CCE7EB71A411A7E00447C4C /* CloseNewWindowInNavigationPolicyDelegate.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.