test_root_certs_android.cc 817 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2011 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 "net/cert/test_root_certs.h"
  5. #include "base/location.h"
  6. #include "net/android/network_library.h"
  7. #include "net/cert/x509_certificate.h"
  8. #include "third_party/boringssl/src/include/openssl/pool.h"
  9. namespace net {
  10. bool TestRootCerts::AddImpl(X509Certificate* certificate) {
  11. android::AddTestRootCertificate(
  12. CRYPTO_BUFFER_data(certificate->cert_buffer()),
  13. CRYPTO_BUFFER_len(certificate->cert_buffer()));
  14. return true;
  15. }
  16. void TestRootCerts::ClearImpl() {
  17. if (IsEmpty())
  18. return;
  19. android::ClearTestRootCertificates();
  20. }
  21. TestRootCerts::~TestRootCerts() = default;
  22. void TestRootCerts::Init() {}
  23. } // namespace net