diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-27 09:35:09 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-29 07:57:50 +0000 |
commit | 4a996760680eb99732d172463b2a8288e67c8cc0 (patch) | |
tree | ad02255eca444d4829c9b3a8fc8f250016ae1478 | |
parent | 16ec5f179eb828ca6995d61eaa91a48353217626 (diff) | |
download | qtwebengine-chromium-4a996760680eb99732d172463b2a8288e67c8cc0.tar.gz |
Fix building FIDO with gcc5
Change-Id: I007de1b12ddb952516f373360da29e58c13850b2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/components/cbor/values.h | 20 | ||||
-rw-r--r-- | chromium/device/fido/authenticator_get_info_response.cc | 2 | ||||
-rw-r--r-- | chromium/device/fido/authenticator_make_credential_response.cc | 4 | ||||
-rw-r--r-- | chromium/device/fido/bio/enrollment.cc | 18 | ||||
-rw-r--r-- | chromium/device/fido/ble/fido_ble_connection.cc | 4 | ||||
-rw-r--r-- | chromium/device/fido/cable/fido_cable_handshake_handler.cc | 4 | ||||
-rw-r--r-- | chromium/device/fido/credential_management.cc | 6 | ||||
-rw-r--r-- | chromium/device/fido/ctap_make_credential_request.cc | 2 | ||||
-rw-r--r-- | chromium/device/fido/pin.cc | 6 | ||||
-rw-r--r-- | chromium/device/fido/public_key_credential_rp_entity.cc | 6 | ||||
-rw-r--r-- | chromium/device/fido/public_key_credential_user_entity.cc | 8 | ||||
-rw-r--r-- | chromium/device/fido/virtual_ctap2_device.cc | 14 |
12 files changed, 47 insertions, 47 deletions
diff --git a/chromium/components/cbor/values.h b/chromium/components/cbor/values.h index f7b99604d21..69bd59e1e81 100644 --- a/chromium/components/cbor/values.h +++ b/chromium/components/cbor/values.h @@ -117,22 +117,22 @@ class CBOR_EXPORT Value { explicit Value(SimpleValue in_simple); explicit Value(bool boolean_value); - explicit Value(int integer_value); - explicit Value(int64_t integer_value); - explicit Value(uint64_t integer_value) = delete; + Value(int integer_value); + Value(int64_t integer_value); + Value(uint64_t integer_value) = delete; - explicit Value(base::span<const uint8_t> in_bytes); - explicit Value(BinaryValue&& in_bytes) noexcept; + Value(base::span<const uint8_t> in_bytes); + Value(BinaryValue&& in_bytes) noexcept; - explicit Value(const char* in_string, Type type = Type::STRING); - explicit Value(std::string&& in_string, Type type = Type::STRING) noexcept; - explicit Value(base::StringPiece in_string, Type type = Type::STRING); + Value(const char* in_string, Type type = Type::STRING); + Value(std::string&& in_string, Type type = Type::STRING) noexcept; + Value(base::StringPiece in_string, Type type = Type::STRING); explicit Value(const ArrayValue& in_array); - explicit Value(ArrayValue&& in_array) noexcept; + Value(ArrayValue&& in_array) noexcept; explicit Value(const MapValue& in_map); - explicit Value(MapValue&& in_map) noexcept; + Value(MapValue&& in_map) noexcept; Value& operator=(Value&& that) noexcept; diff --git a/chromium/device/fido/authenticator_get_info_response.cc b/chromium/device/fido/authenticator_get_info_response.cc index a5fdbd940db..09c87a7f5cc 100644 --- a/chromium/device/fido/authenticator_get_info_response.cc +++ b/chromium/device/fido/authenticator_get_info_response.cc @@ -53,7 +53,7 @@ std::vector<uint8_t> AuthenticatorGetInfoResponse::EncodeToCBOR( if (response.extensions) device_info_map.emplace(2, ToArrayValue(*response.extensions)); - device_info_map.emplace(3, response.aaguid); + device_info_map.emplace(3, cbor::Value(response.aaguid)); device_info_map.emplace(4, AsCBOR(response.options)); if (response.max_msg_size) { diff --git a/chromium/device/fido/authenticator_make_credential_response.cc b/chromium/device/fido/authenticator_make_credential_response.cc index 8022cb3e027..4dc11ce611b 100644 --- a/chromium/device/fido/authenticator_make_credential_response.cc +++ b/chromium/device/fido/authenticator_make_credential_response.cc @@ -104,8 +104,8 @@ std::vector<uint8_t> AsCTAPStyleCBORBytes( const AuthenticatorMakeCredentialResponse& response) { const AttestationObject& object = response.attestation_object(); cbor::Value::MapValue map; - map.emplace(1, object.attestation_statement().format_name()); - map.emplace(2, object.authenticator_data().SerializeToByteArray()); + map.emplace(1, cbor::Value(object.attestation_statement().format_name())); + map.emplace(2, cbor::Value(object.authenticator_data().SerializeToByteArray())); map.emplace(3, AsCBOR(object.attestation_statement())); auto encoded_bytes = cbor::Writer::Write(cbor::Value(std::move(map))); DCHECK(encoded_bytes); diff --git a/chromium/device/fido/bio/enrollment.cc b/chromium/device/fido/bio/enrollment.cc index a1749e35d06..bc465f990f5 100644 --- a/chromium/device/fido/bio/enrollment.cc +++ b/chromium/device/fido/bio/enrollment.cc @@ -96,10 +96,10 @@ BioEnrollmentRequest BioEnrollmentRequest::ForRename( request.params = cbor::Value::MapValue(); request.params->emplace( static_cast<int>(BioEnrollmentSubCommandParam::kTemplateId), - std::move(id)); + cbor::Value(std::move(id))); request.params->emplace( static_cast<int>(BioEnrollmentSubCommandParam::kTemplateFriendlyName), - std::move(name)); + cbor::Value(std::move(name))); SetPinAuth(&request, token); return request; } @@ -114,7 +114,7 @@ BioEnrollmentRequest BioEnrollmentRequest::ForDelete( request.params = cbor::Value::MapValue(); request.params->emplace( static_cast<int>(BioEnrollmentSubCommandParam::kTemplateId), - std::move(id)); + cbor::Value(std::move(id))); SetPinAuth(&request, token); return request; } @@ -275,28 +275,28 @@ AsCTAPRequestValuePair(const BioEnrollmentRequest& request) { if (request.modality) { map.emplace(static_cast<int>(Key::kModality), - static_cast<int>(*request.modality)); + cbor::Value(static_cast<int>(*request.modality))); } if (request.subcommand) { map.emplace(static_cast<int>(Key::kSubCommand), - static_cast<int>(*request.subcommand)); + cbor::Value(static_cast<int>(*request.subcommand))); } if (request.params) { - map.emplace(static_cast<int>(Key::kSubCommandParams), *request.params); + map.emplace(static_cast<int>(Key::kSubCommandParams), cbor::Value(*request.params)); } if (request.pin_protocol) { - map.emplace(static_cast<int>(Key::kPinProtocol), *request.pin_protocol); + map.emplace(static_cast<int>(Key::kPinProtocol), cbor::Value(*request.pin_protocol)); } if (request.pin_auth) { - map.emplace(static_cast<int>(Key::kPinAuth), *request.pin_auth); + map.emplace(static_cast<int>(Key::kPinAuth), cbor::Value(*request.pin_auth)); } if (request.get_modality) { - map.emplace(static_cast<int>(Key::kGetModality), *request.get_modality); + map.emplace(static_cast<int>(Key::kGetModality), cbor::Value(*request.get_modality)); } return {request.version == BioEnrollmentRequest::Version::kDefault diff --git a/chromium/device/fido/ble/fido_ble_connection.cc b/chromium/device/fido/ble/fido_ble_connection.cc index 03b58d6ecbf..8e52a8eca75 100644 --- a/chromium/device/fido/ble/fido_ble_connection.cc +++ b/chromium/device/fido/ble/fido_ble_connection.cc @@ -49,7 +49,7 @@ constexpr const char* ToString(BluetoothDevice::ConnectErrorCode error_code) { case BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: return "ERROR_UNSUPPORTED_DEVICE"; default: - NOTREACHED(); +// NOTREACHED(); return ""; } } @@ -73,7 +73,7 @@ constexpr const char* ToString(BluetoothGattService::GattErrorCode error_code) { case BluetoothGattService::GATT_ERROR_NOT_SUPPORTED: return "GATT_ERROR_NOT_SUPPORTED"; default: - NOTREACHED(); +// NOTREACHED(); return ""; } } diff --git a/chromium/device/fido/cable/fido_cable_handshake_handler.cc b/chromium/device/fido/cable/fido_cable_handshake_handler.cc index c7c26ea52b9..8af3d360b4e 100644 --- a/chromium/device/fido/cable/fido_cable_handshake_handler.cc +++ b/chromium/device/fido/cable/fido_cable_handshake_handler.cc @@ -49,8 +49,8 @@ base::Optional<std::array<uint8_t, kClientHelloMessageSize>> ConstructHandshakeMessage(base::StringPiece handshake_key, base::span<const uint8_t, 16> client_random_nonce) { cbor::Value::MapValue map; - map.emplace(0, kCableClientHelloMessage); - map.emplace(1, client_random_nonce); + map.emplace(0, cbor::Value(kCableClientHelloMessage)); + map.emplace(1, cbor::Value(client_random_nonce)); auto client_hello = cbor::Writer::Write(cbor::Value(std::move(map))); DCHECK(client_hello); diff --git a/chromium/device/fido/credential_management.cc b/chromium/device/fido/credential_management.cc index f4ecbba251b..bdae2942467 100644 --- a/chromium/device/fido/credential_management.cc +++ b/chromium/device/fido/credential_management.cc @@ -88,7 +88,7 @@ CredentialManagementRequest::ForEnumerateCredentialsBegin( cbor::Value::MapValue params_map; params_map.emplace( static_cast<int>(CredentialManagementRequestParamKey::kRPIDHash), - std::move(rp_id_hash)); + cbor::Value(std::move(rp_id_hash))); base::Optional<std::vector<uint8_t>> pin_auth_bytes = cbor::Writer::Write(cbor::Value(params_map)); DCHECK(pin_auth_bytes); @@ -363,7 +363,7 @@ AsCTAPRequestValuePair(const CredentialManagementRequest& request) { if (request.params) { request_map.emplace( static_cast<int>(CredentialManagementRequestKey::kSubCommandParams), - *request.params); + cbor::Value(*request.params)); } if (request.pin_auth) { request_map.emplace( @@ -371,7 +371,7 @@ AsCTAPRequestValuePair(const CredentialManagementRequest& request) { static_cast<int>(pin::kProtocolVersion)); request_map.emplace( static_cast<int>(CredentialManagementRequestKey::kPinAuth), - *request.pin_auth); + cbor::Value(*request.pin_auth)); } return {request.version == CredentialManagementRequest::kPreview ? CtapRequestCommand::kAuthenticatorCredentialManagementPreview diff --git a/chromium/device/fido/ctap_make_credential_request.cc b/chromium/device/fido/ctap_make_credential_request.cc index 5eb8751275b..034d9b3d4ab 100644 --- a/chromium/device/fido/ctap_make_credential_request.cc +++ b/chromium/device/fido/ctap_make_credential_request.cc @@ -64,7 +64,7 @@ AsCTAPRequestValuePair(const CtapMakeCredentialRequest& request) { if (request.cred_protect) { extensions.emplace(kExtensionCredProtect, - static_cast<uint8_t>(request.cred_protect->first)); + cbor::Value(static_cast<uint8_t>(request.cred_protect->first))); } if (!extensions.empty()) { diff --git a/chromium/device/fido/pin.cc b/chromium/device/fido/pin.cc index e469afe1d6f..9c810522a0e 100644 --- a/chromium/device/fido/pin.cc +++ b/chromium/device/fido/pin.cc @@ -62,9 +62,9 @@ EncodePINCommand( Subcommand subcommand, std::function<void(cbor::Value::MapValue*)> add_additional = nullptr) { cbor::Value::MapValue map; - map.emplace(static_cast<int>(RequestKey::kProtocol), kProtocolVersion); + map.emplace(static_cast<int>(RequestKey::kProtocol), cbor::Value(kProtocolVersion)); map.emplace(static_cast<int>(RequestKey::kSubcommand), - static_cast<int>(subcommand)); + cbor::Value(static_cast<int>(subcommand))); if (add_additional) { add_additional(&map); @@ -474,7 +474,7 @@ AsCTAPRequestValuePair(const TokenRequest& request) { Subcommand::kGetPINToken, [&request, &encrypted_pin](cbor::Value::MapValue* map) { map->emplace(static_cast<int>(RequestKey::kKeyAgreement), - std::move(request.cose_key_)); + cbor::Value(std::move(request.cose_key_))); map->emplace( static_cast<int>(RequestKey::kPINHashEnc), base::span<const uint8_t>(encrypted_pin, sizeof(encrypted_pin))); diff --git a/chromium/device/fido/public_key_credential_rp_entity.cc b/chromium/device/fido/public_key_credential_rp_entity.cc index fff599edd3a..e82e557dff8 100644 --- a/chromium/device/fido/public_key_credential_rp_entity.cc +++ b/chromium/device/fido/public_key_credential_rp_entity.cc @@ -78,12 +78,12 @@ bool PublicKeyCredentialRpEntity::operator==( cbor::Value AsCBOR(const PublicKeyCredentialRpEntity& entity) { cbor::Value::MapValue rp_map; - rp_map.emplace(kEntityIdMapKey, entity.id); + rp_map.emplace(kEntityIdMapKey, cbor::Value(entity.id)); if (entity.name) - rp_map.emplace(kEntityNameMapKey, *entity.name); + rp_map.emplace(kEntityNameMapKey, cbor::Value(*entity.name)); if (entity.icon_url) - rp_map.emplace(kIconUrlMapKey, entity.icon_url->spec()); + rp_map.emplace(kIconUrlMapKey, cbor::Value(entity.icon_url->spec())); return cbor::Value(std::move(rp_map)); } diff --git a/chromium/device/fido/public_key_credential_user_entity.cc b/chromium/device/fido/public_key_credential_user_entity.cc index a2a446e0f78..e0abad1c750 100644 --- a/chromium/device/fido/public_key_credential_user_entity.cc +++ b/chromium/device/fido/public_key_credential_user_entity.cc @@ -92,14 +92,14 @@ bool PublicKeyCredentialUserEntity::operator==( cbor::Value AsCBOR(const PublicKeyCredentialUserEntity& user) { cbor::Value::MapValue user_map; - user_map.emplace(kEntityIdMapKey, user.id); + user_map.emplace(kEntityIdMapKey, cbor::Value(user.id)); if (user.name) - user_map.emplace(kEntityNameMapKey, *user.name); + user_map.emplace(kEntityNameMapKey, cbor::Value(*user.name)); // Empty icon URLs result in CTAP1_ERR_INVALID_LENGTH on some security keys. if (user.icon_url && !user.icon_url->is_empty()) - user_map.emplace(kIconUrlMapKey, user.icon_url->spec()); + user_map.emplace(kIconUrlMapKey, cbor::Value(user.icon_url->spec())); if (user.display_name) - user_map.emplace(kDisplayNameMapKey, *user.display_name); + user_map.emplace(kDisplayNameMapKey, cbor::Value(*user.display_name)); return cbor::Value(std::move(user_map)); } diff --git a/chromium/device/fido/virtual_ctap2_device.cc b/chromium/device/fido/virtual_ctap2_device.cc index cff67c84ba2..711b48b994f 100644 --- a/chromium/device/fido/virtual_ctap2_device.cc +++ b/chromium/device/fido/virtual_ctap2_device.cc @@ -440,13 +440,13 @@ base::Optional<cbor::Value> RpEntityAsCBOR( } cbor::Value::MapValue rp_map; - rp_map.emplace(kEntityIdMapKey, rp.id); + rp_map.emplace(kEntityIdMapKey, cbor::Value(rp.id)); if (rp.name) { rp_map.emplace(kEntityNameMapKey, cbor::Value::InvalidUTF8StringValueForTesting(*rp.name)); } if (rp.icon_url) { - rp_map.emplace(kIconUrlMapKey, rp.icon_url->spec()); + rp_map.emplace(kIconUrlMapKey, cbor::Value(rp.icon_url->spec())); } return cbor::Value(std::move(rp_map)); } @@ -461,14 +461,14 @@ base::Optional<cbor::Value> UserEntityAsCBOR( } cbor::Value::MapValue user_map; - user_map.emplace(kEntityIdMapKey, user.id); + user_map.emplace(kEntityIdMapKey, cbor::Value(user.id)); if (user.name) { user_map.emplace(kEntityNameMapKey, cbor::Value::InvalidUTF8StringValueForTesting(*user.name)); } // Empty icon URLs result in CTAP1_ERR_INVALID_LENGTH on some security keys. if (user.icon_url && !user.icon_url->is_empty()) { - user_map.emplace(kIconUrlMapKey, user.icon_url->spec()); + user_map.emplace(kIconUrlMapKey, cbor::Value(user.icon_url->spec())); } if (user.display_name) { user_map.emplace( @@ -494,7 +494,7 @@ std::vector<uint8_t> EncodeGetAssertionResponse( } response_map.emplace(2, response.auth_data().SerializeToByteArray()); - response_map.emplace(3, response.signature()); + response_map.emplace(3, cbor::Value(response.signature())); if (response.user_entity()) { response_map.emplace( @@ -1722,8 +1722,8 @@ void VirtualCtap2Device::GetNextRP(cbor::Value::MapValue* response_map) { config_.allow_invalid_utf8_in_credential_entities)); response_map->emplace( static_cast<int>(CredentialManagementResponseKey::kRPIDHash), - fido_parsing_utils::CreateSHA256Hash( - mutable_state()->pending_rps.front().id)); + cbor::Value(fido_parsing_utils::CreateSHA256Hash( + mutable_state()->pending_rps.front().id))); mutable_state()->pending_rps.pop_front(); } |