Commit 43debfd7 authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

device/fido: fix attestation format used in Touch ID

TouchIdAuthenticator was using FidoAttestationStatement, which is
fido-u2f, when it should have been using packed format. This adds a
PackedAttestationStatement class and changes the Touch ID code to use
it.

Bug: 868571, 678128
Change-Id: I84626df6299d4d9df44500dcbbba365e9a30f2a2
Reviewed-on: https://chromium-review.googlesource.com/1153849
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: default avatarKim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579131}
parent e9a92274
...@@ -64,6 +64,7 @@ test("device_unittests") { ...@@ -64,6 +64,7 @@ test("device_unittests") {
"bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc", "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc",
"bluetooth/test/test_bluetooth_local_gatt_service_delegate.h", "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h",
"bluetooth/uribeacon/uri_encoder_unittest.cc", "bluetooth/uribeacon/uri_encoder_unittest.cc",
"fido/attestation_statement_formats_unittest.cc",
"fido/ble/fido_ble_connection_unittest.cc", "fido/ble/fido_ble_connection_unittest.cc",
"fido/ble/fido_ble_device_unittest.cc", "fido/ble/fido_ble_device_unittest.cc",
"fido/ble/fido_ble_frames_unittest.cc", "fido/ble/fido_ble_frames_unittest.cc",
......
...@@ -11,6 +11,8 @@ component("fido") { ...@@ -11,6 +11,8 @@ component("fido") {
"attestation_object.h", "attestation_object.h",
"attestation_statement.cc", "attestation_statement.cc",
"attestation_statement.h", "attestation_statement.h",
"attestation_statement_formats.cc",
"attestation_statement_formats.h",
"attested_credential_data.cc", "attested_credential_data.cc",
"attested_credential_data.h", "attested_credential_data.h",
"authenticator_data.cc", "authenticator_data.cc",
...@@ -57,8 +59,6 @@ component("fido") { ...@@ -57,8 +59,6 @@ component("fido") {
"device_response_converter.h", "device_response_converter.h",
"ec_public_key.cc", "ec_public_key.cc",
"ec_public_key.h", "ec_public_key.h",
"fido_attestation_statement.cc",
"fido_attestation_statement.h",
"fido_authenticator.h", "fido_authenticator.h",
"fido_constants.cc", "fido_constants.cc",
"fido_constants.h", "fido_constants.h",
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_attestation_statement.h" #include "device/fido/attestation_statement_formats.h"
#include <utility> #include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h" #include "third_party/boringssl/src/include/openssl/bytestring.h"
...@@ -15,6 +14,8 @@ namespace device { ...@@ -15,6 +14,8 @@ namespace device {
namespace { namespace {
constexpr char kFidoFormatName[] = "fido-u2f"; constexpr char kFidoFormatName[] = "fido-u2f";
constexpr char kPackedAttestationFormat[] = "packed";
constexpr char kAlgorithmKey[] = "alg";
constexpr char kSignatureKey[] = "sig"; constexpr char kSignatureKey[] = "sig";
constexpr char kX509CertKey[] = "x5c"; constexpr char kX509CertKey[] = "x5c";
...@@ -148,4 +149,48 @@ bool FidoAttestationStatement:: ...@@ -148,4 +149,48 @@ bool FidoAttestationStatement::
return false; return false;
} }
PackedAttestationStatement::PackedAttestationStatement(
CoseAlgorithmIdentifier algorithm,
std::vector<uint8_t> signature,
std::vector<std::vector<uint8_t>> x509_certificates)
: AttestationStatement(kPackedAttestationFormat),
algorithm_(algorithm),
signature_(signature),
x509_certificates_(std::move(x509_certificates)) {
DCHECK(!signature_.empty());
}
PackedAttestationStatement::~PackedAttestationStatement() = default;
cbor::CBORValue::MapValue PackedAttestationStatement::GetAsCBORMap() const {
cbor::CBORValue::MapValue attestation_statement_map;
// alg
attestation_statement_map[cbor::CBORValue(kAlgorithmKey)] =
cbor::CBORValue(static_cast<int>(algorithm_));
// sig
attestation_statement_map[cbor::CBORValue(kSignatureKey)] =
cbor::CBORValue(signature_);
// x5c (optional)
if (!x509_certificates_.empty()) {
std::vector<cbor::CBORValue> certificate_array;
for (const auto& cert : x509_certificates_) {
certificate_array.push_back(cbor::CBORValue(cert));
}
attestation_statement_map[cbor::CBORValue(kX509CertKey)] =
cbor::CBORValue(std::move(certificate_array));
}
return attestation_statement_map;
}
bool PackedAttestationStatement::
IsAttestationCertificateInappropriatelyIdentifying() {
for (const auto& der_bytes : x509_certificates_) {
if (IsCertificateInappropriatelyIdentifying(der_bytes)) {
return true;
}
}
return false;
}
} // namespace device } // namespace device
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_ATTESTATION_STATEMENT_H_ #ifndef DEVICE_FIDO_ATTESTATION_STATEMENT_FORMATS_H_
#define DEVICE_FIDO_FIDO_ATTESTATION_STATEMENT_H_ #define DEVICE_FIDO_ATTESTATION_STATEMENT_FORMATS_H_
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "components/cbor/cbor_values.h" #include "components/cbor/cbor_values.h"
#include "device/fido/attestation_statement.h" #include "device/fido/attestation_statement.h"
#include "device/fido/fido_constants.h"
namespace device { namespace device {
...@@ -28,12 +29,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAttestationStatement ...@@ -28,12 +29,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAttestationStatement
std::vector<std::vector<uint8_t>> x509_certificates); std::vector<std::vector<uint8_t>> x509_certificates);
~FidoAttestationStatement() override; ~FidoAttestationStatement() override;
// AttestationStatement overrides // AttestationStatement
// Produces a map in the following format:
// { "x5c": [ x509_certs bytes ], "sig": signature bytes ] }
cbor::CBORValue::MapValue GetAsCBORMap() const override; cbor::CBORValue::MapValue GetAsCBORMap() const override;
bool IsAttestationCertificateInappropriatelyIdentifying() override; bool IsAttestationCertificateInappropriatelyIdentifying() override;
private: private:
...@@ -43,6 +40,30 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAttestationStatement ...@@ -43,6 +40,30 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAttestationStatement
DISALLOW_COPY_AND_ASSIGN(FidoAttestationStatement); DISALLOW_COPY_AND_ASSIGN(FidoAttestationStatement);
}; };
// Implements the "packed" attestation statement format from
// https://www.w3.org/TR/webauthn/#packed-attestation.
//
// It currently only supports the (optional) "x5c" field, but not "ecdaaKeyId"
// (see packedStmtFormat choices).
class COMPONENT_EXPORT(DEVICE_FIDO) PackedAttestationStatement
: public AttestationStatement {
public:
PackedAttestationStatement(
CoseAlgorithmIdentifier algorithm,
std::vector<uint8_t> signature,
std::vector<std::vector<uint8_t>> x509_certificates);
~PackedAttestationStatement() override;
// AttestationStatement
cbor::CBORValue::MapValue GetAsCBORMap() const override;
bool IsAttestationCertificateInappropriatelyIdentifying() override;
private:
const CoseAlgorithmIdentifier algorithm_;
const std::vector<uint8_t> signature_;
const std::vector<std::vector<uint8_t>> x509_certificates_;
};
} // namespace device } // namespace device
#endif // DEVICE_FIDO_FIDO_ATTESTATION_STATEMENT_H_ #endif // DEVICE_FIDO_ATTESTATION_STATEMENT_FORMATS_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <vector>
#include "components/cbor/cbor_writer.h"
#include "device/fido/attestation_statement_formats.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h"
#include "device/fido/fido_test_data.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
// The signature part from test_data::kPackedAttestationStatementCBOR.
constexpr uint8_t kSignature[] = {
0x30, 0x45, 0x02, 0x20, 0x32, 0x47, 0x79, 0xC6, 0x8F, 0x33, 0x80, 0x28,
0x8A, 0x11, 0x97, 0xB6, 0x09, 0x5F, 0x7A, 0x6E, 0xB9, 0xB1, 0xB1, 0xC1,
0x27, 0xF6, 0x6A, 0xE1, 0x2A, 0x99, 0xFE, 0x85, 0x32, 0xEC, 0x23, 0xB9,
0x02, 0x21, 0x00, 0xE3, 0x95, 0x16, 0xAC, 0x4D, 0x61, 0xEE, 0x64, 0x04,
0x4D, 0x50, 0xB4, 0x15, 0xA6, 0xA4, 0xD4, 0xD8, 0x4B, 0xA6, 0xD8, 0x95,
0xCB, 0x5A, 0xB7, 0xA1, 0xAA, 0x7D, 0x08, 0x1D, 0xE3, 0x41, 0xFA,
};
// The certificates part from test_data::kPackedAttestationStatementCBOR.
constexpr uint8_t kCertificates[] = {
0x30, 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, 0x01,
0x02, 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x2E,
0x31, 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x23, 0x59,
0x75, 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x52, 0x6F,
0x6F, 0x74, 0x20, 0x43, 0x41, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C,
0x20, 0x34, 0x35, 0x37, 0x32, 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20,
0x17, 0x0D, 0x31, 0x34, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x5A, 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30,
0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A,
0x30, 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62,
0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, 0x53,
0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, 0x38, 0x32,
0x33, 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48,
0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3C, 0xCA, 0xB9,
0x2C, 0xCB, 0x97, 0x28, 0x7E, 0xE8, 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC,
0xD6, 0xB6, 0xF1, 0x65, 0xB2, 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31,
0xC1, 0x6B, 0x74, 0x2B, 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB,
0x54, 0x6C, 0x9B, 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85,
0x89, 0x9E, 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F,
0xF4, 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01,
0x04, 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, 0x2E,
0x36, 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, 0x34, 0x38,
0x32, 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, 0x2B, 0x06, 0x01,
0x04, 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, 0x04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x53, 0xFA, 0x4A, 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79,
0xA1, 0x33, 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC,
0x72, 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62,
0x4B, 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, 0xAF,
0x97, 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, 0x35, 0x6D,
0x8E, 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, 0x36, 0xC6, 0xB1,
0x10, 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, 0xCA, 0xE6, 0x40, 0xFF,
0x1B, 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, 0xF7, 0xA9, 0x5F, 0x06, 0x07,
0x33, 0xF5,
};
TEST(PackedAttestationStatementTest, CBOR) {
EXPECT_THAT(
*cbor::CBORWriter::Write(
cbor::CBORValue(PackedAttestationStatement(
CoseAlgorithmIdentifier::kCoseEs256,
fido_parsing_utils::Materialize(kSignature),
{fido_parsing_utils::Materialize(kCertificates)})
.GetAsCBORMap())),
testing::ElementsAreArray(test_data::kPackedAttestationStatementCBOR));
}
TEST(PackedAttestationStatementTest, CBOR_NoCerts) {
EXPECT_THAT(*cbor::CBORWriter::Write(cbor::CBORValue(
PackedAttestationStatement(
CoseAlgorithmIdentifier::kCoseEs256,
fido_parsing_utils::Materialize(kSignature), {})
.GetAsCBORMap())),
testing::ElementsAreArray(
test_data::kPackedAttestationStatementCBORNoCerts));
}
} // namespace
} // namespace device
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <utility> #include <utility>
#include "device/fido/attestation_object.h" #include "device/fido/attestation_object.h"
#include "device/fido/attestation_statement_formats.h"
#include "device/fido/attested_credential_data.h" #include "device/fido/attested_credential_data.h"
#include "device/fido/authenticator_data.h" #include "device/fido/authenticator_data.h"
#include "device/fido/ec_public_key.h" #include "device/fido/ec_public_key.h"
#include "device/fido/fido_attestation_statement.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
namespace device { namespace device {
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
#include "components/cbor/cbor_reader.h" #include "components/cbor/cbor_reader.h"
#include "components/cbor/cbor_values.h" #include "components/cbor/cbor_values.h"
#include "components/cbor/cbor_writer.h" #include "components/cbor/cbor_writer.h"
#include "device/fido/attestation_statement_formats.h"
#include "device/fido/authenticator_get_assertion_response.h" #include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/authenticator_make_credential_response.h" #include "device/fido/authenticator_make_credential_response.h"
#include "device/fido/device_response_converter.h" #include "device/fido/device_response_converter.h"
#include "device/fido/ec_public_key.h" #include "device/fido/ec_public_key.h"
#include "device/fido/fido_attestation_statement.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
#include "device/fido/fido_test_data.h" #include "device/fido/fido_test_data.h"
......
...@@ -684,6 +684,115 @@ constexpr uint8_t kU2fAttestationStatementCBOR[] = { ...@@ -684,6 +684,115 @@ constexpr uint8_t kU2fAttestationStatementCBOR[] = {
0x33, 0xF5, 0x33, 0xF5,
}; };
// Like kU2fAttestationStatementCBOR but in 'packed' format.
constexpr uint8_t kPackedAttestationStatementCBOR[] = {
// Map(3)
0xA3,
// Text(3)
0x63,
// "alg"
0x61, 0x6C, 0x67,
// COSEAlgorithmIdentifier "ES256" (-7)
0x26,
// Text(3)
0x63,
// "sig"
0x73, 0x69, 0x67,
// Bytes(71)
0x58, 0x47,
// Byte array content
0x30, 0x45, 0x02, 0x20, 0x32, 0x47, 0x79, 0xC6, 0x8F, 0x33, 0x80, 0x28,
0x8A, 0x11, 0x97, 0xB6, 0x09, 0x5F, 0x7A, 0x6E, 0xB9, 0xB1, 0xB1, 0xC1,
0x27, 0xF6, 0x6A, 0xE1, 0x2A, 0x99, 0xFE, 0x85, 0x32, 0xEC, 0x23, 0xB9,
0x02, 0x21, 0x00, 0xE3, 0x95, 0x16, 0xAC, 0x4D, 0x61, 0xEE, 0x64, 0x04,
0x4D, 0x50, 0xB4, 0x15, 0xA6, 0xA4, 0xD4, 0xD8, 0x4B, 0xA6, 0xD8, 0x95,
0xCB, 0x5A, 0xB7, 0xA1, 0xAA, 0x7D, 0x08, 0x1D, 0xE3, 0x41, 0xFA,
// Text(3)
0x63,
// "x5c"
0x78, 0x35, 0x63,
// Array(1)
0x81,
// Bytes(590)
0x59, 0x02, 0x4E,
// Byte array content
0x30, 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, 0x01,
0x02, 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x2E,
0x31, 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x23, 0x59,
0x75, 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x52, 0x6F,
0x6F, 0x74, 0x20, 0x43, 0x41, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C,
0x20, 0x34, 0x35, 0x37, 0x32, 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20,
0x17, 0x0D, 0x31, 0x34, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x5A, 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30,
0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A,
0x30, 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62,
0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, 0x53,
0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, 0x38, 0x32,
0x33, 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48,
0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3C, 0xCA, 0xB9,
0x2C, 0xCB, 0x97, 0x28, 0x7E, 0xE8, 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC,
0xD6, 0xB6, 0xF1, 0x65, 0xB2, 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31,
0xC1, 0x6B, 0x74, 0x2B, 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB,
0x54, 0x6C, 0x9B, 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85,
0x89, 0x9E, 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F,
0xF4, 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01,
0x04, 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, 0x2E,
0x36, 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, 0x34, 0x38,
0x32, 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, 0x2B, 0x06, 0x01,
0x04, 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, 0x04,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53, 0xFA, 0x4A, 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79,
0xA1, 0x33, 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC,
0x72, 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62,
0x4B, 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, 0xAF,
0x97, 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, 0x35, 0x6D,
0x8E, 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, 0x36, 0xC6, 0xB1,
0x10, 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, 0xCA, 0xE6, 0x40, 0xFF,
0x1B, 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, 0xF7, 0xA9, 0x5F, 0x06, 0x07,
0x33, 0xF5,
};
// Like kPackedAttestationStatementCBOR but certs are omitted.
constexpr uint8_t kPackedAttestationStatementCBORNoCerts[] = {
// Map(2)
0xA2,
// Text(3)
0x63,
// "alg"
0x61, 0x6C, 0x67,
// COSEAlgorithmIdentifier "ES256" (-7)
0x26,
// Text(3)
0x63,
// "sig"
0x73, 0x69, 0x67,
// Bytes(71)
0x58, 0x47,
// Byte array content
0x30, 0x45, 0x02, 0x20, 0x32, 0x47, 0x79, 0xC6, 0x8F, 0x33, 0x80, 0x28,
0x8A, 0x11, 0x97, 0xB6, 0x09, 0x5F, 0x7A, 0x6E, 0xB9, 0xB1, 0xB1, 0xC1,
0x27, 0xF6, 0x6A, 0xE1, 0x2A, 0x99, 0xFE, 0x85, 0x32, 0xEC, 0x23, 0xB9,
0x02, 0x21, 0x00, 0xE3, 0x95, 0x16, 0xAC, 0x4D, 0x61, 0xEE, 0x64, 0x04,
0x4D, 0x50, 0xB4, 0x15, 0xA6, 0xA4, 0xD4, 0xD8, 0x4B, 0xA6, 0xD8, 0x95,
0xCB, 0x5A, 0xB7, 0xA1, 0xAA, 0x7D, 0x08, 0x1D, 0xE3, 0x41, 0xFA,
};
// U2F response blob produced by a U2F sign request used in example 7 of the // U2F response blob produced by a U2F sign request used in example 7 of the
// CTAP spec. // CTAP spec.
// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#using-the-ctap2-authenticatorgetassertion-command-with-ctap1-u2f-authenticators // https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#using-the-ctap2-authenticatorgetassertion-command-with-ctap1-u2f-authenticators
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#include "device/fido/fido_attestation_statement.h" #include "device/fido/attestation_statement_formats.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
#include "device/fido/mac/credential_metadata.h" #include "device/fido/mac/credential_metadata.h"
...@@ -201,9 +201,9 @@ void MakeCredentialOperation::PromptTouchIdDone(bool success) { ...@@ -201,9 +201,9 @@ void MakeCredentialOperation::PromptTouchIdDone(bool success) {
std::vector<std::vector<uint8_t>> no_certificates; std::vector<std::vector<uint8_t>> no_certificates;
AuthenticatorMakeCredentialResponse response(AttestationObject( AuthenticatorMakeCredentialResponse response(AttestationObject(
std::move(*authenticator_data), std::move(*authenticator_data),
// TODO(martinkr): Add a PackedAttestationStatement for self-attestation. std::make_unique<PackedAttestationStatement>(
std::make_unique<FidoAttestationStatement>(std::move(*signature), CoseAlgorithmIdentifier::kCoseEs256, std::move(*signature),
std::move(no_certificates)))); std::move(no_certificates))));
std::move(callback()) std::move(callback())
.Run(CtapDeviceResponseCode::kSuccess, std::move(response)); .Run(CtapDeviceResponseCode::kSuccess, std::move(response));
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "components/cbor/cbor_writer.h" #include "components/cbor/cbor_writer.h"
#include "device/fido/ec_public_key.h" #include "device/fido/ec_public_key.h"
#include "device/fido/fido_attestation_statement.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
#include "device/fido/mac/keychain.h" #include "device/fido/mac/keychain.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment