wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
sni_check.h
1#ifndef SALPN_SNI_CHECK_H
2#define SALPN_SNI_CHECK_H
3
6
7/* RFC 6066 3: server-side check of the ClientHello's server_name extension
8 * against this server's own certificate identity. */
9
12typedef enum {
13 SALPN_SNI_ABSENT = 0,
16 SALPN_SNI_MATCH,
17 SALPN_SNI_MISMATCH
18} salpn_sni_outcome;
19
20/* Extract the server_name (RFC 6066 3) from ch_msg, if any, and check it
21 * against tbs (the server's own certificate tbsCertificate, RFC 6125 6) via
22 * x509_san_matches. RFC 6066 3 leaves the ABSENT and MISMATCH outcomes
23 * to server policy (SHOULD NOT establish / MAY ignore): this function only
24 * classifies, callers such as sdrv_recv_client_hello decide whether a
25 * MISMATCH degrades to unrecognized_name (TLS_ALERT_UNRECOGNIZED_NAME)
26 * or is ignored. */
27salpn_sni_outcome salpn_sni_check(const u8* ch_msg, usz ch_len, wired_span tbs);
28
29#endif
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
Read-only view of a byte range.
Definition span.h:30
Linux direct syscalls.
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18