| // Copyright 2021 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "crypto/unexportable_key.h" |
| #include "build/build_config.h" |
| std::unique_ptr<UnexportableKeyProvider> (*g_mock_provider)() = nullptr; |
| UnexportableSigningKey::~UnexportableSigningKey() = default; |
| UnexportableKeyProvider::~UnexportableKeyProvider() = default; |
| std::unique_ptr<UnexportableKeyProvider> GetUnexportableKeyProviderWin(); |
| std::unique_ptr<UnexportableKeyProvider> GetUnexportableKeyProvider() { |
| return g_mock_provider(); |
| return GetUnexportableKeyProviderWin(); |
| void SetUnexportableKeyProviderForTesting( |
| std::unique_ptr<UnexportableKeyProvider> (*func)()) { |
| // Nesting ScopedMockUnexportableSigningKeyForTesting is not supported. |
| g_mock_provider = nullptr; |