diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-11-17 14:20:39 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-01-13 13:20:13 +0000 |
commit | a64d82485d52c6ae1075217e611a92522fbe6560 (patch) | |
tree | 2ea28e494a161d7e9cdcf9468fad9bf42c05af92 /include | |
parent | 0f7b5cc9f3d487641dd5f4003e0be88fb2111e98 (diff) |
QUIC Transport Parameters: Add CID encoder/decoder, make ID optional
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_wire.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/internal/quic_wire.h b/include/internal/quic_wire.h index e1d001c4e3..0893d2425b 100644 --- a/include/internal/quic_wire.h +++ b/include/internal/quic_wire.h @@ -457,6 +457,14 @@ int ossl_quic_wire_encode_transport_param_int(WPACKET *pkt, uint64_t value); /* + * Encodes a QUIC transport parameter TLV with a given ID into the WPACKET. + * The payload is a QUIC connection ID. + */ +int ossl_quic_wire_encode_transport_param_cid(WPACKET *wpkt, + uint64_t id, + const QUIC_CONN_ID *cid); + +/* * QUIC Wire Format Decoding * ========================= * @@ -715,8 +723,8 @@ int ossl_quic_wire_peek_transport_param(PACKET *pkt, uint64_t *id); * returned on success. This points inside the PACKET's buffer and is therefore * valid as long as the PACKET's buffer is valid. * - * The transport parameter ID is written to *id and the length of the payload - * in bytes is written to *len. + * The transport parameter ID is written to *id (if non-NULL) and the length of + * the payload in bytes is written to *len. * * Returns NULL on failure. */ @@ -727,11 +735,21 @@ const unsigned char *ossl_quic_wire_decode_transport_param_bytes(PACKET *pkt, /* * Decodes a QUIC transport parameter TLV containing a variable-length integer. * - * The transport parameter ID is written to *id and the value is written to - * *value. + * The transport parameter ID is written to *id (if non-NULL) and the value is + * written to *value. */ int ossl_quic_wire_decode_transport_param_int(PACKET *pkt, uint64_t *id, uint64_t *value); +/* + * Decodes a QUIC transport parameter TLV containing a connection ID. + * + * The transport parameter ID is written to *id (if non-NULL) and the value is + * written to *value. + */ +int ossl_quic_wire_decode_transport_param_cid(PACKET *pkt, + uint64_t *id, + QUIC_CONN_ID *cid); + #endif |