|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
RFC 8446 4.4.2/4.4.3: the Certificate and CertificateVerify handshake messages. More...
Go to the source code of this file.
Data Structures | |
| struct | quic_tls_cert_entry |
| A view of one CertificateEntry's cert_data within the message buffer. More... | |
| struct | quic_tls_cert_chain_out |
| Destination for quic_tls_cert_chain: entries[0..cap-1] and the count actually written. More... | |
Functions | |
| int | quic_tls_cert_parse (quic_span buf, quic_span *context, quic_tls_cert_entry *first) |
| Parse a Certificate message body (after the handshake header). | |
| int | quic_tls_cert_chain (quic_span buf, quic_span *context, const quic_tls_cert_chain_out *out) |
| Parse a Certificate message body (after the handshake header) and view EVERY CertificateEntry's cert_data into out->entries[0..out->cap-1], leaf first. | |
| int | quic_tls_certverify_parse (quic_span buf, u16 *scheme, quic_span *sig) |
| Parse a CertificateVerify body: a 2-byte SignatureScheme then a 2-byte-length-prefixed signature. | |
| int | quic_tls_certverify_ed25519 (quic_span sig, const u8 transcript_hash[32], const u8 pubkey[32]) |
| Verify a server's CertificateVerify Ed25519 signature (RFC 8446 4.4.3). | |
RFC 8446 4.4.2/4.4.3: the Certificate and CertificateVerify handshake messages.
Certificate carries a request context and a chain of entries, each an opaque cert_data (X.509, not parsed here) plus extensions. CertificateVerify carries a SignatureScheme and the signature over the handshake transcript.
| int quic_tls_cert_chain | ( | quic_span | buf, |
| quic_span * | context, | ||
| const quic_tls_cert_chain_out * | out ) |
Parse a Certificate message body (after the handshake header) and view EVERY CertificateEntry's cert_data into out->entries[0..out->cap-1], leaf first.
Sets *out->count.
| buf | the Certificate message body |
| context | receives the certificate_request_context view |
| out | destination entry views and count |
| int quic_tls_cert_parse | ( | quic_span | buf, |
| quic_span * | context, | ||
| quic_tls_cert_entry * | first ) |
Parse a Certificate message body (after the handshake header).
Sets the request context view and the first CertificateEntry's cert_data. Only the first entry (the end-entity certificate) is exposed; the rest of the chain is skipped over.
| buf | the Certificate message body |
| context | receives the certificate_request_context view |
| first | receives the first CertificateEntry's cert_data view |
| int quic_tls_certverify_ed25519 | ( | quic_span | sig, |
| const u8 | transcript_hash[32], | ||
| const u8 | pubkey[32] ) |
Verify a server's CertificateVerify Ed25519 signature (RFC 8446 4.4.3).
The signed content is 64 octets of 0x20, the context string "TLS 1.3, server CertificateVerify", a 0x00 separator, then the transcript hash.
| sig | the signature from the CertificateVerify message |
| transcript_hash | the handshake transcript hash |
| pubkey | the server's Ed25519 public key (from its certificate) |
Parse a CertificateVerify body: a 2-byte SignatureScheme then a 2-byte-length-prefixed signature.
| buf | the CertificateVerify message body |
| scheme | receives the SignatureScheme code point |
| sig | receives the signature view |