summaryrefslogtreecommitdiff
path: root/chromium/net/cert/internal/parse_certificate_fuzzer.cc
blob: 67ea6986e54bf89f0a5384b541e3644d4e457066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2016 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 <stddef.h>
#include <stdint.h>

#include "base/macros.h"
#include "net/cert/internal/cert_errors.h"
#include "net/cert/internal/parsed_certificate.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  net::CertErrors errors;
  scoped_refptr<net::ParsedCertificate> cert =
      net::ParsedCertificate::Create(data, size, {}, &errors);

  // TODO(crbug.com/634443): Ensure that !errors.empty() on parsing failure.
  return 0;
}