Coverage Report

Created: 2026-03-31 06:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gnutls/fuzz/gnutls_private_key_parser_fuzzer.c
Line
Count
Source
1
/*
2
# Copyright 2016 Google Inc.
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#      https://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
#
16
################################################################################
17
*/
18
19
#include <assert.h>
20
#include <stdint.h>
21
22
#include <gnutls/gnutls.h>
23
#include <gnutls/x509.h>
24
25
#include "fuzzer.h"
26
27
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
28
12.0k
{
29
12.0k
  gnutls_datum_t raw;
30
12.0k
  gnutls_x509_privkey_t key;
31
12.0k
  int ret;
32
33
12.0k
  raw.data = (unsigned char *)data;
34
12.0k
  raw.size = size;
35
36
12.0k
  ret = gnutls_x509_privkey_init(&key);
37
12.0k
  assert(ret >= 0);
38
39
12.0k
  ret = gnutls_x509_privkey_import(key, &raw, GNUTLS_X509_FMT_DER);
40
41
12.0k
  gnutls_x509_privkey_deinit(key);
42
12.0k
  return 0;
43
12.0k
}