Changeset 237983 in webkit
- Timestamp:
- Nov 8, 2018 2:29:58 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 16 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r237981 r237983 439 439 Modules/webauthn/PublicKeyCredentialRequestOptions.idl 440 440 Modules/webauthn/PublicKeyCredentialType.idl 441 Modules/webauthn/UserVerificationRequirement.idl 441 442 442 443 Modules/webdatabase/DOMWindowWebDatabase.idl -
trunk/Source/WebCore/ChangeLog
r237981 r237983 1 2018-11-08 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] Import CTAP device request/response converters from Chromium 4 https://bugs.webkit.org/show_bug.cgi?id=190784 5 <rdar://problem/45460333> 6 7 Reviewed by Brent Fulgham. 8 9 This patch imports Chromium's CTAP device request/response converters: 10 https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding 11 1. It directly imports the following files and suit them to WebKit's coding style: 12 https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 13 https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 14 https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 15 https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 16 https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 17 https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 18 https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 19 https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 20 https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 21 2. It gathers the following methods into DeviceRequestConverter: 22 CtapGetAssertionRequest::EncodeAsCBOR() 23 CtapMakeCredentialRequest::EncodeAsCBOR() 24 PublicKeyCredentialDescriptor::ConvertToCBOR() 25 PublicKeyCredentialParams::ConvertToCBOR() 26 PublicKeyCredentialRpEntity::ConvertToCBOR() 27 PublicKeyCredentialUserEntity::ConvertToCBOR() 28 3. It also apply a patch from Chromium to CBORValue: 29 https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/ 30 31 Besides importing things from Chromium, it also implements UserVerificationRequirement for both 32 PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options 33 can specify more dimensions of a desired authenticator. 34 35 Covered by API tests. 36 37 * CMakeLists.txt: 38 * DerivedSources.make: 39 * Modules/webauthn/PublicKeyCredentialCreationOptions.h: 40 (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const): 41 (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode): 42 * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: 43 * Modules/webauthn/PublicKeyCredentialRequestOptions.h: 44 (WebCore::PublicKeyCredentialRequestOptions::encode const): 45 (WebCore::PublicKeyCredentialRequestOptions::decode): 46 * Modules/webauthn/PublicKeyCredentialRequestOptions.idl: 47 * Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl. 48 * Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl. 49 * Modules/webauthn/cbor/CBORValue.cpp: 50 (cbor::CBORValue::CBORValue): 51 (cbor::CBORValue::getBool const): 52 * Modules/webauthn/cbor/CBORValue.h: 53 * Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added. 54 (fido::toArrayValue): 55 (fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse): 56 (fido::AuthenticatorGetInfoResponse::setMaxMsgSize): 57 (fido::AuthenticatorGetInfoResponse::setPinProtocols): 58 (fido::AuthenticatorGetInfoResponse::setExtensions): 59 (fido::AuthenticatorGetInfoResponse::setOptions): 60 (fido::encodeAsCBOR): 61 * Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added. 62 * Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added. 63 (fido::AuthenticatorSupportedOptions::setSupportsResidentKey): 64 (fido::AuthenticatorSupportedOptions::setUserVerificationAvailability): 65 (fido::AuthenticatorSupportedOptions::setUserPresenceRequired): 66 (fido::AuthenticatorSupportedOptions::setClientPinAvailability): 67 (fido::AuthenticatorSupportedOptions::setIsPlatformDevice): 68 (fido::convertToCBOR): 69 * Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added. 70 * Modules/webauthn/fido/DeviceRequestConverter.cpp: Added. 71 (fido::convertRpEntityToCBOR): 72 (fido::convertUserEntityToCBOR): 73 (fido::convertParametersToCBOR): 74 (fido::convertDescriptorToCBOR): 75 (fido::encodeMakeCredenitalRequestAsCBOR): 76 (fido::encodeGetAssertionRequestAsCBOR): 77 (fido::encodeEmptyAuthenticatorRequest): 78 * Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h. 79 * Modules/webauthn/fido/DeviceResponseConverter.cpp: Added. 80 (fido::convertStringToProtocolVersion): 81 (fido::getResponseCode): 82 (fido::getCredentialId): 83 (fido::readCTAPMakeCredentialResponse): 84 (fido::readCTAPGetAssertionResponse): 85 (fido::readCTAPGetInfoResponse): 86 * Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp. 87 * Modules/webauthn/fido/FidoConstants.cpp: 88 (fido::isCtapDeviceResponseCode): 89 (fido::publicKeyCredentialTypeToString): 90 * Modules/webauthn/fido/FidoConstants.h: 91 * Sources.txt: 92 * WebCore.xcodeproj/project.pbxproj: 93 1 94 2018-11-07 Justin Michaud <justin_michaud@apple.com> 2 95 -
trunk/Source/WebCore/DerivedSources.make
r237981 r237983 359 359 $(WebCore)/Modules/webauthn/PublicKeyCredentialRequestOptions.idl \ 360 360 $(WebCore)/Modules/webauthn/PublicKeyCredentialType.idl \ 361 $(WebCore)/Modules/webauthn/UserVerificationRequirement.idl \ 361 362 $(WebCore)/Modules/webdatabase/DOMWindowWebDatabase.idl \ 362 363 $(WebCore)/Modules/webdatabase/Database.idl \ -
trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h
r237074 r237983 31 31 #include "PublicKeyCredentialDescriptor.h" 32 32 #include "PublicKeyCredentialType.h" 33 #include "UserVerificationRequirement.h" 33 34 #include <wtf/CrossThreadCopier.h> 34 35 #include <wtf/Forward.h> … … 66 67 67 68 struct AuthenticatorSelectionCriteria { 68 AuthenticatorAttachment authenticatorAttachment; 69 std::optional<AuthenticatorAttachment> authenticatorAttachment; 70 bool requireResidentKey { false }; 71 UserVerificationRequirement userVerification { UserVerificationRequirement::Preferred }; 69 72 70 73 template<class Encoder> void encode(Encoder&) const; … … 106 109 void PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode(Encoder& encoder) const 107 110 { 108 encoder << authenticatorAttachment ;111 encoder << authenticatorAttachment << requireResidentKey << userVerification; 109 112 } 110 113 … … 113 116 { 114 117 PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria result; 115 if (!decoder.decodeEnum(result.authenticatorAttachment)) 118 119 std::optional<std::optional<AuthenticatorAttachment>> authenticatorAttachment; 120 decoder >> authenticatorAttachment; 121 if (!authenticatorAttachment) 122 return std::nullopt; 123 result.authenticatorAttachment = WTFMove(*authenticatorAttachment); 124 125 std::optional<bool> requireResidentKey; 126 decoder >> requireResidentKey; 127 if (!requireResidentKey) 128 return std::nullopt; 129 result.requireResidentKey = *requireResidentKey; 130 131 if (!decoder.decodeEnum(result.userVerification)) 116 132 return std::nullopt; 117 133 return result; -
trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.idl
r236481 r237983 75 75 ] dictionary AuthenticatorSelectionCriteria { 76 76 AuthenticatorAttachment authenticatorAttachment; 77 // We don't allow RPs to set the following values at this stage. 78 // Hence, those options are always { true, "required" }. 79 // boolean requireResidentKey = false; 80 // UserVerificationRequirement userVerification = "preferred"; 77 boolean requireResidentKey = false; 78 UserVerificationRequirement userVerification = "preferred"; 81 79 }; 82 80 -
trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h
r236842 r237983 30 30 #include "BufferSource.h" 31 31 #include "PublicKeyCredentialDescriptor.h" 32 #include "UserVerificationRequirement.h" 32 33 #include <wtf/Forward.h> 33 34 … … 39 40 mutable String rpId; 40 41 Vector<PublicKeyCredentialDescriptor> allowCredentials; 42 UserVerificationRequirement userVerification { UserVerificationRequirement::Preferred }; 41 43 42 44 template<class Encoder> void encode(Encoder&) const; … … 48 50 void PublicKeyCredentialRequestOptions::encode(Encoder& encoder) const 49 51 { 50 encoder << timeout << rpId << allowCredentials ;52 encoder << timeout << rpId << allowCredentials << userVerification; 51 53 } 52 54 … … 66 68 if (!decoder.decode(result.allowCredentials)) 67 69 return std::nullopt; 70 71 std::optional<UserVerificationRequirement> userVerification; 72 decoder >> userVerification; 73 if (!userVerification) 74 return std::nullopt; 75 result.userVerification = WTFMove(*userVerification); 76 68 77 return result; 69 78 } -
trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl
r227764 r237983 31 31 USVString rpId; 32 32 sequence<PublicKeyCredentialDescriptor> allowCredentials = []; 33 // Always "required" at this stage 34 // UserVerificationRequirement userVerification = "preferred"; 33 UserVerificationRequirement userVerification = "preferred"; 35 34 // Not support yet. 36 35 // AuthenticationExtensions extensions; -
trunk/Source/WebCore/Modules/webauthn/UserVerificationRequirement.h
r237982 r237983 24 24 */ 25 25 26 [ 27 Conditional=WEB_AUTHN, 28 ] dictionary PublicKeyCredentialRequestOptions { 29 required BufferSource challenge; 30 unsigned long timeout; 31 USVString rpId; 32 sequence<PublicKeyCredentialDescriptor> allowCredentials = []; 33 // Always "required" at this stage 34 // UserVerificationRequirement userVerification = "preferred"; 35 // Not support yet. 36 // AuthenticationExtensions extensions; 26 #pragma once 27 28 #if ENABLE(WEB_AUTHN) 29 30 #include <wtf/EnumTraits.h> 31 32 namespace WebCore { 33 34 enum class UserVerificationRequirement { 35 Required, 36 Preferred, 37 Discouraged 37 38 }; 39 40 } // namespace WebCore 41 42 namespace WTF { 43 44 template<> struct EnumTraits<WebCore::UserVerificationRequirement> { 45 using values = EnumValues< 46 WebCore::UserVerificationRequirement, 47 WebCore::UserVerificationRequirement::Required, 48 WebCore::UserVerificationRequirement::Preferred, 49 WebCore::UserVerificationRequirement::Discouraged 50 >; 51 }; 52 53 } // namespace WTF 54 55 #endif // ENABLE(WEB_AUTHN) -
trunk/Source/WebCore/Modules/webauthn/UserVerificationRequirement.idl
r237982 r237983 26 26 [ 27 27 Conditional=WEB_AUTHN, 28 ] dictionary PublicKeyCredentialRequestOptions { 29 required BufferSource challenge; 30 unsigned long timeout; 31 USVString rpId; 32 sequence<PublicKeyCredentialDescriptor> allowCredentials = []; 33 // Always "required" at this stage 34 // UserVerificationRequirement userVerification = "preferred"; 35 // Not support yet. 36 // AuthenticationExtensions extensions; 28 ImplementedAs=UserVerificationRequirement 29 ] enum UserVerificationRequirement { 30 "required", 31 "preferred", 32 "discouraged" 37 33 }; -
trunk/Source/WebCore/Modules/webauthn/cbor/CBORValue.cpp
r235861 r237983 154 154 } 155 155 156 CBORValue::CBORValue(bool inBool) 157 : m_type(Type::SimpleValue) 158 { 159 m_simpleValue = inBool ? CBORValue::SimpleValue::TrueValue : CBORValue::SimpleValue::FalseValue; 160 } 161 156 162 CBORValue& CBORValue::operator=(CBORValue&& that) 157 163 { … … 241 247 } 242 248 249 bool CBORValue::getBool() const 250 { 251 ASSERT(isBool()); 252 return m_simpleValue == SimpleValue::TrueValue; 253 } 254 243 255 void CBORValue::internalMoveConstructFrom(CBORValue&& that) 244 256 { -
trunk/Source/WebCore/Modules/webauthn/cbor/CBORValue.h
r235861 r237983 139 139 140 140 explicit CBORValue(SimpleValue); 141 explicit CBORValue(bool); 141 142 142 143 CBORValue& operator=(CBORValue&&); … … 162 163 bool isMap() const { return type() == Type::Map; } 163 164 bool isSimple() const { return type() == Type::SimpleValue; } 165 bool isBool() const { return isSimple() && (m_simpleValue == SimpleValue::TrueValue || m_simpleValue == SimpleValue::FalseValue); } 164 166 165 167 // These will all fatally assert if the type doesn't match. 166 168 SimpleValue getSimpleValue() const; 169 bool getBool() const; 167 170 const int64_t& getInteger() const; 168 171 const int64_t& getUnsigned() const; -
trunk/Source/WebCore/Modules/webauthn/fido/DeviceRequestConverter.h
r237982 r237983 1 // Copyright 201 8The Chromium Authors. All rights reserved.1 // Copyright 2017 The Chromium Authors. All rights reserved. 2 2 // Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 // … … 32 32 #if ENABLE(WEB_AUTHN) 33 33 34 #include "AuthenticatorSupportedOptions.h" 35 #include "FidoConstants.h" 36 #include <wtf/Forward.h> 37 38 namespace WebCore { 39 struct PublicKeyCredentialCreationOptions; 40 struct PublicKeyCredentialRequestOptions; 41 } 42 34 43 namespace fido { 35 44 36 // Commands supported by CTAPHID device as specified in 37 // https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#ctaphid-commands 38 enum class FidoHidDeviceCommand : uint8_t { 39 kMsg = 0x03, 40 kCbor = 0x10, 41 kInit = 0x06, 42 kPing = 0x01, 43 kCancel = 0x11, 44 kError = 0x3F, 45 kKeepAlive = 0x3B, 46 kWink = 0x08, 47 kLock = 0x04, 48 }; 45 // Serializes MakeCredential request parameter into CBOR encoded map with 46 // integer keys and CBOR encoded values as defined by the CTAP spec. 47 // https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#authenticatorMakeCredential 48 WEBCORE_EXPORT Vector<uint8_t> encodeMakeCredenitalRequestAsCBOR(const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions&, AuthenticatorSupportedOptions::UserVerificationAvailability); 49 49 50 bool isFidoHidDeviceCommand(FidoHidDeviceCommand cmd); 50 // Serializes GetAssertion request parameter into CBOR encoded map with 51 // integer keys and CBOR encoded values as defined by the CTAP spec. 52 // https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#authenticatorGetAssertion 53 WEBCORE_EXPORT Vector<uint8_t> encodeGetAssertionRequestAsCBOR(const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions&, AuthenticatorSupportedOptions::UserVerificationAvailability); 51 54 52 // HID transport specific constants. 53 const size_t kHidPacketSize = 64; 54 const uint32_t kHidBroadcastChannel = 0xffffffff; 55 const size_t kHidInitPacketHeaderSize = 7; 56 const size_t kHidContinuationPacketHeader = 5; 57 const size_t kHidMaxPacketSize = 64; 58 const size_t kHidInitPacketDataSize = kHidMaxPacketSize - kHidInitPacketHeaderSize; 59 const size_t kHidContinuationPacketDataSize = kHidMaxPacketSize - kHidContinuationPacketHeader; 60 61 const uint8_t kHidMaxLockSeconds = 10; 62 63 // Messages are limited to an initiation packet and 128 continuation packets. 64 const size_t kHidMaxMessageSize = 7609; 55 // Represents CTAP requests with empty parameters, including 56 // AuthenticatorGetInfo, AuthenticatorCancel, AuthenticatorReset and 57 // AuthenticatorGetNextAssertion commands. 58 WEBCORE_EXPORT Vector<uint8_t> encodeEmptyAuthenticatorRequest(CtapRequestCommand); 65 59 66 60 } // namespace fido -
trunk/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h
r237982 r237983 28 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 #include "config.h" 31 #include "FidoConstants.h" 30 #pragma once 32 31 33 32 #if ENABLE(WEB_AUTHN) 34 33 34 #include "AuthenticatorGetInfoResponse.h" 35 #include "FidoConstants.h" 36 #include "PublicKeyCredentialData.h" 37 38 // Converts response from authenticators to CTAPResponse objects. If the 39 // response of the authenticator does not conform to format specified by the 40 // CTAP protocol, null optional is returned. 35 41 namespace fido { 36 42 37 bool isFidoHidDeviceCommand(FidoHidDeviceCommand cmd) 38 { 39 switch (cmd) { 40 case FidoHidDeviceCommand::kMsg: 41 case FidoHidDeviceCommand::kCbor: 42 case FidoHidDeviceCommand::kInit: 43 case FidoHidDeviceCommand::kPing: 44 case FidoHidDeviceCommand::kCancel: 45 case FidoHidDeviceCommand::kError: 46 case FidoHidDeviceCommand::kKeepAlive: 47 case FidoHidDeviceCommand::kWink: 48 case FidoHidDeviceCommand::kLock: 49 return true; 50 default: 51 return false; 52 } 53 } 43 // Parses response code from response received from the authenticator. If 44 // unknown response code value is received, then CTAP2_ERR_OTHER is returned. 45 WEBCORE_EXPORT CtapDeviceResponseCode getResponseCode(const Vector<uint8_t>&); 46 47 // De-serializes CBOR encoded response, checks for valid CBOR map formatting, 48 // and converts response to AuthenticatorMakeCredentialResponse object with 49 // CBOR map keys that conform to format of attestation object defined by the 50 // WebAuthN spec : https://w3c.github.io/webauthn/#fig-attStructs 51 WEBCORE_EXPORT std::optional<WebCore::PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vector<uint8_t>&); 52 53 // De-serializes CBOR encoded response to AuthenticatorGetAssertion / 54 // AuthenticatorGetNextAssertion request to AuthenticatorGetAssertionResponse 55 // object. 56 // FIXME(190783): Probably need to remake AuthenticatorResponse to include more fields like numberOfCredentials, 57 // and use it here instead of PublicKeyCredentialData. 58 WEBCORE_EXPORT std::optional<WebCore::PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector<uint8_t>&); 59 60 // De-serializes CBOR encoded response to AuthenticatorGetInfo request to 61 // AuthenticatorGetInfoResponse object. 62 WEBCORE_EXPORT std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector<uint8_t>&); 54 63 55 64 } // namespace fido -
trunk/Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp
r236976 r237983 34 34 35 35 namespace fido { 36 using namespace WebCore; 37 38 bool isCtapDeviceResponseCode(CtapDeviceResponseCode code) 39 { 40 switch (code) { 41 case CtapDeviceResponseCode::kSuccess: 42 case CtapDeviceResponseCode::kCtap1ErrInvalidCommand: 43 case CtapDeviceResponseCode::kCtap1ErrInvalidParameter: 44 case CtapDeviceResponseCode::kCtap1ErrInvalidLength: 45 case CtapDeviceResponseCode::kCtap1ErrInvalidSeq: 46 case CtapDeviceResponseCode::kCtap1ErrTimeout: 47 case CtapDeviceResponseCode::kCtap1ErrChannelBusy: 48 case CtapDeviceResponseCode::kCtap1ErrLockRequired: 49 case CtapDeviceResponseCode::kCtap1ErrInvalidChannel: 50 case CtapDeviceResponseCode::kCtap2ErrCBORParsing: 51 case CtapDeviceResponseCode::kCtap2ErrUnexpectedType: 52 case CtapDeviceResponseCode::kCtap2ErrInvalidCBOR: 53 case CtapDeviceResponseCode::kCtap2ErrInvalidCBORType: 54 case CtapDeviceResponseCode::kCtap2ErrMissingParameter: 55 case CtapDeviceResponseCode::kCtap2ErrLimitExceeded: 56 case CtapDeviceResponseCode::kCtap2ErrUnsupportedExtension: 57 case CtapDeviceResponseCode::kCtap2ErrTooManyElements: 58 case CtapDeviceResponseCode::kCtap2ErrExtensionNotSupported: 59 case CtapDeviceResponseCode::kCtap2ErrCredentialExcluded: 60 case CtapDeviceResponseCode::kCtap2ErrProcesssing: 61 case CtapDeviceResponseCode::kCtap2ErrInvalidCredential: 62 case CtapDeviceResponseCode::kCtap2ErrUserActionPending: 63 case CtapDeviceResponseCode::kCtap2ErrOperationPending: 64 case CtapDeviceResponseCode::kCtap2ErrNoOperations: 65 case CtapDeviceResponseCode::kCtap2ErrUnsupportedAlgorithms: 66 case CtapDeviceResponseCode::kCtap2ErrOperationDenied: 67 case CtapDeviceResponseCode::kCtap2ErrKeyStoreFull: 68 case CtapDeviceResponseCode::kCtap2ErrNotBusy: 69 case CtapDeviceResponseCode::kCtap2ErrNoOperationPending: 70 case CtapDeviceResponseCode::kCtap2ErrUnsupportedOption: 71 case CtapDeviceResponseCode::kCtap2ErrInvalidOption: 72 case CtapDeviceResponseCode::kCtap2ErrKeepAliveCancel: 73 case CtapDeviceResponseCode::kCtap2ErrNoCredentials: 74 case CtapDeviceResponseCode::kCtap2ErrUserActionTimeout: 75 case CtapDeviceResponseCode::kCtap2ErrNotAllowed: 76 case CtapDeviceResponseCode::kCtap2ErrPinInvalid: 77 case CtapDeviceResponseCode::kCtap2ErrPinBlocked: 78 case CtapDeviceResponseCode::kCtap2ErrPinAuthInvalid: 79 case CtapDeviceResponseCode::kCtap2ErrPinAuthBlocked: 80 case CtapDeviceResponseCode::kCtap2ErrPinNotSet: 81 case CtapDeviceResponseCode::kCtap2ErrPinRequired: 82 case CtapDeviceResponseCode::kCtap2ErrPinPolicyViolation: 83 case CtapDeviceResponseCode::kCtap2ErrPinTokenExpired: 84 case CtapDeviceResponseCode::kCtap2ErrRequestTooLarge: 85 case CtapDeviceResponseCode::kCtap2ErrOther: 86 case CtapDeviceResponseCode::kCtap2ErrSpecLast: 87 case CtapDeviceResponseCode::kCtap2ErrExtensionFirst: 88 case CtapDeviceResponseCode::kCtap2ErrExtensionLast: 89 case CtapDeviceResponseCode::kCtap2ErrVendorFirst: 90 case CtapDeviceResponseCode::kCtap2ErrVendorLast: 91 return true; 92 default: 93 return false; 94 } 95 } 36 96 37 97 bool isFidoHidDeviceCommand(FidoHidDeviceCommand cmd) … … 53 113 } 54 114 115 const char* publicKeyCredentialTypeToString(PublicKeyCredentialType type) 116 { 117 switch (type) { 118 case PublicKeyCredentialType::PublicKey: 119 return kPublicKey; 120 } 121 ASSERT_NOT_REACHED(); 122 return kPublicKey; 123 } 124 55 125 } // namespace fido 56 126 -
trunk/Source/WebCore/Modules/webauthn/fido/FidoConstants.h
r236976 r237983 32 32 #if ENABLE(WEB_AUTHN) 33 33 34 #include "PublicKeyCredentialType.h" 35 34 36 namespace fido { 37 38 enum class ProtocolVersion { 39 kCtap, 40 kU2f, 41 kUnknown, 42 }; 43 44 // Length of the SHA-256 hash of the RP ID asssociated with the credential: 45 // https://www.w3.org/TR/webauthn/#sec-authenticator-data 46 constexpr size_t kRpIdHashLength = 32; 47 48 // Length of the flags: 49 // https://www.w3.org/TR/webauthn/#sec-authenticator-data 50 constexpr size_t kFlagsLength = 1; 51 52 // Length of the signature counter, 32-bit unsigned big-endian integer: 53 // https://www.w3.org/TR/webauthn/#sec-authenticator-data 54 constexpr size_t kSignCounterLength = 4; 55 56 // Length of the AAGUID of the authenticator: 57 // https://www.w3.org/TR/webauthn/#sec-attested-credential-data 58 constexpr size_t kAaguidLength = 16; 59 60 // Length of the byte length L of Credential ID, 16-bit unsigned big-endian 61 // integer: https://www.w3.org/TR/webauthn/#sec-attested-credential-data 62 constexpr size_t kCredentialIdLengthLength = 2; 63 64 // CTAP protocol device response code, as specified in 65 // https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#error-responses 66 enum class CtapDeviceResponseCode : uint8_t { 67 kSuccess = 0x00, 68 kCtap1ErrInvalidCommand = 0x01, 69 kCtap1ErrInvalidParameter = 0x02, 70 kCtap1ErrInvalidLength = 0x03, 71 kCtap1ErrInvalidSeq = 0x04, 72 kCtap1ErrTimeout = 0x05, 73 kCtap1ErrChannelBusy = 0x06, 74 kCtap1ErrLockRequired = 0x0A, 75 kCtap1ErrInvalidChannel = 0x0B, 76 kCtap2ErrCBORParsing = 0x10, 77 kCtap2ErrUnexpectedType = 0x11, 78 kCtap2ErrInvalidCBOR = 0x12, 79 kCtap2ErrInvalidCBORType = 0x13, 80 kCtap2ErrMissingParameter = 0x14, 81 kCtap2ErrLimitExceeded = 0x15, 82 kCtap2ErrUnsupportedExtension = 0x16, 83 kCtap2ErrTooManyElements = 0x17, 84 kCtap2ErrExtensionNotSupported = 0x18, 85 kCtap2ErrCredentialExcluded = 0x19, 86 kCtap2ErrProcesssing = 0x21, 87 kCtap2ErrInvalidCredential = 0x22, 88 kCtap2ErrUserActionPending = 0x23, 89 kCtap2ErrOperationPending = 0x24, 90 kCtap2ErrNoOperations = 0x25, 91 kCtap2ErrUnsupportedAlgorithms = 0x26, 92 kCtap2ErrOperationDenied = 0x27, 93 kCtap2ErrKeyStoreFull = 0x28, 94 kCtap2ErrNotBusy = 0x29, 95 kCtap2ErrNoOperationPending = 0x2A, 96 kCtap2ErrUnsupportedOption = 0x2B, 97 kCtap2ErrInvalidOption = 0x2C, 98 kCtap2ErrKeepAliveCancel = 0x2D, 99 kCtap2ErrNoCredentials = 0x2E, 100 kCtap2ErrUserActionTimeout = 0x2F, 101 kCtap2ErrNotAllowed = 0x30, 102 kCtap2ErrPinInvalid = 0x31, 103 kCtap2ErrPinBlocked = 0x32, 104 kCtap2ErrPinAuthInvalid = 0x33, 105 kCtap2ErrPinAuthBlocked = 0x34, 106 kCtap2ErrPinNotSet = 0x35, 107 kCtap2ErrPinRequired = 0x36, 108 kCtap2ErrPinPolicyViolation = 0x37, 109 kCtap2ErrPinTokenExpired = 0x38, 110 kCtap2ErrRequestTooLarge = 0x39, 111 kCtap2ErrOther = 0x7F, 112 kCtap2ErrSpecLast = 0xDF, 113 kCtap2ErrExtensionFirst = 0xE0, 114 kCtap2ErrExtensionLast = 0xEF, 115 kCtap2ErrVendorFirst = 0xF0, 116 kCtap2ErrVendorLast = 0xFF 117 }; 118 119 bool isCtapDeviceResponseCode(CtapDeviceResponseCode); 35 120 36 121 // Commands supported by CTAPHID device as specified in … … 48 133 }; 49 134 50 bool isFidoHidDeviceCommand(FidoHidDeviceCommand cmd); 135 bool isFidoHidDeviceCommand(FidoHidDeviceCommand); 136 137 // String key values for CTAP request optional parameters and 138 // AuthenticatorGetInfo response. 139 const char kResidentKeyMapKey[] = "rk"; 140 const char kUserVerificationMapKey[] = "uv"; 141 const char kUserPresenceMapKey[] = "up"; 142 const char kClientPinMapKey[] = "clientPin"; 143 const char kPlatformDeviceMapKey[] = "plat"; 144 const char kEntityIdMapKey[] = "id"; 145 const char kEntityNameMapKey[] = "name"; 146 const char kDisplayNameMapKey[] = "displayName"; 147 const char kIconUrlMapKey[] = "icon"; 148 const char kCredentialTypeMapKey[] = "type"; 149 const char kCredentialAlgorithmMapKey[] = "alg"; 150 // Keys for storing credential descriptor information in CBOR map. 151 const char kCredentialIdKey[] = "id"; 152 const char kCredentialTypeKey[] = "type"; 51 153 52 154 // HID transport specific constants. … … 64 166 const size_t kHidMaxMessageSize = 7609; 65 167 168 // Authenticator API commands supported by CTAP devices, as specified in 169 // https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#authenticator-api 170 enum class CtapRequestCommand : uint8_t { 171 kAuthenticatorMakeCredential = 0x01, 172 kAuthenticatorGetAssertion = 0x02, 173 kAuthenticatorGetNextAssertion = 0x08, 174 kAuthenticatorGetInfo = 0x04, 175 kAuthenticatorClientPin = 0x06, 176 kAuthenticatorReset = 0x07, 177 }; 178 179 // String key values for attestation object as a response to MakeCredential 180 // request. 181 const char kFormatKey[] = "fmt"; 182 const char kAttestationStatementKey[] = "attStmt"; 183 const char kAuthDataKey[] = "authData"; 184 const char kNoneAttestationValue[] = "none"; 185 186 // String representation of public key credential enum. 187 // https://w3c.github.io/webauthn/#credentialType 188 const char kPublicKey[] = "public-key"; 189 190 const char* publicKeyCredentialTypeToString(WebCore::PublicKeyCredentialType); 191 192 // FIXME: Add url to the official spec once it's standardized. 193 const char kCtap2Version[] = "FIDO_2_0"; 194 const char kU2fVersion[] = "U2F_V2"; 195 66 196 } // namespace fido 67 197 -
trunk/Source/WebCore/Sources.txt
r237981 r237983 260 260 Modules/webauthn/cbor/CBORValue.cpp 261 261 Modules/webauthn/cbor/CBORWriter.cpp 262 Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp 263 Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp 264 Modules/webauthn/fido/DeviceRequestConverter.cpp 265 Modules/webauthn/fido/DeviceResponseConverter.cpp 262 266 Modules/webauthn/fido/FidoConstants.cpp 263 267 Modules/webauthn/fido/FidoHidMessage.cpp … … 3180 3184 JSUIEventInit.cpp 3181 3185 JSURLSearchParams.cpp 3186 JSUserVerificationRequirement.cpp 3182 3187 JSVRDisplay.cpp 3183 3188 JSVRDisplayCapabilities.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r237981 r237983 1768 1768 5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */; }; 1769 1769 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; }; 1770 572B401F21757A64000AD43E /* DeviceRequestConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B401D21757A64000AD43E /* DeviceRequestConverter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1771 572B402C21769020000AD43E /* JSUserVerificationRequirement.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B402A2176901F000AD43E /* JSUserVerificationRequirement.h */; }; 1772 572B40362176A922000AD43E /* UserVerificationRequirement.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B402321768D85000AD43E /* UserVerificationRequirement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1773 572B403A21772581000AD43E /* DeviceResponseConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B40372177256C000AD43E /* DeviceResponseConverter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1774 572B404021780171000AD43E /* AuthenticatorSupportedOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B403E21780170000AD43E /* AuthenticatorSupportedOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1775 572B40422178114A000AD43E /* AuthenticatorGetInfoResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 572B403C2177FB61000AD43E /* AuthenticatorGetInfoResponse.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1770 1776 57303BB92006C6EE00355965 /* CBORValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BB42006C6ED00355965 /* CBORValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1771 1777 57303BBA2006C6EE00355965 /* CBORWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 57303BB52006C6ED00355965 /* CBORWriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 8617 8623 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; }; 8618 8624 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; }; 8625 572B401D21757A64000AD43E /* DeviceRequestConverter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeviceRequestConverter.h; sourceTree = "<group>"; }; 8626 572B401E21757A64000AD43E /* DeviceRequestConverter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceRequestConverter.cpp; sourceTree = "<group>"; }; 8627 572B402321768D85000AD43E /* UserVerificationRequirement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserVerificationRequirement.h; sourceTree = "<group>"; }; 8628 572B402521768D85000AD43E /* UserVerificationRequirement.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = UserVerificationRequirement.idl; sourceTree = "<group>"; }; 8629 572B402A2176901F000AD43E /* JSUserVerificationRequirement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUserVerificationRequirement.h; sourceTree = "<group>"; }; 8630 572B402B2176901F000AD43E /* JSUserVerificationRequirement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUserVerificationRequirement.cpp; sourceTree = "<group>"; }; 8631 572B40372177256C000AD43E /* DeviceResponseConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceResponseConverter.h; sourceTree = "<group>"; }; 8632 572B40382177256C000AD43E /* DeviceResponseConverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceResponseConverter.cpp; sourceTree = "<group>"; }; 8633 572B403B2177FB60000AD43E /* AuthenticatorGetInfoResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticatorGetInfoResponse.cpp; sourceTree = "<group>"; }; 8634 572B403C2177FB61000AD43E /* AuthenticatorGetInfoResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticatorGetInfoResponse.h; sourceTree = "<group>"; }; 8635 572B403D2178016F000AD43E /* AuthenticatorSupportedOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticatorSupportedOptions.cpp; sourceTree = "<group>"; }; 8636 572B403E21780170000AD43E /* AuthenticatorSupportedOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticatorSupportedOptions.h; sourceTree = "<group>"; }; 8619 8637 57303BB42006C6ED00355965 /* CBORValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORValue.h; sourceTree = "<group>"; }; 8620 8638 57303BB52006C6ED00355965 /* CBORWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBORWriter.h; sourceTree = "<group>"; }; … … 19207 19225 isa = PBXGroup; 19208 19226 children = ( 19227 572B403B2177FB60000AD43E /* AuthenticatorGetInfoResponse.cpp */, 19228 572B403C2177FB61000AD43E /* AuthenticatorGetInfoResponse.h */, 19229 572B403D2178016F000AD43E /* AuthenticatorSupportedOptions.cpp */, 19230 572B403E21780170000AD43E /* AuthenticatorSupportedOptions.h */, 19231 572B401E21757A64000AD43E /* DeviceRequestConverter.cpp */, 19232 572B401D21757A64000AD43E /* DeviceRequestConverter.h */, 19233 572B40382177256C000AD43E /* DeviceResponseConverter.cpp */, 19234 572B40372177256C000AD43E /* DeviceResponseConverter.h */, 19209 19235 57BAF2872167D2F7008E954E /* FidoConstants.cpp */, 19210 19236 578A4C0B2167D29600D08F34 /* FidoConstants.h */, … … 19286 19312 57303BEA20097F4000355965 /* PublicKeyCredentialType.h */, 19287 19313 57303BF02009846100355965 /* PublicKeyCredentialType.idl */, 19314 572B402321768D85000AD43E /* UserVerificationRequirement.h */, 19315 572B402521768D85000AD43E /* UserVerificationRequirement.idl */, 19288 19316 ); 19289 19317 path = webauthn; … … 19311 19339 57303BFA2009913500355965 /* JSPublicKeyCredentialType.cpp */, 19312 19340 57303BF92009913400355965 /* JSPublicKeyCredentialType.h */, 19341 572B402B2176901F000AD43E /* JSUserVerificationRequirement.cpp */, 19342 572B402A2176901F000AD43E /* JSUserVerificationRequirement.h */, 19313 19343 ); 19314 19344 name = WebAuthN; … … 27831 27861 57303C4620105D2F00355965 /* AuthenticatorCoordinator.h in Headers */, 27832 27862 5760827220215A5500116678 /* AuthenticatorCoordinatorClient.h in Headers */, 27863 572B40422178114A000AD43E /* AuthenticatorGetInfoResponse.h in Headers */, 27833 27864 57303BD220087A8300355965 /* AuthenticatorResponse.h in Headers */, 27865 572B404021780171000AD43E /* AuthenticatorSupportedOptions.h in Headers */, 27834 27866 57DCED9021487FF70016B847 /* AuthenticatorTransport.h in Headers */, 27835 27867 A501920E132EBF2E008BFE55 /* Autocapitalize.h in Headers */, … … 28354 28386 590E1B4911E4EF4B0069F784 /* DeviceOrientationData.h in Headers */, 28355 28387 59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */, 28388 572B401F21757A64000AD43E /* DeviceRequestConverter.h in Headers */, 28389 572B403A21772581000AD43E /* DeviceResponseConverter.h in Headers */, 28356 28390 267725FD1A5B3AD9003C24DD /* DFA.h in Headers */, 28357 28391 5CD9F5661AA0F73C00DA45FF /* DFABytecode.h in Headers */, … … 29838 29872 7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */, 29839 29873 7C73FB0D191EF5A8007DE061 /* JSUserMessageHandlersNamespace.h in Headers */, 29874 572B402C21769020000AD43E /* JSUserVerificationRequirement.h in Headers */, 29840 29875 15C77093100D3CA8005BA267 /* JSValidityState.h in Headers */, 29841 29876 BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */, … … 31495 31530 BC8BF15A1058141800A40A07 /* UserStyleSheetTypes.h in Headers */, 31496 31531 BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */, 31532 572B40362176A922000AD43E /* UserVerificationRequirement.h in Headers */, 31497 31533 55AF14E61EAAC59B0026EEAA /* UTIRegistry.h in Headers */, 31498 31534 1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */, -
trunk/Tools/ChangeLog
r237972 r237983 1 2018-11-08 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] Import CTAP device request/response converters from Chromium 4 https://bugs.webkit.org/show_bug.cgi?id=190784 5 <rdar://problem/45460333> 6 7 Reviewed by Brent Fulgham. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebCore/CBORValueTest.cpp: 11 (TestWebKitAPI::TEST): 12 * TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp: Added. 13 (TestWebKitAPI::TEST): 14 * TestWebKitAPI/Tests/WebCore/CtapResponseTest.cpp: Added. 15 (TestWebKitAPI::getTestCorruptedSignResponse): 16 (TestWebKitAPI::getTestCredentialRawIdBytes): 17 (TestWebKitAPI::convertToVector): 18 (TestWebKitAPI::TEST): 19 * TestWebKitAPI/Tests/WebCore/FidoTestData.h: Added. 20 1 21 2018-11-07 Caio Lima <ticaiolima@gmail.com> 2 22 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r237969 r237983 247 247 5714ECBD1CA8C22A00051AC8 /* DownloadRequestOriginalURL2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */; }; 248 248 571F7FD01F2961FB00946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal in Copy Resources */ = {isa = PBXBuildFile; fileRef = 571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */; }; 249 572B403421769A88000AD43E /* CtapRequestTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B403321769A88000AD43E /* CtapRequestTest.cpp */; }; 250 572B404421781B43000AD43E /* CtapResponseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B404321781B42000AD43E /* CtapResponseTest.cpp */; }; 249 251 57303BC9200824D300355965 /* CBORValueTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAC2006C56000355965 /* CBORValueTest.cpp */; }; 250 252 57303BCA20082C0100355965 /* CBORWriterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAB2006C55400355965 /* CBORWriterTest.cpp */; }; … … 1562 1564 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURL2.html; sourceTree = "<group>"; }; 1563 1565 571F7FCF1F2961E100946648 /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal"; sourceTree = "<group>"; }; 1566 572B403321769A88000AD43E /* CtapRequestTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CtapRequestTest.cpp; sourceTree = "<group>"; }; 1567 572B40352176A029000AD43E /* FidoTestData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FidoTestData.h; sourceTree = "<group>"; }; 1568 572B404321781B42000AD43E /* CtapResponseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CtapResponseTest.cpp; sourceTree = "<group>"; }; 1564 1569 57303BAB2006C55400355965 /* CBORWriterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORWriterTest.cpp; sourceTree = "<group>"; }; 1565 1570 57303BAC2006C56000355965 /* CBORValueTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORValueTest.cpp; sourceTree = "<group>"; }; … … 2553 2558 7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */, 2554 2559 CD5451E919E41F9D0016936F /* CSSParser.cpp */, 2560 572B403321769A88000AD43E /* CtapRequestTest.cpp */, 2561 572B404321781B42000AD43E /* CtapResponseTest.cpp */, 2555 2562 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */, 2556 2563 260BA57A1B1D2EE2004FA07C /* DFAHelpers.h */, … … 2558 2565 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */, 2559 2566 579651E6216BFD53006EBFE5 /* FidoHidMessageTest.cpp */, 2567 572B40352176A029000AD43E /* FidoTestData.h */, 2560 2568 7A32D7491F02151500162C44 /* FileMonitor.cpp */, 2561 2569 41973B5A1AF2286A006C7B36 /* FileSystem.cpp */, … … 3793 3801 7AEAD47F1E20116C00416EFE /* CrossPartitionFileSchemeAccess.mm in Sources */, 3794 3802 7CCE7EDB1A411A9200447C4C /* CSSParser.cpp in Sources */, 3803 572B403421769A88000AD43E /* CtapRequestTest.cpp in Sources */, 3804 572B404421781B43000AD43E /* CtapResponseTest.cpp in Sources */, 3795 3805 7AC7B57020D9BA5B002C09A0 /* CustomBundleObject.mm in Sources */, 3796 3806 7AC7B56D20D9769F002C09A0 /* CustomBundleParameter.mm in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORValueTest.cpp
r235861 r237983 149 149 } 150 150 151 TEST(CBORValueTest, ConstructSimpleBooleanValue) 152 { 153 CBORValue trueValue(true); 154 ASSERT_EQ(CBORValue::Type::SimpleValue, trueValue.type()); 155 EXPECT_TRUE(trueValue.getBool()); 156 157 CBORValue falseValue(false); 158 ASSERT_EQ(CBORValue::Type::SimpleValue, falseValue.type()); 159 EXPECT_FALSE(falseValue.getBool()); 160 } 161 151 162 // Test copy constructors 152 163 TEST(CBORValueTest, CopyUnsigned)
Note: See TracChangeset
for help on using the changeset viewer.