summaryrefslogtreecommitdiff
path: root/chromium/device/fido/attestation_statement.cc
blob: 11e9d114b35580424d188350d172f481eee4c787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2017 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 "device/fido/attestation_statement.h"

#include <string>
#include <utility>

#include "device/fido/fido_constants.h"

namespace device {

AttestationStatement::~AttestationStatement() = default;

AttestationStatement::AttestationStatement(std::string format)
    : format_(std::move(format)) {}

NoneAttestationStatement::NoneAttestationStatement()
    : AttestationStatement(kNoneAttestationValue) {}

NoneAttestationStatement::~NoneAttestationStatement() = default;

bool NoneAttestationStatement::
    IsAttestationCertificateInappropriatelyIdentifying() const {
  return false;
}

bool NoneAttestationStatement::IsSelfAttestation() const {
  return false;
}

base::Optional<base::span<const uint8_t>>
NoneAttestationStatement::GetLeafCertificate() const {
  return base::nullopt;
}

cbor::Value NoneAttestationStatement::AsCBOR() const {
  return cbor::Value(cbor::Value::MapValue());
}

cbor::Value AsCBOR(const AttestationStatement& as) {
  return as.AsCBOR();
}

}  // namespace device