|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
A fixed, deterministic server identity for samples and tests: the key bytes are a counting pattern, so every run presents the same self-signed certificate. More...
Go to the source code of this file.
Data Structures | |
| struct | wired_srvboot_demo_keys |
| Storage for the demo key material; wired_srvboot_id holds views into it, so it must outlive the server run (make it static). More... | |
Functions | |
| void | wired_srvboot_demo (wired_srvboot_id *id, wired_srvboot_demo_keys *k, u8 base, const char *scid) |
| Reset id and fill it with the demo identity: priv[i] = base + i, seed[i] = base + 0x40 + i, rnd[i] = base + 0x60 + i, pub = X25519(priv), scid = the bytes of scid (at most 20). | |
| int | wired_srvboot_cert_sha256 (const wired_srvboot_id *id, u8 out[32]) |
| SHA-256 of the leaf certificate id presents: chain[0] when an external chain is set, otherwise the self-signed certificate built from cert_seed. | |
| int | wired_srvboot_log_fingerprint (i64 fd, const wired_srvboot_id *id) |
| Log "cert sha-256 fingerprint: aa:bb:...\n" (colon-separated, the form browsers and openssl print) for id's leaf certificate to fd. | |
A fixed, deterministic server identity for samples and tests: the key bytes are a counting pattern, so every run presents the same self-signed certificate.
Never use it for a real deployment.
| int wired_srvboot_cert_sha256 | ( | const wired_srvboot_id * | id, |
| u8 | out[32] ) |
SHA-256 of the leaf certificate id presents: chain[0] when an external chain is set, otherwise the self-signed certificate built from cert_seed.
This is the value a browser's WebTransport serverCertificateHashes needs. Builds the certificate in a process-wide scratch server (not reentrant).
| id | server identity |
| out | 32-byte digest |
| void wired_srvboot_demo | ( | wired_srvboot_id * | id, |
| wired_srvboot_demo_keys * | k, | ||
| u8 | base, | ||
| const char * | scid ) |
Reset id and fill it with the demo identity: priv[i] = base + i, seed[i] = base + 0x40 + i, rnd[i] = base + 0x60 + i, pub = X25519(priv), scid = the bytes of scid (at most 20).
Every other field is 0, so the certificate is self-signed; set max_datagram_frame_size etc. afterwards.
| id | identity to fill |
| k | key storage; must outlive every use of id |
| base | first byte of the counting pattern |
| scid | NUL-terminated server connection id; must outlive id |
| int wired_srvboot_log_fingerprint | ( | i64 | fd, |
| const wired_srvboot_id * | id ) |
Log "cert sha-256 fingerprint: aa:bb:...\n" (colon-separated, the form browsers and openssl print) for id's leaf certificate to fd.
| fd | file descriptor (2 = stderr) |
| id | server identity |