fido_authenticator.cc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "device/fido/fido_authenticator.h"
  5. #include <utility>
  6. #include "base/callback.h"
  7. #include "base/notreached.h"
  8. #include "device/fido/ctap_make_credential_request.h"
  9. #include "device/fido/fido_constants.h"
  10. namespace device {
  11. void FidoAuthenticator::ExcludeAppIdCredentialsBeforeMakeCredential(
  12. CtapMakeCredentialRequest request,
  13. MakeCredentialOptions options,
  14. base::OnceCallback<void(CtapDeviceResponseCode, absl::optional<bool>)>
  15. callback) {
  16. std::move(callback).Run(CtapDeviceResponseCode::kSuccess, absl::nullopt);
  17. }
  18. void FidoAuthenticator::GetNextAssertion(
  19. FidoAuthenticator::GetAssertionCallback callback) {
  20. NOTREACHED();
  21. }
  22. void FidoAuthenticator::GetCredentialInformationForRequest(
  23. const CtapGetAssertionRequest& request,
  24. GetCredentialInformationForRequestCallback callback) {
  25. NOTREACHED();
  26. }
  27. void FidoAuthenticator::GetTouch(base::OnceCallback<void()> callback) {}
  28. void FidoAuthenticator::GetPinRetries(
  29. FidoAuthenticator::GetRetriesCallback callback) {
  30. NOTREACHED();
  31. }
  32. void FidoAuthenticator::GetPINToken(
  33. std::string pin,
  34. std::vector<pin::Permissions> permissions,
  35. absl::optional<std::string> rp_id,
  36. FidoAuthenticator::GetTokenCallback callback) {
  37. NOTREACHED();
  38. }
  39. void FidoAuthenticator::GetUvRetries(
  40. FidoAuthenticator::GetRetriesCallback callback) {
  41. NOTREACHED();
  42. }
  43. bool FidoAuthenticator::CanGetUvToken() {
  44. return false;
  45. }
  46. void FidoAuthenticator::GetUvToken(
  47. std::vector<pin::Permissions> permissions,
  48. absl::optional<std::string> rp_id,
  49. FidoAuthenticator::GetTokenCallback callback) {
  50. NOTREACHED();
  51. }
  52. uint32_t FidoAuthenticator::CurrentMinPINLength() {
  53. NOTREACHED();
  54. return kMinPinLength;
  55. }
  56. uint32_t FidoAuthenticator::NewMinPINLength() {
  57. NOTREACHED();
  58. return kMinPinLength;
  59. }
  60. bool FidoAuthenticator::ForcePINChange() {
  61. NOTREACHED();
  62. return false;
  63. }
  64. void FidoAuthenticator::SetPIN(const std::string& pin,
  65. FidoAuthenticator::SetPINCallback callback) {
  66. NOTREACHED();
  67. }
  68. void FidoAuthenticator::ChangePIN(const std::string& old_pin,
  69. const std::string& new_pin,
  70. SetPINCallback callback) {
  71. NOTREACHED();
  72. }
  73. FidoAuthenticator::PINUVDisposition
  74. FidoAuthenticator::PINUVDispositionForMakeCredential(
  75. const CtapMakeCredentialRequest& request,
  76. const FidoRequestHandlerBase::Observer* observer) {
  77. return PINUVDisposition::kNoUV;
  78. }
  79. FidoAuthenticator::PINUVDisposition
  80. FidoAuthenticator::PINUVDispositionForGetAssertion(
  81. const CtapGetAssertionRequest& request,
  82. const FidoRequestHandlerBase::Observer* observer) {
  83. return PINUVDisposition::kNoUV;
  84. }
  85. void FidoAuthenticator::GetCredentialsMetadata(
  86. const pin::TokenResponse& pin_token,
  87. GetCredentialsMetadataCallback callback) {
  88. NOTREACHED();
  89. }
  90. void FidoAuthenticator::EnumerateCredentials(
  91. const pin::TokenResponse& pin_token,
  92. EnumerateCredentialsCallback callback) {
  93. NOTREACHED();
  94. }
  95. void FidoAuthenticator::DeleteCredential(
  96. const pin::TokenResponse& pin_token,
  97. const PublicKeyCredentialDescriptor& credential_id,
  98. DeleteCredentialCallback callback) {
  99. NOTREACHED();
  100. }
  101. bool FidoAuthenticator::SupportsUpdateUserInformation() const {
  102. return false;
  103. }
  104. void FidoAuthenticator::UpdateUserInformation(
  105. const pin::TokenResponse& pin_token,
  106. const PublicKeyCredentialDescriptor& credential_id,
  107. const PublicKeyCredentialUserEntity& updated_user,
  108. UpdateUserInformationCallback callback) {
  109. NOTREACHED();
  110. }
  111. void FidoAuthenticator::GetModality(BioEnrollmentCallback) {
  112. NOTREACHED();
  113. }
  114. void FidoAuthenticator::GetSensorInfo(BioEnrollmentCallback) {
  115. NOTREACHED();
  116. }
  117. void FidoAuthenticator::BioEnrollFingerprint(
  118. const pin::TokenResponse&,
  119. absl::optional<std::vector<uint8_t>> template_id,
  120. BioEnrollmentCallback) {
  121. NOTREACHED();
  122. }
  123. void FidoAuthenticator::BioEnrollCancel(BioEnrollmentCallback) {
  124. NOTREACHED();
  125. }
  126. void FidoAuthenticator::BioEnrollEnumerate(const pin::TokenResponse&,
  127. BioEnrollmentCallback) {
  128. NOTREACHED();
  129. }
  130. void FidoAuthenticator::BioEnrollRename(const pin::TokenResponse&,
  131. std::vector<uint8_t>,
  132. std::string,
  133. BioEnrollmentCallback) {
  134. NOTREACHED();
  135. }
  136. void FidoAuthenticator::BioEnrollDelete(const pin::TokenResponse&,
  137. std::vector<uint8_t>,
  138. BioEnrollmentCallback) {
  139. NOTREACHED();
  140. }
  141. void FidoAuthenticator::WriteLargeBlob(
  142. LargeBlob large_blob,
  143. const LargeBlobKey& large_blob_key,
  144. const absl::optional<pin::TokenResponse> pin_uv_auth_token,
  145. base::OnceCallback<void(CtapDeviceResponseCode)> callback) {
  146. NOTREACHED();
  147. }
  148. void FidoAuthenticator::ReadLargeBlob(
  149. const std::vector<LargeBlobKey>& large_blob_keys,
  150. const absl::optional<pin::TokenResponse> pin_uv_auth_token,
  151. LargeBlobReadCallback callback) {
  152. NOTREACHED();
  153. }
  154. absl::optional<base::span<const int32_t>> FidoAuthenticator::GetAlgorithms() {
  155. return absl::nullopt;
  156. }
  157. bool FidoAuthenticator::DiscoverableCredentialStorageFull() const {
  158. return false;
  159. }
  160. void FidoAuthenticator::Reset(ResetCallback callback) {
  161. std::move(callback).Run(CtapDeviceResponseCode::kCtap1ErrInvalidCommand,
  162. absl::nullopt);
  163. }
  164. FidoAuthenticator::Type FidoAuthenticator::GetType() const {
  165. return Type::kOther;
  166. }
  167. std::string FidoAuthenticator::GetDisplayName() const {
  168. return GetId();
  169. }
  170. ProtocolVersion FidoAuthenticator::SupportedProtocol() const {
  171. return ProtocolVersion::kUnknown;
  172. }
  173. bool FidoAuthenticator::SupportsCredProtectExtension() const {
  174. return Options() && Options()->supports_cred_protect;
  175. }
  176. bool FidoAuthenticator::SupportsHMACSecretExtension() const {
  177. return false;
  178. }
  179. bool FidoAuthenticator::SupportsEnterpriseAttestation() const {
  180. return false;
  181. }
  182. bool FidoAuthenticator::SupportsCredBlobOfSize(size_t num_bytes) const {
  183. return false;
  184. }
  185. } // namespace device