LCOV - code coverage report
Current view: top level - ballet/x509 - fd_x509_mock.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 1 1 100.0 %
Date: 2026-09-17 04:28:31 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_ballet_x509_fd_x509_mock_h
       2             : #define HEADER_fd_src_ballet_x509_fd_x509_mock_h
       3             : 
       4             : /* fd_x509_mock.h generates mock X.509 certificates for QUIC
       5             :    peer-to-peer use.  These certificates are deliberately crafted to
       6             :    pass as valid when connecting to a rustls peer.  They are however
       7             :    semantically invalid (e.g. hardcoded to subject 'localhost').  The
       8             :    use of X.509 is a mistake in the first place, and should be fixed via
       9             :    RFC 7250 raw public keys.  As soon as raw public keys are implemented
      10             :    network wide, this code should be deleted. */
      11             : 
      12             : #include "../../util/fd_util_base.h"
      13             : 
      14             : /* FD_X509_MOCK_CERT_SZ is the byte size of the DER serialization of a
      15             :    mock X.509 certificate */
      16             : 
      17      301152 : #define FD_X509_MOCK_CERT_SZ (0xf9)
      18             : 
      19             : FD_PROTOTYPES_BEGIN
      20             : 
      21             : /* fd_x509_mock_cert generates a dummy X.509 certificate given an
      22             :    Ed25519 public key.  Resulting cert will contain an invalid
      23             :    signature.  Certificate bytes (of size FD_X509_MOCK_CERT_SZ) are
      24             :    copied out to buf. */
      25             : 
      26             : void
      27             : fd_x509_mock_cert( uchar buf[ static FD_X509_MOCK_CERT_SZ ],
      28             :                    uchar public_key[ static 32 ] );
      29             : 
      30             : FD_PROTOTYPES_END
      31             : 
      32             : #endif /* HEADER_fd_src_ballet_x509_fd_x509_mock_h */

Generated by: LCOV version 1.14