vasilvv | a7300b8 | 2020-04-20 20:32:51 -0400 | [diff] [blame] | 1 | // Copyright 2020 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 | |
| 5 | #include <string> |
| 6 | |
QUICHE team | 5be974e | 2020-12-29 18:35:24 -0500 | [diff] [blame] | 7 | #include "quic/core/crypto/certificate_view.h" |
vasilvv | a7300b8 | 2020-04-20 20:32:51 -0400 | [diff] [blame] | 8 | |
| 9 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| 10 | std::string input(reinterpret_cast<const char*>(data), size); |
| 11 | |
vasilvv | 4af932c | 2020-10-30 15:09:58 -0700 | [diff] [blame] | 12 | std::unique_ptr<quic::CertificateView> view = |
| 13 | quic::CertificateView::ParseSingleCertificate(input); |
| 14 | if (view != nullptr) { |
| 15 | view->GetHumanReadableSubject(); |
| 16 | } |
vasilvv | a7300b8 | 2020-04-20 20:32:51 -0400 | [diff] [blame] | 17 | quic::CertificatePrivateKey::LoadFromDer(input); |
| 18 | return 0; |
| 19 | } |