Coverage Report

Created: 2025-11-05 06:16

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/nss/fuzz/targets/ech.cc
Line
Count
Source
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#include <cassert>
6
#include <cstddef>
7
#include <cstdint>
8
9
#include "nss_scoped_ptrs.h"
10
#include "prio.h"
11
#include "sslexp.h"
12
13
#include "base/database.h"
14
#include "tls/socket.h"
15
16
904
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t len) {
17
904
  static NSSDatabase db = NSSDatabase();
18
904
  static PRDescIdentity id = PR_GetUniqueIdentity("fuzz-ech");
19
20
904
  static TlsSocket::DummyPrSocket socket = TlsSocket::DummyPrSocket(nullptr, 0);
21
904
  static ScopedPRFileDesc prFd(DummyIOLayerMethods::CreateFD(id, &socket));
22
904
  static PRFileDesc* sslFd = SSL_ImportFD(nullptr, prFd.get());
23
904
  assert(sslFd == prFd.get());
24
25
904
  SSL_SetClientEchConfigs(sslFd, data, len);
26
27
904
  return 0;
28
904
}