1 // Copyright 2019 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifdef UNSAFE_BUFFERS_BUILD 6 // TODO(crbug.com/40284755): Remove this and spanify to fix the errors. 7 #pragma allow_unsafe_buffers 8 #endif 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 #include <string_view> 14 15 #include "base/memory/scoped_refptr.h" 16 #include "net/cert/ct_serialization.h" 17 #include "net/cert/signed_certificate_timestamp.h" 18 19 using net::ct::DecodeSignedCertificateTimestamp; 20 using net::ct::SignedCertificateTimestamp; 21 LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)22extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 23 scoped_refptr<SignedCertificateTimestamp> sct; 24 std::string_view buffer(reinterpret_cast<const char*>(data), size); 25 DecodeSignedCertificateTimestamp(&buffer, &sct); 26 return 0; 27 } 28