New issue
Advanced search Search tips

Issue 838923 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[fido] Use std::array<uint8_t, N> and base::span<const uint8_t, N> for fixed size containers

Project Member Reported by jdoerrie@chromium.org, May 2 2018

Issue description

Currently almost all byte containers in //device/fido are implemented using either std::vector<uint8_t> or and base::span<const uint8_t> for read-only views. However, many of these containers are fixed-size, and an std::array would be more appropriate. With the introduction of static base::spans in r555333 it is now also feasible to pass fixed-size views around, without introducing unnecessary copies.

This is a tracking bug for the migration from std::vector<uint8_t> and base::span<const uint8_t> to std::array<uint8_t, N> and base::span<const uint8_t, N> where appropriate.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b5384426df4a1d47c2438e7671b3469319ca93fc

commit b5384426df4a1d47c2438e7671b3469319ca93fc
Author: jdoerrie <jdoerrie@chromium.org>
Date: Thu Jun 14 21:22:19 2018

[fido] Use std::array for static sized containers

This change replaces a few contant sized vectors with their std::array
equivalent. Furthermore, function parameters are updated to take static
base::spans, as this allows for greater flexibility and more efficiency,
even for temporary values.

Bug:  838923 
Change-Id: I41ea47ad757aec0740adb2b71f72fd80b558e1e9
Reviewed-on: https://chromium-review.googlesource.com/1039748
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567423}
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/components/cbor/cbor_values.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/components/cbor/cbor_values.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/content/browser/webauth/authenticator_impl.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/content/browser/webauth/virtual_authenticator.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/attestation_object.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/attested_credential_data.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/attested_credential_data.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_data.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_data.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_get_assertion_response.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_get_assertion_response.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_make_credential_response.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/authenticator_make_credential_response.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_get_assertion_request.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_get_assertion_request.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_make_credential_request.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_make_credential_request.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_request_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_response_fuzzer.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/ctap_response_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_attestation_statement.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_constants.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_constants.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_parsing_utils.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_parsing_utils.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/fido_parsing_utils_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/get_assertion_handler_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/get_assertion_task_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/mac/get_assertion_operation_unittest_mac.mm
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/mac/make_credential_operation_unittest_mac.mm
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/mac/util.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/mac/util.mm
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/make_credential_handler_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/make_credential_task_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/response_data.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/response_data.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_command_constructor.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_command_constructor.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_command_constructor_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_register_operation_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_sign_operation.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/u2f_sign_operation_unittest.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/virtual_fido_device.cc
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/virtual_fido_device.h
[modify] https://crrev.com/b5384426df4a1d47c2438e7671b3469319ca93fc/device/fido/virtual_u2f_device.cc

Status: Fixed (was: Started)

Sign in to add a comment