...

Source file src/github.com/google/certificate-transparency-go/x509/fuzz_test.go

Documentation: github.com/google/certificate-transparency-go/x509

     1  // Copyright 2024 Google LLC. All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package x509
    16  
    17  import (
    18  	"testing"
    19  )
    20  
    21  func FuzzParseECPrivateKeyTest(f *testing.F) {
    22  	f.Fuzz(func(t *testing.T, data []byte) {
    23  		_, _ = ParseECPrivateKey(data)
    24  	})
    25  }
    26  
    27  func FuzzParsePKIXPublicKeyTest(f *testing.F) {
    28  	f.Fuzz(func(t *testing.T, data []byte) {
    29  		_, _ = ParsePKIXPublicKey(data)
    30  	})
    31  }
    32  
    33  func FuzzParseTBSCertificateTest(f *testing.F) {
    34  	f.Fuzz(func(t *testing.T, data []byte) {
    35  		_, _ = ParseTBSCertificate(data)
    36  	})
    37  }
    38  
    39  func FuzzParseCertificateTest(f *testing.F) {
    40  	f.Fuzz(func(t *testing.T, data []byte) {
    41  		_, _ = ParseCertificate(data)
    42  	})
    43  }
    44  
    45  func FuzzParseCertificatesTest(f *testing.F) {
    46  	f.Fuzz(func(t *testing.T, data []byte) {
    47  		_, _ = ParseCertificates(data)
    48  	})
    49  }
    50  
    51  func FuzzParseCRLTest(f *testing.F) {
    52  	f.Fuzz(func(t *testing.T, data []byte) {
    53  		_, _ = ParseCRL(data)
    54  	})
    55  }
    56  
    57  func FuzzParseDERCRLTest(f *testing.F) {
    58  	f.Fuzz(func(t *testing.T, data []byte) {
    59  		_, _ = ParseDERCRL(data)
    60  	})
    61  }
    62  
    63  func FuzzParseCertificateRequestTest(f *testing.F) {
    64  	f.Fuzz(func(t *testing.T, data []byte) {
    65  		_, _ = ParseCertificateRequest(data)
    66  	})
    67  }
    68  
    69  func FuzzParsePKCS8PrivateKeyest(f *testing.F) {
    70  	f.Fuzz(func(t *testing.T, data []byte) {
    71  		_, _ = ParsePKCS8PrivateKey(data)
    72  	})
    73  }
    74  
    75  func FuzzParsePKCS1PrivateKeyTest(f *testing.F) {
    76  	f.Fuzz(func(t *testing.T, data []byte) {
    77  		_, _ = ParsePKCS1PrivateKey(data)
    78  	})
    79  }
    80  
    81  func FuzzParsePKCS1PublicKeyTest(f *testing.F) {
    82  	f.Fuzz(func(t *testing.T, data []byte) {
    83  		_, _ = ParsePKCS1PublicKey(data)
    84  	})
    85  }
    86  
    87  func FuzzParseCertificateListTest(f *testing.F) {
    88  	f.Fuzz(func(t *testing.T, data []byte) {
    89  		_, _ = ParseCertificateList(data)
    90  	})
    91  }
    92  
    93  func FuzzParseCertificateListDERTest(f *testing.F) {
    94  	f.Fuzz(func(t *testing.T, data []byte) {
    95  		_, _ = ParseCertificateListDER(data)
    96  	})
    97  }
    98  

View as plain text